private AMS.Model.AMS_RollTitles DataRowToAMS_RollTitles(DataRow dr) { AMS.Model.AMS_RollTitles model = new Model.AMS_RollTitles { ID = int.Parse(dr["ID"].ToString()), CustomerId = int.Parse(dr["CustomerId"].ToString()), EffectDate = Convert.ToDateTime(dr["EffectDate"].ToString()), EndDate = Convert.ToDateTime(dr["EndDate"].ToString()), Name = dr["Name"].ToString(), Type = dr["Type"].ToString(), Num = dr["Num"].ToString() }; return(model); }
public string UpdateModel(Model.AMS_RollTitles model) { try { if (!dal.UpdateRollTitles(model)) { return("修改失败"); } return(""); } catch (Exception ex) { return(ex.Message); } }
public Model.AMS_RollTitles GetModelNum(int Num) { try { Model.AMS_RollTitles list = new Model.AMS_RollTitles(); string sql = string.Format(" ID={0}", Num); DataSet ds = dal.GetModel(sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { list = DataRowToAMS_RollTitles(ds.Tables[0].Rows[i]); } return(list); } catch (Exception ex) { throw ex; } }
public string AddRollTitles(Model.AMS_RollTitles model) { try { if (dal.GetModelByName(model.Name)) { return("此滚动文字已存在"); } if (!dal.AddRollTitles(model)) { return("添加失败"); } return(""); } catch (Exception ex) { return(ex.Message); throw; } }
/// <summary> /// 更新滚动广告 /// </summary> /// <param name="id"></param> /// <returns></returns> public static bool GetTitleAd(int Num) { try { Model.AMS_RollTitles advertTitle = AMS.ServiceProxy.IRollTitlesService.GetModelNum(Num); if (advertTitle != null) { SeatManage.ClassModel.RollTitlesInfo models = SeatManage.Bll.AMS_RollTitles.GetModelByNum(advertTitle.Num); SeatManage.ClassModel.RollTitlesInfo seatTitle = new SeatManage.ClassModel.RollTitlesInfo(); seatTitle.EffectDate = Convert.ToDateTime(advertTitle.EffectDate); seatTitle.EndDate = Convert.ToDateTime(advertTitle.EndDate); seatTitle.Type = advertTitle.Type; seatTitle.Num = advertTitle.Num; if (models == null) { if (SeatManage.Bll.AMS_RollTitles.AddRollTitles(seatTitle) == SeatManage.EnumType.HandleResult.Successed) { return(true); } return(false); } else { if (SeatManage.Bll.AMS_RollTitles.UpdateRollTitles(seatTitle) == SeatManage.EnumType.HandleResult.Successed) { return(true); } return(false); } } else { return(true); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 修改滚动文字 /// </summary> /// <param name="model"></param> /// <returns></returns> public static string UpdateModel(Model.AMS_RollTitles model) { AMS.IBllService.IAdvertManageBllService bllService = AMS.ServiceConnectChannel.AdvertManageBllServiceChannel.CreateServiceChannel(); try { return(bllService.UpdateModel(model)); } catch (EndpointNotFoundException ex) { throw new AMS.Model.CustomerException("连接服务器失败"); } catch (CommunicationException ex) { throw ex; } catch (Exception ex) { throw ex; } finally { ICommunicationObject ICommObjectService = bllService as ICommunicationObject; try { if (ICommObjectService.State == CommunicationState.Faulted) { ICommObjectService.Abort(); } else { ICommObjectService.Close(); } } catch { ICommObjectService.Abort(); } } }
/// <summary> /// 获取命令明细列表 /// </summary> /// <param name="schoolId"></param> /// <param name="commandType"></param> /// <param name="handleResult"></param> /// <returns></returns> public List <Model.AMS_CommandDetail> GetCommandDetailList(string schoolId, AMS.Model.Enum.CommandType commandType, AMS.Model.Enum.CommandHandleResult handleResult) { StringBuilder str = new StringBuilder(); List <AMS.Model.AMS_CommandDetail> commandDetailList = new List <Model.AMS_CommandDetail>(); List <Model.View_CommandList> commandList = GetCommandList(schoolId, commandType, handleResult); foreach (AMS.Model.View_CommandList cmdModel in commandList) { AMS.Model.AMS_CommandDetail cmd = new Model.AMS_CommandDetail(); switch (cmdModel.Command) { case Model.Enum.CommandType.Caputre: cmd.ContentDescribe = "获取截图"; cmd.ContentName = "获取截图"; break; case Model.Enum.CommandType.HardAd: Model.AMS_HardAd hardAd = Dal_HardAd.GetModelByNum(cmdModel.CommandId.Value); cmd.ContentName = hardAd.Name; cmd.ContentDescribe = hardAd.Describe; cmd.ContentNumber = hardAd.Number; cmd.ContentID = hardAd.ID; break; case Model.Enum.CommandType.Playlist: if (dal_Playlist.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.AMS_PlayList playList = DataRowToAMS_PlayListModel(dal_PlaylistView.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = playList.PlayListName; cmd.ContentDescribe = playList.Describe; cmd.ContentNumber = playList.Number; cmd.ContentID = playList.Id; } break; case Model.Enum.CommandType.PrintTemplate: if (dal_PrintTemplateView.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.AMS_PrintTemplate printTemplate = DataRowToAMS_PrintTemplateModel(dal_PrintTemplateView.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = printTemplate.Name; cmd.ContentNumber = printTemplate.Number; cmd.ContentDescribe = printTemplate.Describe; cmd.ContentID = printTemplate.Id; } break; case Model.Enum.CommandType.ProgramUpgrade: if (dal_ProgramUpgrade.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.ProgramUpgrade program = DataRowToAMS_ProgramUpgradeListModel(dal_ProgramUpgrade.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = ((AMS.Model.Enum.SeatManageSubsystem)program.Application).ToString(); cmd.ContentDescribe = program.Remark; cmd.ContentID = program.Id; } break; case Model.Enum.CommandType.SlipCustomer: if (dal_SlipCustomer.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.AMS_SlipCustomer slipcustomer = DataRowToAMS_SlipCustomerModel(dal_SlipCustomerView.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = slipcustomer.SlipName; cmd.ContentNumber = slipcustomer.Number; cmd.ContentDescribe = slipcustomer.Describe; cmd.ContentID = slipcustomer.Id; } break; case Model.Enum.CommandType.TitleAd: if (Dal_TitleAd.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.AMS_TitleAd titleAd = DataRowToAMS_TitleAd(Dal_TitleAd.GetList(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = titleAd.Name; cmd.ContentNumber = titleAd.Num; cmd.ContentID = titleAd.Id; } break; case Model.Enum.CommandType.RollTitles: if (dal.GetModel(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows.Count > 0) { Model.AMS_RollTitles titleAd = DataRowToAMS_RollTitles(dal.GetModel(string.Format(" id={0}", cmdModel.CommandId.Value)).Tables[0].Rows[0]); cmd.ContentName = titleAd.Name; cmd.ContentNumber = titleAd.Num; cmd.ContentID = titleAd.ID; } break; } cmd.Command = cmdModel.Command; cmd.FinishFlag = cmdModel.FinishFlag; cmd.FinishTime = cmdModel.FinishTime; cmd.ID = cmdModel.ID; cmd.OperatorBranchName = cmdModel.OperatorBranchName; cmd.OperatorLoginId = cmdModel.OperatorLoginId; cmd.OperatorPwd = cmdModel.OperatorPwd; cmd.OperatorRemark = cmdModel.OperatorRemark; cmd.OperatorName = cmdModel.OperatorName; cmd.ReleaseTime = cmdModel.ReleaseTime; cmd.SchoolAddress = cmdModel.SchoolAddress; cmd.SchoolCardInfo = cmdModel.SchoolCardInfo; cmd.SchoolConnectionString = cmdModel.SchoolConnectionString; cmd.SchoolDescribe = cmdModel.SchoolDTUip; cmd.SchoolInterfaceInfo = cmdModel.SchoolInterfaceInfo; cmd.SchoolLinkMan = cmdModel.SchoolLinkMan; cmd.SchoolName = cmdModel.SchoolName; cmd.SchoolNum = cmdModel.SchoolNum; cmd.SchoolProvince = cmdModel.SchoolProvince; commandDetailList.Add(cmd); } return(commandDetailList); }