/// <summary> /// 加载投票基本信息 /// </summary> /// <param name="item"></param> public virtual PollMaster LoadPollMaster(int itemID) { PollMaster item = pollItemDA.LoadPollMaster(itemID); item.PollItemGroupList = pollItemDA.GetPollItemGroupList(itemID); return(item); }
/// <summary> /// 创建投票,作为聚合根,只创建活动的基本信息,得到活动ID /// </summary> /// <param name="item"></param> public virtual int CreatePollMaster(PollMaster item) { int returnValue = 0; if (item.Status.HasValue && item.Status.Value == ADStatus.Active) { if (pollItemDA.CheckPageTypeForCreatePollMaster(item) > 1 && item.PageType == 4) { throw new BizException(ResouceManager.GetMessageString("MKT.News", "Advertiser_JustTwoValidPollItemInCategory")); } else if (pollItemDA.CheckForCreatePollMaster(item) > 0) { throw new BizException(ResouceManager.GetMessageString("MKT.News", "Advertiser_JustOneValidPollItemInCategory")); } else { returnValue = pollItemDA.CreatePollMaster(item); } } else { returnValue = pollItemDA.CreatePollMaster(item); } ExternalDomainBroker.CreateOperationLog("创建投票主题", BizLogType.MKT_Poll_Master_Create, returnValue, item.CompanyCode); return(returnValue); }
/// <summary> /// 创建投票,作为聚合根,只创建活动的基本信息,得到活动ID /// </summary> /// <param name="item"></param> public void UpdatePollMaster(PollMaster item) { DataCommand dc = DataCommandManager.GetDataCommand("Poll_UpdatePollMaster"); dc.SetParameterValue <PollMaster>(item); dc.ExecuteNonQuery(); }
/// <summary> /// 创建投票,作为聚合根,只创建活动的基本信息,得到活动ID /// </summary> /// <param name="item"></param> public int CreatePollMaster(PollMaster item) { DataCommand dc = DataCommandManager.GetDataCommand("Poll_CreatePollMaster"); dc.SetParameterValue <PollMaster>(item); dc.ExecuteNonQuery(); return(Convert.ToInt32(dc.GetParameterValue("@SysNo"))); }
/// <summary> /// 查检其它PageType类型是否已经创建两次。 /// </summary> /// <param name="item"></param> /// <returns></returns> public int CheckForCreatePollMaster(PollMaster item) { DataCommand dc = DataCommandManager.GetDataCommand("Poll_CheckForCreatePollMaster"); dc.SetParameterValue <PollMaster>(item); DataTable dt = dc.ExecuteDataTable(); return(Convert.ToInt32(dt.Rows[0][0].ToString())); }
/// <summary> /// 创建投票问题组,只创建问题组的基本信息 /// </summary> /// <param name="item"></param> public virtual void CreatePollItemGroup(PollItemGroup item) { PollMaster master = LoadPollMaster(item.PollSysNo.Value); if (master.PageType != 4) { List <PollItemGroup> itemList = GetPollItemGroupList(item.PollSysNo.Value); if (itemList.Count > 0) { throw new BizException(ResouceManager.GetMessageString("MKT.News", "Advertiser_PollPageTypeOnlyOneItem")); } } pollItemDA.CreatePollItemGroup(item); }
/// <summary> /// 修改投票,作为聚合根,只创建活动的基本信息,得到活动ID /// </summary> /// <param name="item"></param> public virtual void UpdatePollMaster(PollMaster item) { if (item.Status.HasValue && item.Status.Value == ADStatus.Active) { if (pollItemDA.CheckPageTypeForCreatePollMaster(item) > 1 && item.PageType == 4) { throw new BizException(ResouceManager.GetMessageString("MKT.News", "Advertiser_JustTwoValidPollItemInCategory")); } if (pollItemDA.CheckForCreatePollMaster(item) > 0) { throw new BizException(ResouceManager.GetMessageString("MKT.News", "Advertiser_JustOneValidPollItemInCategory")); } } pollItemDA.UpdatePollMaster(item); ExternalDomainBroker.CreateOperationLog("修改投票主题", BizLogType.MKT_Poll_Master_Update, item.SysNo.Value, item.CompanyCode); }
/// <summary> /// 编辑投票基本信息 /// </summary> /// <param name="item"></param> public virtual void UpdatePollMaster(PollMaster item) { ObjectFactory <PollItemProcessor> .Instance.UpdatePollMaster(item); }
/// <summary> /// 创建投票,作为聚合根,只创建活动的基本信息,得到活动ID /// </summary> /// <param name="item"></param> public virtual int CreatePollMaster(PollMaster item) { return(ObjectFactory <PollItemProcessor> .Instance.CreatePollMaster(item)); }
public void UpdatePollMaster(PollMaster item) { pollItemAppService.UpdatePollMaster(item); }
public int CreatePollMaster(PollMaster item) { return(pollItemAppService.CreatePollMaster(item)); }
/// <summary> /// 修改投票主题 /// </summary> /// <param name="item"></param> /// <param name="callback"></param> public void UpdatePollMaster(PollMaster item, EventHandler <RestClientEventArgs <dynamic> > callback) { string relativeUrl = "/MKTService/PollInfo/UpdatePollMaster"; restClient.Update(relativeUrl, item, callback); }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (!ValidationManager.Validate(this.LayoutRoot)) { return; } if (!ucPageType.PageType.HasValue) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_PageCategoryIsNotNull, MessageType.Warning); } else if (ucPageType.PageType.Value > 0 && ucPageType.PageType.Value <= 3 && !ucPageType.PageID.HasValue) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_PageIDIsNotNull, MessageType.Warning); } else { PollMaster item = EntityConvertorExtensions.ConvertVM <PollListVM, PollMaster>(model, (v, t) => { t.PollName = new BizEntity.LanguageContent(ConstValue.BizLanguageCode, v.PollName); }); item.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; item.PageType = ucPageType.PageType.Value; if (ucPageType.PageID.HasValue) { item.PageID = ucPageType.PageID.Value; } else { item.PageID = -1; } if (item.SysNo > 0) { facade.UpdatePollMaster(item, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_OperateSuccessful, MessageType.Information); if (Dialog != null) { Dialog.ResultArgs.Data = item.SysNo; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(); } }); } else { facade.CreatePollMaster(item, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_OperateSuccessful, MessageType.Information); if (Dialog != null) { Dialog.ResultArgs.Data = int.Parse(args.Result.ToString());; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(); } }); } } }