コード例 #1
0
ファイル: MesFbItemCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Mes_fb_item View2Model(ModelView.MesFbItemView view)
        {
            Model.TableModel.Mes_fb_item model = new Model.TableModel.Mes_fb_item();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name   = view.status_name;
            model.status_no     = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.crt_user_no   = string.IsNullOrEmpty(view.crt_user_no) ? "Server" : view.crt_user_no;
            model.crt_user_name = string.IsNullOrEmpty(view.crt_user_name) ? "Server" : view.crt_user_name;
            DateTime dt = DateTime.Now;

            model.crt_time      = DateTime.TryParse(view.crt_time, out dt) ? dt : DateTime.Now;
            model.upd_user_no   = string.IsNullOrEmpty(view.upd_user_no) ? "Server" : view.upd_user_no;
            model.upd_user_name = string.IsNullOrEmpty(view.upd_user_name) ? "Server" : view.upd_user_name;
            dt             = DateTime.Now;
            model.upd_time = DateTime.TryParse(view.upd_time, out dt) ? dt : DateTime.Now;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.fb_item_no = string.IsNullOrEmpty(view.fb_item_no) ? globalDataCtrl.GetNextNoByTblName("mes_fb_item") : view.fb_item_no;

            model.fb_no     = string.IsNullOrEmpty(view.fb_no) ? "FbNo" : view.fb_no;
            model.serial_no = string.IsNullOrEmpty(view.serial_no) ? "SerialNO" : view.serial_no;

            model.mpo_no  = string.IsNullOrEmpty(view.mpo_no) ? "MpoNo" : view.mpo_no;
            model.part_no = view.part_no;
            DateTime tmpDt = DateTime.Now;

            model.fb_datetime   = string.IsNullOrEmpty(view.fb_datetime) ? (DateTime?)null : (DateTime.TryParse(view.fb_datetime, out tmpDt) ? tmpDt : (DateTime?)null);
            model.quality_no    = string.IsNullOrEmpty(view.quality_no) ? "QA01" : view.quality_no;
            model.worker_no     = string.IsNullOrEmpty(view.worker_no) ? "Worker" : view.worker_no;
            model.worker_name   = string.IsNullOrEmpty(view.worker_name) ? "Worker" : view.worker_name;
            model.eqm_no        = string.IsNullOrEmpty(view.eqm_no)?"EqmNo":view.eqm_no;
            model.eqm_name      = view.eqm_name;
            model.wkc_no        = string.IsNullOrEmpty(view.wkc_no) ? "WkcNo" : view.wkc_no;
            model.wkc_name      = view.wkc_name;
            model.shift_no      = view.shift_no;
            model.shift_name    = view.shift_name;
            model.cfm_user_no   = string.IsNullOrEmpty(view.cfm_user_no) ? "Server" : view.cfm_user_no;
            model.cfm_user_name = string.IsNullOrEmpty(view.cfm_user_name) ? "Server" : view.cfm_user_name;
            model.cfm_time      = string.IsNullOrEmpty(view.cfm_time) ? (DateTime?)null : (DateTime.TryParse(view.cfm_time, out tmpDt) ? tmpDt : (DateTime?)null);
            long tmpLong;

            model.in_id = string.IsNullOrEmpty(view.in_id) ? 0L : (long.TryParse(view.in_id, out tmpLong) ? tmpLong : 0L);
            return(model);
        }
コード例 #2
0
        /// <summary>
        /// 根据当前登陆人员的编号,获取是否存在需要当前用户处理的动作
        /// </summary>
        /// <param name="currentUserNo">当前用户编号</param>
        /// <returns>是否存在需要处理的动作</returns>
        private bool HasAction2User(string currentUserNo)
        {
            if (string.IsNullOrEmpty(currentUserNo))
            {
                return(false);
            }
            GlobalDataCtrl globalDataCtrl        = new GlobalDataCtrl();
            string         userName              = globalDataCtrl.GetStrByField("user_name", "sys_user", "user_no", currentUserNo);
            List <Model.TableModel.Apo_act> list = DbEngine.QueryList <Model.TableModel.Apo_act>(string.Format("next_user_name='{0}' and step_finished='0' and apo_finished='0'", userName));

            if (list == null)
            {
                return(false);
            }
            return(list.Count > 0);
        }
