当前位置: 首页 > news >正文

营销型网站建设公司哪家好查询网站是否正规

营销型网站建设公司哪家好,查询网站是否正规,怎么做网站呀,营销型企业网站的策划方案文章目录 优化设计TodoView修复新增项目无法编辑问题增加了对完成状态的区分增加了选项卡删除功能更新删除请求URI添加删除命令并初始化UI添加删除按钮更改控制器 增加查询结果为空的图片增加转换器修改UI添加资源、命名空间 添加相关元素 增加了根据状态查询的功能Mytodo.Serv… 文章目录 优化设计TodoView修复新增项目无法编辑问题增加了对完成状态的区分增加了选项卡删除功能更新删除请求URI添加删除命令并初始化UI添加删除按钮更改控制器 增加查询结果为空的图片增加转换器修改UI添加资源、命名空间 添加相关元素 增加了根据状态查询的功能Mytodo.Service/ITodoService增加GetAllFilterAsync接口修改了控制器增加IToDoService接口增加所需字段属性以及所需要的方法UI层增加绑定的界面增加了IToDoService接口所对应的实现 修复更新操作无法更新状态的bug修复当Search为空时查询失败的bug 优化设计TodoView 修复新增项目无法编辑问题 更新MyToDo.Api/Service/ToDoService.cs public async TaskApiReponse AddAsync(Todo model) {try{var todo mapper.MapTodo(model);await work.GetRepositoryTodo().InsertAsync(todo);if (await work.SaveChangesAsync() 0)return new ApiReponse(true, todo);return new ApiReponse(false);}catch (Exception ex){return new ApiReponse(false, ex);} }更新MyToDo.Api/Service/MemoService.cs public async TaskApiReponse AddAsync(Memo model){try{var memo mapper.MapMemo(model);await work.GetRepositoryMemo().InsertAsync(memo);if (await work.SaveChangesAsync() 0)return new ApiReponse(true, memo);return new ApiReponse(false);}catch (Exception ex){return new ApiReponse(false, ex);}}增加了对完成状态的区分 更新MyToDo.Api/Service/TodoView.xaml ItemsControl.ItemTemplateDataTemplateBorder MinWidth200 Margin10Border.StyleStyle TargetTypeBorderStyle.TriggersDataTrigger Binding{Binding Status} Value0Setter PropertyBackground Value#1E90FF //DataTriggerDataTrigger Binding{Binding Status} Value1Setter PropertyBackground Value#3CB371 //DataTrigger/Style.Triggers/Style/Border.StyleGrid MinHeight150增加了选项卡删除功能 更新删除请求URI 更新MyToDo.Api/Service/Baservice.cs public async TaskApiResponse DeleteAsync(int id){BaseRequest request new BaseRequest();request.Method RestSharp.Method.DELETE;request.Route $api/{ServiceName}/Delete?todoid{id};return await client.ExecuteAsync(request);}添加删除命令并初始化 更新文件MyToDo/ViewModel/TodoViewModel.cs 添加内容 /// summary /// 删除项 /// /summary public DelegateCommandToDoDto DeleteCommand { get; set; }/// summary /// 删除指定项 /// /summary /// param namedto/param async private void DeleteItem(ToDoDto dto) {var delres await service.DeleteAsync(dto.Id);if (delres.Status){var model TodoDtos.FirstOrDefault(t t.Id.Equals(dto.Id));TodoDtos.Remove(dto);} } 更新内容 public TodoViewModel(ITodoService service,IContainerProvider provider) : base(provider) {//初始化对象TodoDtos new ObservableCollectionToDoDto(); RightContentTitle 添加血雨待办;//初始化命令SelectedCommand new DelegateCommandToDoDto(Selected);OpenRightContentCmd new DelegateCommand(Add);ExecuteCommand new DelegateCommandstring(ExceuteCmd);DeleteCommand new DelegateCommandToDoDto(DeleteItem);this.service service; }UI添加删除按钮 更新文件MyToDo/Views/TodoView.cs 更新内容 Grid MinHeight150!-- 给项目添加行为 --i:Interaction.Triggersi:EventTrigger EventNameMouseLeftButtonUpi:InvokeCommandAction Command{Binding DataContext.SelectedCommand, RelativeSource{RelativeSource ModeFindAncestor, AncestorTypeItemsControl}} CommandParameter{Binding} //i:EventTrigger/i:Interaction.TriggersGrid.RowDefinitionsRowDefinition Heightauto /RowDefinition //Grid.RowDefinitionsDockPanel Panel.ZIndex2 LastChildFillFalseTextBlockMargin10,10FontFamily黑体FontSize14Text{Binding Title} /!--md:PackIconMargin10,10VerticalContentAlignmentTopDockPanel.DockRightKindMore /--md:PopupBoxMargin5Panel.ZIndex1DockPanel.DockRightButtonPanel.ZIndex2Command{Binding DataContext.DeleteCommand, RelativeSource{RelativeSource ModeFindAncestor, AncestorTypeItemsControl}}CommandParameter{Binding}Content删除 //md:PopupBox/DockPanel更改控制器 更新文件MyToDo.Api/Controllers/TodoController.cs 更新内容 public async TaskApiReponse Delete(int todoid) await service.DeleteAsync(todoid);增加查询结果为空的图片 增加转换器 添加文件MyToDo/Common/Converters/IntToVisibilityConveter.cs 更新内容 using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using System.Windows.Media;namespace Mytodo.Common.Converters {[ValueConversion(typeof(Color), typeof(Brush))]public class ColorToBrushConverter : IValueConverter{public object Convert(object value, Type targetType, object parameter, CultureInfo culture){if (value is Color color){return new SolidColorBrush(color);}return Binding.DoNothing;}public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture){if (value is SolidColorBrush brush){return brush.Color;}return default(Color);}} } 修改UI 添加资源、命名空间 更新文件MyToDo//Converters/TodoView.xaml.cs 更新内容 xmlns:cvclr-namespace:Mytodo.Common.Converters UserControl.ResourcesResourceDictionarycv:IntToVisibilityConveter x:KeyIntToVisility //ResourceDictionary /UserControl.Resources添加相关元素 FontSize14 / StackPanelGrid.Row1VerticalAlignmentCenterVisibility{Binding TodoDtos.Count, Converter{StaticResource IntToVisility}}ImageWidth120Height120Source/Images/nores.jpg /TextBlockMargin0,10HorizontalAlignmentCenterFontSize18Text尝试添加一些待办事项以便在此处查看它们。 / /StackPanel ItemsControl增加了根据状态查询的功能 Mytodo.Service/ITodoService增加GetAllFilterAsync接口 using Mytodo.Common.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MyToDo.Share.Models; using MyToDo.Share.Contact; using MyToDo.Share.Parameters; using MyToDo.Share;namespace Mytodo.Service {public interface ITodoService:IBaseServiceToDoDto{TaskApiResponsePagedListToDoDto GetAllFilterAsync(TodoParameter parameter);} }修改了控制器 MyToDo.Api.Controllers/TodoController [HttpGet] public async TaskApiReponse GetAll([FromQuery] TodoParameter param) await service.GetAllAsync(param);增加IToDoService接口 MyToDo.Api.Service/IToDoService namespace MyToDo.Api.Service {public interface IToDoService : IBaseServiceTodo{TaskApiReponse GetAllAsync(TodoParameter parameter);} } 增加所需字段属性以及所需要的方法 更新文件Mytodo.ViewModels/TodoViewModel.cs /// summary /// 项目状态 /// /summary public int SelectIndex {get { return selectIndex; }set { selectIndex value; RaisePropertyChanged(); } }private int selectIndex;/// summary /// 保存消息 /// /summary private async void Save() {try{if (string.IsNullOrWhiteSpace(CurrDto.Title) || string.IsNullOrWhiteSpace(CurrDto.Content))return;UpdateLoding(true);if(CurrDto.Id0) //编辑项{var updateres await service.UpdateAsync(CurrDto);if (updateres.Status){UpdateDataAsync();}else{MessageBox.Show(更新失败);}}else{ //添加项var add_res await service.AddAsync(CurrDto);//刷新if (add_res.Status) //如果添加成功{TodoDtos.Add(add_res.Result);}else{MessageBox.Show(添加失败);}}}catch{}finally{IsRightOpen false;//卸载数据加载窗体UpdateLoding(false);} }/// summary /// 打开待办事项弹窗 /// /summary void Add() {CurrDto new ToDoDto();IsRightOpen true; }private void Query() {GetDataAsync(); }/// summary /// 根据条件更新数据 /// /summary async void UpdateDataAsync() {int? Status SelectIndex 0 ? null : SelectIndex 2 ? 1 : 0;var todoResult await service.GetAllFilterAsync(new MyToDo.Share.Parameters.TodoParameter { PageIndex 0, PageSize 100, Search SearchString, Status Status });if (todoResult.Status){todoDtos.Clear();foreach (var item in todoResult.Result.Items)todoDtos.Add(item);} }/// summary /// 获取所有数据 /// /summary async void GetDataAsync() {//调用数据加载页面UpdateLoding(true);//更新数据UpdateDataAsync();//卸载数据加载页面UpdateLoding(false); } UI层增加绑定的界面 ComboBox Margin5 SelectedIndex{Binding CurrDto.Status}ComboBoxItem Content已完成 FontSize12 /ComboBoxItem Content未完成 FontSize12 / /ComboBox StackPanelGrid.Row1VerticalAlignmentCenterVisibility{Binding TodoDtos.Count, Converter{StaticResource IntToVisility}}md:PackIconWidth120Height120HorizontalAlignmentCenterKindClipboardText /TextBlockMargin0,10HorizontalAlignmentCenterFontSize18Text尝试添加一些待办事项以便在此处查看它们。 /增加了IToDoService接口所对应的实现 public async TaskApiReponse GetAllAsync(QueryParameter parameter) {try{var repository work.GetRepositoryTodo();var todos await repository.GetPagedListAsync(predicate:x string.IsNullOrWhiteSpace(parameter.Search) ? true : x.Title.Contains(parameter.Search),pageIndex: parameter.PageIndex,pageSize: parameter.PageSize,orderBy: source source.OrderByDescending(t t.CreateDate));return new ApiReponse(true, todos);}catch (Exception ex){return new ApiReponse(ex.Message,false);} }修复更新操作无法更新状态的bug public async TaskApiReponse UpdateAsync(Todo model){try{var dbtodo mapper.MapTodo(model);//获取数据var resposity work.GetRepositoryTodo();//var todo await resposity.GetFirstOrDefaultAsync(predicate: x x.Id.Equals(dbtodo.Id));if(todo null)return new ApiReponse(修改失败数据库中无给定条件的数据项,false);todo.Title dbtodo.Title;todo.UpdateDateDateTime.Now;todo.CreateDate dbtodo.CreateDate;todo.Content dbtodo.Content;todo.Status dbtodo.Status;resposity.Update(todo);if (await work.SaveChangesAsync() 0)return new ApiReponse(true);return new ApiReponse(false);}catch (Exception ex){return new ApiReponse(ex.Message, false);}}修复当Search为空时查询失败的bug Mytodo.Service/TodoService.cs public async TaskApiResponsePagedListToDoDto GetAllFilterAsync(TodoParameter parameter) {BaseRequest request new BaseRequest();request.Method RestSharp.Method.GET;var parameter_search parameter.Search;if(parameter_searchnull){request.Route $api/ToDo/GetAll?pageIndex{parameter.PageIndex} $pageSize{parameter.PageSize} $status{parameter.Status};}elserequest.Route $api/ToDo/GetAll?pageIndex{parameter.PageIndex} $pageSize{parameter.PageSize} $search{parameter.Search} $status{parameter.Status};return await client.ExecuteAsyncPagedListToDoDto(request); }
http://www.hkea.cn/news/14299266/

