Exemple #1
0
        private Model_WARN_PARAM InitGetDT(string hallno)
        {
            Model_WARN_PARAM param = null;
            var paralist           = dao.FindList("", "HALL_NO", hallno);

            if (null != paralist && paralist.Count > 0)
            {
                param = new Model_WARN_PARAM();
                Type t = param.GetType();
                foreach (var t_dict in WARN_TYP_DICT)
                {
                    foreach (var l_dict in WARN_LEVEL_DICT)
                    {
                        string qkey1 = "CRITICAL_VALUE" + t_dict.Key + l_dict.Key;
                        var    p     = paralist.FirstOrDefault(obj => obj.WARN_TYP == t_dict.Key && obj.WARN_LEVEL == l_dict.Key);
                        var    v     = p.CRITICAL_VALUE;
                        if (t_dict.Key == 2 || t_dict.Key == 4 || t_dict.Key == 5 || t_dict.Key == 7)//等候超时率,大厅饱和度,超时办结率,弃号率
                        {
                            v = v * 100;
                        }
                        if (null != p)
                        {
                            t.GetProperty(qkey1).SetValue(param, v, null);
                        }

                        string qkey2 = "FRE_MIN" + t_dict.Key;
                        string qkey3 = "WARN_INFO_MODEL" + t_dict.Key;
                        var    p2    = paralist.FirstOrDefault(obj => obj.WARN_TYP == t_dict.Key);
                        if (null != p2)
                        {
                            t.GetProperty(qkey2).SetValue(param, p2.FRE_MIN, null);
                            t.GetProperty(qkey3).SetValue(param, p2.WARN_INFO_MODEL, null);
                        }
                    }
                }
            }
            return(param);
        }
Exemple #2
0
        public ActionResult Create(string hallno, Model_WARN_PARAM model)
        {
            if (model.CRITICAL_VALUE11 >= model.CRITICAL_VALUE12)
            {
                ModelState.AddModelError("CRITICAL_VALUE12", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE12 >= model.CRITICAL_VALUE13)
            {
                ModelState.AddModelError("CRITICAL_VALUE13", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE21 >= model.CRITICAL_VALUE22)
            {
                ModelState.AddModelError("CRITICAL_VALUE22", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE22 >= model.CRITICAL_VALUE23)
            {
                ModelState.AddModelError("CRITICAL_VALUE23", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE31 >= model.CRITICAL_VALUE32)
            {
                ModelState.AddModelError("CRITICAL_VALUE32", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE32 >= model.CRITICAL_VALUE33)
            {
                ModelState.AddModelError("CRITICAL_VALUE33", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE41 >= model.CRITICAL_VALUE42)
            {
                ModelState.AddModelError("CRITICAL_VALUE42", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE42 >= model.CRITICAL_VALUE43)
            {
                ModelState.AddModelError("CRITICAL_VALUE43", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE51 >= model.CRITICAL_VALUE52)
            {
                ModelState.AddModelError("CRITICAL_VALUE52", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE52 >= model.CRITICAL_VALUE53)
            {
                ModelState.AddModelError("CRITICAL_VALUE53", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE61 >= model.CRITICAL_VALUE62)
            {
                ModelState.AddModelError("CRITICAL_VALUE62", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE62 >= model.CRITICAL_VALUE63)
            {
                ModelState.AddModelError("CRITICAL_VALUE63", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE71 >= model.CRITICAL_VALUE72)
            {
                ModelState.AddModelError("CRITICAL_VALUE72", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE72 >= model.CRITICAL_VALUE73)
            {
                ModelState.AddModelError("CRITICAL_VALUE73", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE81 >= model.CRITICAL_VALUE82)
            {
                ModelState.AddModelError("CRITICAL_VALUE82", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE82 >= model.CRITICAL_VALUE83)
            {
                ModelState.AddModelError("CRITICAL_VALUE83", "红色预警值必须大于橙色预警值!");
            }
            if (model.CRITICAL_VALUE91 >= model.CRITICAL_VALUE92)
            {
                ModelState.AddModelError("CRITICAL_VALUE92", "橙色预警值必须大于黄色预警值!");
            }
            if (model.CRITICAL_VALUE92 >= model.CRITICAL_VALUE93)
            {
                ModelState.AddModelError("CRITICAL_VALUE93", "红色预警值必须大于橙色预警值!");
            }
            if (!ModelState.IsValid)
            {
                Alter("提交失败!", AlterTypeEnum.Error, false, false);
                return(View());
            }
            List <WARN_PARAM> paralist = new List <WARN_PARAM>();

            foreach (var t_dict in WARN_TYP_DICT)
            {
                foreach (var l_dict in WARN_LEVEL_DICT)
                {
                    WARN_PARAM param1 = new WARN_PARAM()
                    {
                        HALL_NO        = hallno,
                        WARN_TYP       = (byte)t_dict.Key,
                        WARN_LEVEL     = (byte)l_dict.Key,
                        WARN_PARAM_NAM = t_dict.Value,
                        MODIFY_DTIME   = DateTime.Now,
                        MODIFY_ID      = UserState.UserID
                    };
                    string qkey1 = "CRITICAL_VALUE" + t_dict.Key + l_dict.Key;
                    if (!string.IsNullOrEmpty(Request[qkey1]))
                    {
                        var v = decimal.Parse(Request[qkey1]);
                        if (t_dict.Key == 2 || t_dict.Key == 4 || t_dict.Key == 5 || t_dict.Key == 7)//等候超时率,大厅饱和度,超时办结率
                        {
                            v = v / 100;
                        }
                        param1.CRITICAL_VALUE = v;
                    }
                    string qkey2 = "FRE_MIN" + t_dict.Key;
                    if (!string.IsNullOrEmpty(Request[qkey2]))
                    {
                        param1.FRE_MIN = int.Parse(Request[qkey2]);
                    }
                    string qkey3 = "WARN_INFO_MODEL" + t_dict.Key;
                    if (!string.IsNullOrEmpty(Request[qkey3]))
                    {
                        param1.WARN_INFO_MODEL = Request[qkey3];
                    }
                    paralist.Add(param1);
                }
            }
            var rst = new WARN_PARAM_DAL().AddList(paralist);

            if (!rst)
            {
                Alter("提交失败!", AlterTypeEnum.Error, false, false);
                return(View());
            }
            Alter("提交成功!", AlterTypeEnum.Error, true, true);
            return(RedirectToAction("Details", new { hallno = hallno }));
        }