コード例 #3
0
ファイル: ApoItemCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 获取下一审批实体
        /// </summary>
        /// <param name="apoNo">审核流程</param>
        /// <param name="apoItemNo">当前审批实体流程编号</param>
        /// <returns>审批实体</returns>
        public ModelView.ApoItemView GetNext(string apoNo, string apoItemNo)
        {
            GlobalDataCtrl gdc                    = new GlobalDataCtrl();
            string         nextApoItemNo          = gdc.GetStrByField("next_item_no", "apo_item", string.Format("apo_no='{0}' and apo_item_no='{1}'", apoNo, apoItemNo));
            List <Model.TableModel.Apo_item> list = DbEngine.QueryList <Model.TableModel.Apo_item>(string.Format("apo_no='{0}' and apo_item_no='{1}'", apoNo, nextApoItemNo));

            if (list == null)
            {
                return(null);
            }
            if (list.Count != 1)
            {
                return(null);
            }
            return(Model2View(list[0]));
        }
コード例 #4
0
ファイル: QcmQaRecordCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Qcm_qa_record View2Model(ModelView.QcmQaRecordView view)
        {
            Model.TableModel.Qcm_qa_record model = new Model.TableModel.Qcm_qa_record();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name   = view.status_name;
            model.status_no     = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.crt_user_no   = string.IsNullOrEmpty(view.crt_user_no) ? "Server" : view.crt_user_no;
            model.crt_user_name = string.IsNullOrEmpty(view.crt_user_name) ? "Server" : view.crt_user_name;
            DateTime dt = DateTime.Now;

            model.crt_time      = DateTime.TryParse(view.crt_time, out dt) ? dt : DateTime.Now;
            model.upd_user_no   = string.IsNullOrEmpty(view.upd_user_no) ? "Server" : view.upd_user_no;
            model.upd_user_name = string.IsNullOrEmpty(view.upd_user_name) ? "Server" : view.upd_user_name;
            dt             = DateTime.Now;
            model.upd_time = DateTime.TryParse(view.upd_time, out dt) ? dt : DateTime.Now;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.qa_record_no     = string.IsNullOrEmpty(view.qa_record_no) ? globalDataCtrl.GetNextNoByTblName("qcm_qa_record") : view.qa_record_no;
            model.qa_cause_no      = string.IsNullOrEmpty(view.qa_cause_no) ? "00" : view.qa_cause_no;
            model.qa_cause_name    = view.qa_cause_name;
            model.part_no          = view.part_no;
            model.eqm_no           = view.eqm_no;
            model.mpo_no           = view.mpo_no;
            model.mpo_item_no      = view.mpo_item_no;
            model.serial_no        = view.serial_no;
            model.factory_no       = view.factory_no;
            model.submit_user_no   = string.IsNullOrEmpty(view.submit_user_no) ? "Server" : view.submit_user_no;
            model.submit_user_name = string.IsNullOrEmpty(view.submit_user_name) ? "Server" : view.submit_user_name;
            dt = DateTime.Now;
            model.submit_time     = DateTime.TryParse(view.submit_time, out dt) ? dt : DateTime.Now;
            model.qa_result_no    = view.qa_result_no;
            model.qa_result_name  = view.qa_result_name;
            model.solve_user_no   = view.solve_user_no;
            model.solve_user_name = view.solve_user_name;
            dt = DateTime.Now;
            model.solve_time = string.IsNullOrEmpty(view.solve_time) ? (DateTime?)null : (DateTime.TryParse(view.solve_time, out dt) ? dt : DateTime.Now);
            return(model);
        }
