Exemple #1
0
        /// <summary>
        /// 得到发送对象
        /// </summary>
        private IList <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts> GetListTrainPlanAccepts()
        {
            IList <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts> listTrainPlanAccepts = new List <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts>();

            EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts modelTrainPlanAccepts = null;
            string allPersonnel  = Utils.GetFormValue("chb_All");
            string departmentIDs = this.selectDepartment1.GetDepartId;
            string personnelIDs  = this.selectOperator1.OperId;

            string[] arrDepartment = null;
            string[] arrPersonnel  = null;
            if (departmentIDs.Length > 0)
            {
                arrDepartment = departmentIDs.Split(',');
            }
            if (personnelIDs.Length > 0)
            {
                arrPersonnel = personnelIDs.Split(',');
            }
            if (allPersonnel == "0")
            {
                modelTrainPlanAccepts            = new EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts();
                modelTrainPlanAccepts.AcceptId   = 0;
                modelTrainPlanAccepts.AcceptType = (EyouSoft.Model.EnumType.AdminCenterStructure.AcceptType)Utils.GetInt(allPersonnel);
                listTrainPlanAccepts.Add(modelTrainPlanAccepts);
            }

            if (arrDepartment != null && arrDepartment.Length > 0)
            {
                for (int i = 0; i < arrDepartment.Length; i++)
                {
                    modelTrainPlanAccepts            = new EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts();
                    modelTrainPlanAccepts.AcceptId   = Utils.GetInt(arrDepartment[i]);
                    modelTrainPlanAccepts.AcceptType = EyouSoft.Model.EnumType.AdminCenterStructure.AcceptType.指定部门;
                    listTrainPlanAccepts.Add(modelTrainPlanAccepts);
                }
            }
            if (arrPersonnel != null && arrPersonnel.Length > 0)
            {
                for (int i = 0; i < arrPersonnel.Length; i++)
                {
                    modelTrainPlanAccepts            = new EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts();
                    modelTrainPlanAccepts.AcceptId   = Utils.GetInt(arrPersonnel[i]);
                    modelTrainPlanAccepts.AcceptType = EyouSoft.Model.EnumType.AdminCenterStructure.AcceptType.指定人;
                    listTrainPlanAccepts.Add(modelTrainPlanAccepts);
                }
            }
            return(listTrainPlanAccepts);
        }
Exemple #2
0
        /// <summary>
        /// 获取接受对象集合
        /// </summary>
        /// <param name="AcceptXML">XML字符串</param>
        /// <returns></returns>
        private IList <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts> GetAcceptList(string AcceptXML)
        {
            if (string.IsNullOrEmpty(AcceptXML))
            {
                return(null);
            }
            IList <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts> ResultList = null;

            ResultList = new List <EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts>();
            XElement root = XElement.Parse(AcceptXML);
            var      xRow = root.Elements("row");

            foreach (var tmp1 in xRow)
            {
                EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts model = new EyouSoft.Model.AdminCenterStructure.TrainPlanAccepts()
                {
                    AcceptId   = Convert.ToInt32(tmp1.Attribute("AcceptId").Value),
                    AcceptType = (EyouSoft.Model.EnumType.AdminCenterStructure.AcceptType)Enum.Parse(typeof(EyouSoft.Model.EnumType.AdminCenterStructure.AcceptType), tmp1.Attribute("AcceptType").Value.ToString())
                };
                ResultList.Add(model);
                model = null;
            }
            return(ResultList);
        }