相关文章:

  • 网站建设改版目的部门网站建设方案
  • 网站后台安全网页设计模板素材美食
  • 网络营销案例ppt课件seo技术团队
  • 网站收录入口南京建设工程公共资源交易中心网站
  • 电子商务网站的作用有哪些建设项目环境影响评价公示网站
  • 国内新闻最近新闻今天提升网页优化排名
  • 做网站需要的技能wordpress菜单和导航栏
  • 哪里可以建设网站免费发布商品的电商平台
  • json取数据做网站荣耀手机价格表大全一览
  • 网站建设在电子商务中意义中国最大跨境电商平台
  • 中国交通建设监理协会网站打不开网站备案信息批量查询
  • 大型网站开发团队短视频脚本制作教程
  • 网站设计建设收费标准17网一起做网店普宁潮汕
  • 网站建设进程方案网站建设和管理情况自查报告
  • 专业外贸公司网站加大网站和微信号建设发挥宣传平台实效性
  • 长沙建站工作室古典网站案例
  • 婚纱网站有哪些怎么做游戏平台网站
  • 桐城市美好乡村建设办公室网站wordpress博客登陆
  • 百度网站大全首页flask做视频网站
  • a站为什么会凉做创意小视频的网站
  • 怎么在网上做网站厦门网红打卡景点
  • 龙岩市住房与城乡建设局网站网站推广好做吗
  • 深圳好蜘蛛网站建设公司中企动力员工邮箱忘记密码
  • 网站主域名是什么goodwork wordpress
  • 网站优化报表机构网站建设需要交费吗
  • 外企网站建设公司吉安网页制作公司
  • 找事情做的网站湖南建网站
  • 帝国网站7.2 pc wap 跳转akm建站系统
  • linux服务器做网站海报设计培训
  • 盗用别人公司的产品图片做网站wordpress 获得主题