コード例 #5
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Pdm_shift View2Model(ModelView.PdmShiftView view)
        {
            Model.TableModel.Pdm_shift model = new Model.TableModel.Pdm_shift();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }

            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.shift_no   = string.IsNullOrEmpty(view.shift_no) ? globalDataCtrl.GetNextNoByTblName("pdm_shift") : view.shift_no;
            model.shift_name = view.shift_name;
            if (string.IsNullOrEmpty(view.shift_start_time))
            {
                model.shift_start_time = new DateTime(1900, 1, 1, 0, 0, 0);
            }
            else
            {
                DateTime dt = new DateTime(1900, 1, 1, 0, 0, 0);
                model.shift_start_time = DateTime.TryParse(string.Format("1900-01-01 {0}:00.000", view.shift_start_time), out dt) ? dt : new DateTime(1900, 1, 1, 0, 0, 0);
            }
            if (string.IsNullOrEmpty(view.shift_stop_time))
            {
                model.shift_stop_time = new DateTime(1900, 1, 1, 0, 0, 0);
            }
            else
            {
                DateTime dt = new DateTime(1900, 1, 1, 0, 0, 0);
                model.shift_stop_time = DateTime.TryParse(string.Format("1900-01-01 {0}:00.000", view.shift_stop_time), out dt) ? dt : new DateTime(1900, 1, 1, 0, 0, 0);
            }
            int startHour   = model.shift_start_time.Hour;
            int startMinute = model.shift_start_time.Minute;
            int stopHour    = model.shift_stop_time.Hour;
            int stopMinute  = model.shift_stop_time.Minute;
            int minute      = stopHour * 60 + stopMinute - startHour * 60 - startMinute;

            model.shift_length = minute >= 0 ? minute : 0;
            return(model);
        }
コード例 #6
0
        /// <summary>
        /// 获取审核路径
        /// </summary>
        /// <param name="apoCode">审核类型编码</param>
        /// <param name="ralateFileNo">审核的文件编号</param>
        /// <returns>标准审核流程列表</returns>
        public List <ModelView.ApoActView> GetList(string apoCode, string ralateFileNo)
        {
            List <ModelView.ApoActView> res = new List <ModelView.ApoActView>();
            GlobalDataCtrl gdc   = new GlobalDataCtrl();
            string         apoNo = gdc.GetStrByField("file_type_name", "dms_file_type", "file_type_no", apoCode);
            List <Model.TableModel.Apo_item> list = DbEngine.QueryList <Model.TableModel.Apo_item>(string.Format("apo_no='{0}' order by apo_index asc", apoNo));

            if (list == null || list.Count <= 0)
            {
                return(res);
            }
            string lastApoItemNo = gdc.GetStrByField("apo_item_no", "apo_item", string.Format("next_item_no='-1' and apo_no='{0}'", apoNo));
            List <Model.TableModel.Apo_act> listApoActAll = DbEngine.QueryList <Model.TableModel.Apo_act>(string.Format("ralate_no='{0}' and apo_finished='0'", ralateFileNo));
            List <Model.TableModel.Apo_act> listApoAct    = listApoActAll.FindAll(a => a.apo_item_no == lastApoItemNo);
            DateTime        timeLine      = DateTime.Now;
            List <DateTime> tmpTims       = listApoAct.Select <Model.TableModel.Apo_act, DateTime>(a => a.act_time).ToList();
            bool            isBigAndEqual = false;

            if (tmpTims.Count > 0)
            {
                timeLine      = tmpTims.Max();
                isBigAndEqual = false;
            }
            else
            {
                List <DateTime> tmpTims2 = listApoActAll.Select <Model.TableModel.Apo_act, DateTime>(a => a.act_time).ToList();
                timeLine      = tmpTims2.Min();
                isBigAndEqual = true;
            }
            List <Model.TableModel.Apo_act> listApoActStep = isBigAndEqual ? listApoActAll.FindAll(a => a.act_time >= timeLine) : listApoActAll.FindAll(a => a.act_time > timeLine);

            foreach (Model.TableModel.Apo_item item in list)
            {
                Model.TableModel.Apo_act modelApoAct = listApoActStep.Find(a => a.apo_no == item.apo_no && a.apo_index == item.apo_index);
                if (modelApoAct != null)
                {
                    res.Add(Model2View(modelApoAct));
                }
                else
                {
                    res.Add(Model2View(item));
                }
            }
            return(res);
        }
