コード例 #1
0
        /// <summary>
        /// 获取更新程序
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool GetUpgrade(int id)
        {
            Model.ProgramUpgrade programModel = AMS.ServiceProxy.ProjecVersionWindow.GetProgramUpgradeByID(id);
            if (programModel != null)
            {
                FileOperate advertfileOperate = new FileOperate();
                SeatManage.EnumType.SeatManageSubsystem systemType = (SeatManage.EnumType.SeatManageSubsystem)(int) programModel.Application;

                SeatManage.Bll.FileOperate           seatmanagefileOperate = new SeatManage.Bll.FileOperate();
                SeatManage.ClassModel.FileUpdateInfo programInfo           = SeatManage.ClassModel.FileUpdateInfo.Convert(programModel.AutoUpdaterXml);
                List <string> filePath = programInfo.BuildUpdateFilePaths();
                foreach (string path in filePath)
                {
                    string fullPath = string.Format("{0}{1}", ServiceSet.TempFilePath, path);
                    //文件下载
                    if (advertfileOperate.FileDownLoad(fullPath, path, systemType) != "")
                    {
                        return(false);
                    }
                    if (!seatmanagefileOperate.UpdateFile(fullPath, path, systemType))
                    {
                        return(false);
                    }
                }
                //执行完成,不需要更新数据库。
                //上传完毕删除本地的文件以及文件夹。
                SeatManage.ClassModel.FileUpdateInfo.DelDirectorys(ServiceSet.TempFilePath);
                return(true);
            }
            return(true);
        }
コード例 #2
0
 /// <summary>
 /// 转换ProgramUpgradeList的model
 /// </summary>
 /// <param name="dr"></param>
 /// <returns></returns>
 private AMS.Model.ProgramUpgrade DataRowToAMS_ProgramUpgradeListModel(DataRow dr)
 {
     AMS.Model.ProgramUpgrade model = new Model.ProgramUpgrade();
     model.Id             = int.Parse(dr["Id"].ToString());
     model.Version        = dr["Version"].ToString();
     model.ReleaseDate    = DateTime.Parse(dr["ReleaseDate"].ToString());
     model.UpdateLog      = dr["UpdateLog"].ToString();
     model.Remark         = dr["Remark"].ToString();
     model.Application    = int.Parse(dr["Application"].ToString());
     model.AutoUpdaterXml = dr["AutoUpdaterXml"].ToString();
     return(model);
 }
コード例 #3
0
 public Model.ProgramUpgrade GetProgramUpgradeByID(int id)
 {
     try
     {
         Model.ProgramUpgrade modellist = new Model.ProgramUpgrade();
         modellist = dal_ProgramUpgrade.GetModelByID(id);
         return(modellist);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
 public string AddNewProgramUpgrade(Model.ProgramUpgrade model)
 {
     try
     {
         AMS.Model.ProgramUpgrade sameModel = dal_ProgramUpgrade.GetModel(model.Version, model.Application);
         if (sameModel != null)
         {
             return("该程序已存在相同的版本!");
         }
         if (dal_ProgramUpgrade.Add(model) == 0)
         {
             return("添加失败!");
         }
         else
         {
             return("");
         }
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
コード例 #5
0
 public string DeleteProgramUpgrade(Model.ProgramUpgrade model)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
        /// <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);
        }