public JsonResult Edit(BusinessGroup model) { try { if (model.BusinessGroupId > 0) { var entity = _BusinessGroupService.GetById(model.BusinessGroupId); //修改 entity.Name = model.Name; entity.BaseImageId = model.BaseImageId; entity.BusinessTypeId = model.BusinessTypeId; entity.Sort = model.Sort; entity.EditTime = DateTime.Now; //执行更新 _BusinessGroupService.Update(entity); } else { //新增 model.CreateTime = DateTime.Now; model.EditTime = DateTime.Now; _BusinessGroupService.Insert(model); } } catch (Exception ex) { return(Json(new { Status = Successed.Error, Info = Successed.Error.ToString() }, JsonRequestBehavior.AllowGet)); } return(Json(new { Status = Successed.Ok }, JsonRequestBehavior.AllowGet)); }
public int UpdateBusinessGroup(BusinessGroupDTO data) { BusinessGroup BusinessGroupEditData = BusinessGroupRequestFormatter.ConvertRespondentInfoFromDTO(data); var response = _unitOfWork.BusinessGroupRepository.Update(BusinessGroupEditData); _unitOfWork.Save(); return(response); }
public bool CreateMCBusinessGroup(BusinessGroup BG) { guow.GenericRepository <BusinessGroup>().Insert(BG); if (BG.Id != 0) { return(true); } else { return(false); } }
public static BusinessGroupDTO ConvertRespondentInfoToDTO(BusinessGroup bg) { Mapper.CreateMap <BusinessGroup, BusinessGroupDTO>().ConvertUsing( m => { return(new BusinessGroupDTO { BgId = m.BgId, BgName = m.BgName }); }); return(Mapper.Map <BusinessGroup, BusinessGroupDTO>(bg)); }
async private void apiInvoke_OnResponse(object sender, APIMASHEvent e) { Progress.IsActive = false; Yelp_Response response = (Yelp_Response)e.Object; if ((e.Status == APIMASHStatus.SUCCESS) && (response.businesses.Length > 0)) { var bg = new BusinessGroup(); bg.Copy(response.businesses); BusinessGridView.ItemsSource = bg.Items; } else { MessageDialog md = new MessageDialog(e.Message, "Error"); bool? result = null; md.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler((cmd) => result = true))); await md.ShowAsync(); } }
async private void apiInvoke_OnResponse(object sender, APIMASHEvent e) { Progress.IsActive = false; Yelp_Response response = (Yelp_Response)e.Object; if ((e.Status == APIMASHStatus.SUCCESS) && (response.businesses.Length > 0)) { var bg = new BusinessGroup(); bg.Copy(response.businesses); BusinessGridView.ItemsSource = bg.Items; } else { MessageDialog md = new MessageDialog(e.Message, "Error"); bool? result = null; md.Commands.Add(new UICommand("Ok", new UICommandInvokedHandler((cmd) => result = true))); await md.ShowAsync(); } }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(BusinessGroup model) { this._BusinessGroupBiz.Delete(model); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(BusinessGroup model) { this._BusinessGroupBiz.Update(model); }
/// <summary> /// 添加实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public BusinessGroup Insert(BusinessGroup model) { return(this._BusinessGroupBiz.Insert(model)); }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(BusinessGroup model) { this._repoBusinessGroup.Delete(model); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(BusinessGroup model) { this._repoBusinessGroup.Update(model); }
public BusinessGroup Insert(BusinessGroup model) { return(this._repoBusinessGroup.Insert(model)); }
public BusinessGroupDTO InsertDepartment(BusinessGroupDTO data) { BusinessGroup businessGroup = BusinessGroupRequestFormatter.ConvertRespondentInfoFromDTO(data); return(BusinessGroupRequestFormatter.ConvertRespondentInfoToDTO(_unitOfWork.BusinessGroupRepository.Create(businessGroup))); }
public BusinessGroupService(IUnitOfWork unitOfWork = null) { _unitOfWork = unitOfWork ?? new UnitOfWork(); _businessGroup = new BusinessGroup(); }