コード例 #7
0
ファイル: SysAuthGroupCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Sys_auth_group View2Model(ModelView.SysAuthGroupView view)
        {
            Model.TableModel.Sys_auth_group model = new Model.TableModel.Sys_auth_group();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name     = view.status_name;
            model.status_no       = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.auth_group_name = view.auth_group_name;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.auth_group_no = string.IsNullOrEmpty(view.auth_group_no) ? globalDataCtrl.GetNextNoByTblName("sys_auth_group") : view.auth_group_no;
            return(model);
        }
コード例 #8
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Qcm_quality View2Model(ModelView.QcmQualityView view)
        {
            Model.TableModel.Qcm_quality model = new Model.TableModel.Qcm_quality();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.quality_no   = string.IsNullOrEmpty(view.quality_no) ? globalDataCtrl.GetNextNoByTblName("qcm_quality") : view.quality_no;
            model.quality_name = view.quality_name;
            return(model);
        }
コード例 #9
0
ファイル: AdnCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Adn View2Model(ModelView.AdnView view)
        {
            Model.TableModel.Adn model = new Model.TableModel.Adn();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.andon_no        = string.IsNullOrEmpty(view.andon_no) ? globalDataCtrl.GetNextNoByTblName("adn") : view.andon_no;
            model.andon_type_no   = string.IsNullOrEmpty(view.andon_type_no) ? "01" : view.andon_type_no;
            model.andon_type_name = view.andon_type_name;
            model.andon_desc      = view.andon_desc;
            model.dept_no         = view.dept_no;
            model.eqm_no          = string.IsNullOrEmpty(view.eqm_no)?"Default":view.eqm_no;
            model.andon_music_no  = (model.dept_no + "_" + model.eqm_no + ".mp3").Replace("?", "").Replace("*", "").Replace(":", "\"").Replace("<", "").Replace(">", "").Replace("\\", "").Replace("/", "").Replace("|", "");

            model.call_user_no   = string.IsNullOrEmpty(view.call_user_no) ? "Server" : view.call_user_no;
            model.call_user_name = string.IsNullOrEmpty(view.call_user_name) ? "Server" : view.call_user_name;
            DateTime dt = DateTime.Now;

            model.call_time = DateTime.TryParse(view.call_time, out dt) ? dt : DateTime.Now;

            model.reply_user_no   = string.IsNullOrEmpty(view.call_user_no) ? "Server" : view.call_user_no;
            model.reply_user_name = string.IsNullOrEmpty(view.call_user_name) ? "Server" : view.call_user_name;
            dt = DateTime.Now;
            model.reply_time  = string.IsNullOrEmpty(view.reply_time) ? (DateTime?)null : (DateTime.TryParse(view.reply_time, out dt) ? dt : DateTime.Now);
            model.ralate_no   = view.ralate_no;
            model.is_finished = string.IsNullOrEmpty(view.is_finished)?false:(view.is_finished == "是" ? true : false);
            GlobalDataCtrl gdc = new GlobalDataCtrl();
            string         tmp = gdc.GetStrByField("andon_play_eqm", "adn_type", "andon_type_no", model.andon_type_no);

            model.play_record = string.IsNullOrEmpty(tmp)?"0":tmp;
            return(model);
        }
