/// <summary> /// 创建配送方式提示短信 /// </summary> /// <param name="entity"></param> /// <returns></returns> public virtual ShipTypeSMS Create(ShipTypeSMS entity) { if (Load(entity.ShipTypeSysNo.Value, entity.SMSType.Value, "") != null) { throw new BizException(ResouceManager.GetMessageString("CUSTOMER.ShipTypeSMS", "Exists_Add")); } return(ObjectFactory <IShipTypeSMSDA> .Instance.Create(entity)); }
public virtual string GetSMSContent(string webChannelID, string languageCode, int shipTypeSysNo, SMSType Type) { ShipTypeSMS entity = ObjectFactory <ShipTypeSMSProcessor> .Instance.Load(shipTypeSysNo, Type, webChannelID); if (entity == null || entity.SMSContent == null || string.IsNullOrEmpty(entity.SMSContent.Content)) { throw new BizException(ResouceManager.GetMessageString("CUSTOMER.ShipTypeSMS", "ContentIsNull")); } return(entity.SMSContent.Content); }
/// <summary> /// 更新配送方式提示短信 /// </summary> /// <param name="entity"></param> public virtual void Update(ShipTypeSMS entity) { var old = Load(entity.ShipTypeSysNo.Value, entity.SMSType.Value, entity.WebChannel.ChannelID); if (old != null && old.SysNo != entity.SysNo) { throw new BizException(ResouceManager.GetMessageString("CUSTOMER.ShipTypeSMS", "Exists_Update")); } ObjectFactory <IShipTypeSMSDA> .Instance.Update(entity); }
public virtual ShipTypeSMS Load(int shipTypeSysNo, SMSType smsType, string WebChannelID) { ShipTypeSMS entity = null; DataCommand cmd = DataCommandManager.GetDataCommand("QueryShipTypeSMS"); cmd.SetParameterValue("@SMSType", smsType); cmd.SetParameterValue("@ShipTypeSysNo", shipTypeSysNo); entity = cmd.ExecuteEntity <ShipTypeSMS>(); return(entity); }
public virtual ShipTypeSMS Load(int sysNo) { ShipTypeSMS entity = null; DataCommand cmd = DataCommandManager.GetDataCommand("GetShipTypeSMSBySysNo"); cmd.SetParameterValue("@SysNo", sysNo); DataSet ds = cmd.ExecuteDataSet(); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { DataRow row = ds.Tables[0].Rows[0]; entity = DataMapper.GetEntity <ShipTypeSMS>(row); } return(entity); }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { ValidationManager.Validate(this.LayoutRoot); if (!viewModel.HasValidationErrors) { ShipTypeSMS request = viewModel.EntityVM.ConvertVM <ShipTypeSMSVM, ShipTypeSMS>(); request.SMSContent = new BizEntity.LanguageContent() { Content = viewModel.EntityVM.SMSContent }; request.WebChannel = new BizEntity.Common.WebChannel() { ChannelID = viewModel.EntityVM.ChannelID }; if (request.SysNo.HasValue) { new ShipTypeSMSQueryFacade(CPApplication.Current.CurrentPage).Update(request, (obj, args) => { if (args.FaultsHandle()) { return; } Dialog.ResultArgs.Data = viewModel; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(); }); } else { new ShipTypeSMSQueryFacade(CPApplication.Current.CurrentPage).Create(request, (obj, args) => { if (args.FaultsHandle()) { return; } Dialog.ResultArgs.Data = viewModel; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(); }); } } }
public void UpdateShipTypeSMS(ShipTypeSMS entity) { ObjectFactory <ShipTypeSMSService> .Instance.Update(entity); }
/// <summary> /// 更新 ShipTypeSMS /// </summary> /// <param name="request"></param> /// <param name="callback"></param> public void Update(ShipTypeSMS request, EventHandler <RestClientEventArgs <dynamic> > callback) { string relativeUrl = "/CustomerService/ShipTypeSMS/Update"; restClient.Update(relativeUrl, request, callback); }
/// <summary> /// 加载配送方式提示短信 /// </summary> /// <param name="sysNo"></param> /// <returns></returns> public virtual ShipTypeSMS Load(int sysNo) { ShipTypeSMS entity = new ShipTypeSMS(); return(entity); }
/// <summary> /// 更新配送方式提示短信 /// </summary> /// <param name="entity"></param> public virtual void Update(ShipTypeSMS entity) { ObjectFactory <ShipTypeSMSProcessor> .Instance.Update(entity); }
/// <summary> /// 创建配送方式提示短信 /// </summary> /// <param name="entity"></param> /// <returns></returns> public virtual ShipTypeSMS Create(ShipTypeSMS entity) { return(ObjectFactory <ShipTypeSMSProcessor> .Instance.Create(entity)); }