Beispiel #1
0
        /// <summary>
        /// 低洼地段报警值
        /// </summary>
        /// <returns></returns>
        public List <decimal> GetDwddPolice()
        {
            List <decimal> list = new List <decimal>();

            using (Entities db = new Entities())
            {
                IQueryable <low_newlying> queryable = db.low_newlying.OrderByDescending(a => a.cjsj);
                low_newlying model = queryable.FirstOrDefault();
                if (model != null)
                {
                    decimal bjz   = 0;
                    decimal bjljz = 0;
                    if (!string.IsNullOrEmpty(model.bjz))
                    {
                        bjz = decimal.Parse(model.bjz);
                    }
                    if (!string.IsNullOrEmpty(model.bjljz))
                    {
                        bjljz = decimal.Parse(model.bjljz);
                    }
                    decimal syz = decimal.Round((bjljz - bjz), 2);
                    list.Add(bjz);
                    list.Add(syz);
                    list.Add(bjljz);
                }
            }
            return(list);
        }
Beispiel #2
0
 public void AddPolice(LowLyingOldModel model)
 {
     using (Entities db = new Entities())
     {
         low_newlying ln = new low_newlying();
         ln.lowid = model.lowid;
         ln.bjz   = model.bjz;
         ln.bjljz = model.bjljz;
         ln.sfbj  = model.sfbj;
         ln.cjsj  = model.cjsj;
         ln.clqk  = model.clqk;
         db.low_newlying.Add(ln);
         db.SaveChanges();
     }
 }
Beispiel #3
0
        /// <summary>
        /// 低洼地段是否报警
        /// </summary>
        /// <returns></returns>
        public List <string> GetDwddIsPolice()
        {
            List <string> list = new List <string>();

            using (Entities db = new Entities())
            {
                low_newlying model = db.low_newlying.OrderByDescending(a => a.cjsj).FirstOrDefault();
                if (model != null)
                {
                    string bjz  = model.bjz;
                    string sfbj = model.sfbj == 0 ? "否" : "是";
                    list.Add(bjz);
                    list.Add(sfbj);
                }
            }
            return(list);
        }