コード例 #10
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Apo_act View2Model(ModelView.ApoActView view)
        {
            Model.TableModel.Apo_act model = new Model.TableModel.Apo_act();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.act_no        = string.IsNullOrEmpty(view.act_no) ? globalDataCtrl.GetNextNoByTblName("apo_act") : view.act_no;
            model.apo_no        = string.IsNullOrEmpty(view.apo_no)?"ApoNo":view.apo_no;
            model.apo_item_no   = string.IsNullOrEmpty(view.apo_item_no) ? "ApoItemNo" : view.apo_item_no;
            model.apo_item_name = string.IsNullOrEmpty(view.apo_item_name) ? "ApoItemName" : view.apo_item_name;
            int tmpInt = 0;

            model.apo_index      = string.IsNullOrEmpty(view.apo_index) ? 0 : (int.TryParse(view.apo_index, out tmpInt)?tmpInt:0);
            model.next_item_no   = string.IsNullOrEmpty(view.next_item_no) ? "NextItemNo" : view.next_item_no;
            model.next_item_name = string.IsNullOrEmpty(view.next_item_name) ? "NextItemName" : view.next_item_name;
            model.next_user_name = string.IsNullOrEmpty(view.next_user_name) ? "NextUserName" : view.next_user_name;
            model.act_desc       = view.act_desc;
            model.act_result     = view.act_result == "通过" ? true : false;
            model.act_step       = string.IsNullOrEmpty(view.act_step) ? 0 : (int.TryParse(view.act_step, out tmpInt) ? tmpInt : 0);
            model.act_user_no    = string.IsNullOrEmpty(view.act_user_no) ? "ActUserNo" : view.act_user_no;
            model.act_user_name  = string.IsNullOrEmpty(view.act_user_name) ? "ActUserName" : view.act_user_name;
            DateTime dt = DateTime.Now;

            model.act_time              = string.IsNullOrEmpty(view.act_time) ? DateTime.Now : DateTime.TryParse(view.act_time, out dt)?dt:DateTime.Now;
            model.ralate_no             = string.IsNullOrEmpty(view.ralate_no) ? "RalateNo" : view.ralate_no;
            model.ralate_file_name      = string.IsNullOrEmpty(view.ralate_file_name) ? "RalateFileName" : view.ralate_file_name;
            model.ralate_file_extension = string.IsNullOrEmpty(view.ralate_file_extension) ?"RalateFileExtension": view.ralate_file_extension;
            model.ralate_type_no        = string.IsNullOrEmpty(view.ralate_type_no) ? "RalateTypeNo" : view.ralate_type_no;
            model.step_finished         = view.step_finished == "是" ? true : false;
            model.apo_finished          = view.apo_finished == "是" ? true : false;
            return(model);
        }
コード例 #11
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Eqm_jam_record View2Model(ModelView.EqmJamRecordView view)
        {
            Model.TableModel.Eqm_jam_record model = new Model.TableModel.Eqm_jam_record();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name   = view.status_name;
            model.status_no     = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.crt_user_no   = string.IsNullOrEmpty(view.crt_user_no) ? "Server" : view.crt_user_no;
            model.crt_user_name = string.IsNullOrEmpty(view.crt_user_name) ? "Server" : view.crt_user_name;
            DateTime dt = DateTime.Now;

            model.crt_time      = DateTime.TryParse(view.crt_time, out dt) ? dt : DateTime.Now;
            model.upd_user_no   = string.IsNullOrEmpty(view.upd_user_no) ? "Server" : view.upd_user_no;
            model.upd_user_name = string.IsNullOrEmpty(view.upd_user_name) ? "Server" : view.upd_user_name;
            dt             = DateTime.Now;
            model.upd_time = DateTime.TryParse(view.upd_time, out dt) ? dt : DateTime.Now;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.jam_record_no    = string.IsNullOrEmpty(view.jam_record_no) ? globalDataCtrl.GetNextNoByTblName("eqm_jam_record") : view.jam_record_no;
            model.jam_cause_no     = view.jam_cause_no;
            model.jam_cause_name   = view.jam_cause_name;
            model.eqm_no           = string.IsNullOrEmpty(view.eqm_no) ? "EqmNo" : view.eqm_no;
            model.wkc_no           = string.IsNullOrEmpty(view.wkc_no) ? "WkcNo" : view.wkc_no;
            model.submit_user_no   = string.IsNullOrEmpty(view.submit_user_no) ? "Server" : view.submit_user_no;
            model.submit_user_name = string.IsNullOrEmpty(view.submit_user_name) ? "Server" : view.submit_user_name;
            dt = DateTime.Now;
            model.submit_time     = DateTime.TryParse(view.submit_time, out dt) ? dt : DateTime.Now;
            model.reply_user_no   = string.IsNullOrEmpty(view.reply_user_no) ? "Server" : view.reply_user_no;
            model.reply_user_name = string.IsNullOrEmpty(view.reply_user_name) ? "Server" : view.reply_user_name;
            dt = DateTime.Now;
            model.reply_time = DateTime.TryParse(view.reply_time, out dt) ? dt : DateTime.Now;
            model.ralate_no  = view.ralate_no;
            return(model);
        }
