/// <summary> /// 添加冠名广告 /// </summary> /// <param name="model"></param> /// <returns></returns> public static Model.Enum.HandleResult AddTitleAd(Model.AMS_TitleAdModel model) { IWCFService.IAdvertManageService advertService = WcfAccessProxy.AMS_ServiceProxy.CreateChannelAdvertManageService(); bool error = false; try { return(advertService.AddTitleAd(model)); } catch (Exception ex) { error = true; SeatManage.SeatManageComm.WriteLog.Write(string.Format("添加冠名广告遇到异常,异常模块:{0};信息:{1}", ex.Source, ex.Message)); throw ex; } finally { ICommunicationObject ICommObjectService = advertService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
public Model.Enum.HandleResult AddTitleAd(Model.AMS_TitleAdModel model) { try { if (titleAdDal.Add(model) > 0) { return(Model.Enum.HandleResult.Successed); } else { return(Model.Enum.HandleResult.Failed); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 更新冠名广告 /// </summary> /// <param name="id"></param> /// <returns></returns> public static bool GetTitleAd(int id) { Model.AMS_TitleAdModel advertTitle = BLL.AMS_TitleAdBLL.GetTitleAdById(id); if (advertTitle != null) { SeatManage.ClassModel.TitleAdvertInfo seatTitle = new SeatManage.ClassModel.TitleAdvertInfo(); seatTitle.EffectDate = advertTitle.EffectDate; seatTitle.EndDate = advertTitle.EndDate; seatTitle.TitleAdvert = advertTitle.AdContent; if (SeatManage.Bll.AMS_TitleAd.AddTitleAdvert(seatTitle) == SeatManage.EnumType.HandleResult.Successed) { return (true); } else { return(false); } } else { return(true); } }