コード例 #12
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Pdm_workshop View2Model(ModelView.PdmWorkshopView view)
        {
            Model.TableModel.Pdm_workshop model = new Model.TableModel.Pdm_workshop();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }

            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.workshop_no   = string.IsNullOrEmpty(view.workshop_no) ? globalDataCtrl.GetNextNoByTblName("pdm_workshop") : view.workshop_no;
            model.workshop_name = view.workshop_name;
            model.factory_no    = string.IsNullOrEmpty(view.factory_no) ? "dfs_f" : view.factory_no;
            model.factory_name  = view.factory_name;
            return(model);
        }
コード例 #13
0
ファイル: QcmQaCauseCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Qcm_qa_cause View2Model(ModelView.QcmQaCauseView view)
        {
            Model.TableModel.Qcm_qa_cause model = new Model.TableModel.Qcm_qa_cause();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.qa_cause_no         = string.IsNullOrEmpty(view.qa_cause_no) ? globalDataCtrl.GetNextNoByTblName("qcm_qa_quality") : view.qa_cause_no;
            model.qa_cause_name       = view.qa_cause_name;
            model.qa_cause_py         = view.qa_cause_py;
            model.qa_cause_is_default = !string.IsNullOrEmpty(view.qa_cause_is_default) && view.qa_cause_is_default == "是";
            model.factory_no          = view.factory_no;
            return(model);
        }
コード例 #14
0
ファイル: SysDeptCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Sys_dept View2Model(ModelView.SysDeptView view)
        {
            Model.TableModel.Sys_dept model = new Model.TableModel.Sys_dept();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.dept_no      = string.IsNullOrEmpty(view.dept_no) ? globalDataCtrl.GetNextNoByTblName("sys_dept") : view.dept_no;
            model.dept_name    = view.dept_name;
            model.status_name  = view.status_name;
            model.status_no    = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.dept_no      = string.IsNullOrEmpty(view.dept_no) ? "01" : view.dept_no;
            model.dept_name_py = view.dept_name_py;
            model.company_no   = string.IsNullOrEmpty(view.company_no) ? "dfs_c" : view.company_no;
            model.company_name = view.company_name;
            return(model);
        }
コード例 #15
0
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Pdm_line View2Model(ModelView.PdmLineView view)
        {
            Model.TableModel.Pdm_line model = new Model.TableModel.Pdm_line();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }

            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.line_no       = string.IsNullOrEmpty(view.line_no) ? globalDataCtrl.GetNextNoByTblName("pdm_line") : view.line_no;
            model.line_name     = view.line_name;
            model.line_desc     = view.line_desc;
            model.workshop_no   = string.IsNullOrEmpty(view.workshop_no) ? "ws01" : view.workshop_no;
            model.workshop_name = view.workshop_name;
            return(model);
        }
コード例 #16
0
ファイル: SysFactoryCtrl.cs プロジェクト: radtek/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Sys_factory View2Model(ModelView.SysFactoryView view)
        {
            Model.TableModel.Sys_factory model = new Model.TableModel.Sys_factory();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            model.status_name = view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.factory_no      = string.IsNullOrEmpty(view.factory_no) ? globalDataCtrl.GetNextNoByTblName("sys_factory") : view.factory_no;
            model.factory_name    = view.factory_name;
            model.factory_name_py = view.factory_name_py;
            model.factory_type    = view.factory_type;
            model.company_no      = view.company_no;
            model.company_name    = view.company_name;
            return(model);
        }
コード例 #17
0
ファイル: SysUserCtrl.cs プロジェクト: JowenZhang/Danfoss
        /// <summary>
        /// 视图类转实体类
        /// </summary>
        /// <param name="view">视图类</param>
        /// <returns>实体类</returns>
        private Model.TableModel.Sys_user View2Model(ModelView.SysUserView view)
        {
            Model.TableModel.Sys_user model = new Model.TableModel.Sys_user();
            if (string.IsNullOrEmpty(view.id))
            {
                model.id = Common.Md5Operate.CreateGuidId();
            }
            else
            {
                model.id = view.id;
            }
            model.status_name = view.status_name;
            model.status_no   = string.IsNullOrEmpty(view.status_no) ? "310" : view.status_no;
            GlobalDataCtrl globalDataCtrl = new GlobalDataCtrl();

            model.user_no      = string.IsNullOrEmpty(view.user_no) ? globalDataCtrl.GetNextNoByTblName("sys_user") : view.user_no;
            model.user_name    = view.user_name;
            model.user_card_id = view.user_card_id;
            model.user_card_no = view.user_card_no;
            model.user_pwd     = string.IsNullOrEmpty(view.user_pwd) ? Common.Md5Operate.GetMD5String("123456") : Common.Md5Operate.GetMD5String(view.user_pwd);
            switch (view.user_gender)
            {
            case "男":
                model.user_gender = "男";
                break;

            case "女":
                model.user_gender = "女";
                break;

            default:
                model.user_gender = "未知";
                break;
            }
            if (view.loginable == "是")
            {
                model.loginable = true;
            }
            else
            {
                model.loginable = false;
            }
            if (view.pwd_changeable == "是")
            {
                model.pwd_changeable = true;
            }
            else
            {
                model.pwd_changeable = false;
            }
            DateTime dt = DateTime.Now;

            if (string.IsNullOrEmpty(view.valid_start_time))
            {
                model.valid_start_time = null;
            }
            else
            {
                model.valid_start_time = DateTime.TryParse(view.valid_start_time, out dt) ?  dt:(DateTime?)null;
            }
            if (string.IsNullOrEmpty(view.valid_stop_time))
            {
                model.valid_stop_time = null;
            }
            else
            {
                model.valid_stop_time = DateTime.TryParse(view.valid_stop_time, out dt) ? dt : (DateTime?)null;
            }
            model.user_position = view.user_position;
            model.user_email    = view.user_email;
            model.user_phone    = view.user_phone;
            model.user_mobile   = view.user_mobile;
            model.user_address  = view.user_address;
            model.company_no    = string.IsNullOrEmpty(view.company_no) ? "dfs_c" : view.company_no;
            model.dept_no       = string.IsNullOrEmpty(view.dept_no) ? "01" : view.dept_no;
            model.factory_no    = string.IsNullOrEmpty(view.factory_no) ? "dfs_f" : view.factory_no;
            model.workshop_no   = string.IsNullOrEmpty(view.workshop_no) ? "ws01" : view.workshop_no;
            model.line_no       = string.IsNullOrEmpty(view.line_no) ? "line01" : view.line_no;
            if (view.pwd_changeable == "是")
            {
                model.pwd_changeable = true;
            }
            else
            {
                model.pwd_changeable = false;
            }
            return(model);
        }