예제 #1
0
파일: LowLying.cs 프로젝트: zkg642/JXXZ
        public void LowLyingPolice()
        {
            LowLyingModel    llmodel  = new LowLyingModel();
            LowLyingOldModel llomodel = new LowLyingOldModel();

            List <glxxModel> glxxlist = llbll.GetGlxxList();

            foreach (var glxxitem in glxxlist)
            {
                List <glxxModel> glxxChildrenlist = llbll.getGlxxChildren(glxxitem.id);
                foreach (var sbxxitem in glxxChildrenlist)
                {
                    List <sbxxModel> getSbxxList = llbll.getSbxxList(sbxxitem.id);
                    foreach (var lsjltemp in getSbxxList)
                    {
                        LowLyingModel model = llbll.GetLowLyingModel(lsjltemp.id);
                        if (model != null)
                        {
                            model.id    = lsjltemp.id;
                            model.jkdmc = lsjltemp.name;
                            model.zt    = lsjltemp.isenabled == "是" ? "启用" : "未启用";
                            model.whdw  = glxxitem.name;
                            model.whry  = "";
                            model.dz    = sbxxitem.name;
                            llbll.Edit(model);
                            lsjlModel getOldRecordingList = llbll.getOldRecordingList(lsjltemp.id);
                            llomodel.lowid = lsjltemp.id;
                            llomodel.bjz   = getOldRecordingList.waterlevel.ToString();
                            llomodel.bjljz = model.bjljz;
                            llomodel.cjsj  = getOldRecordingList.recordingtime;
                            llomodel.clqk  = "";
                            decimal bjljz = Convert.ToDecimal(model.bjljz);
                            if (bjljz > getOldRecordingList.waterlevel)
                            {
                                llomodel.sfbj = 0;
                            }
                            else
                            {
                                llomodel.sfbj = 1;
                            }
                            llbll.AddPolice(llomodel);
                        }
                        else
                        {
                            llmodel.id    = lsjltemp.id;
                            llmodel.jkdmc = lsjltemp.name;
                            llmodel.zt    = lsjltemp.isenabled == "是" ? "启用" : "未启用";
                            llmodel.whdw  = glxxitem.name;
                            llmodel.whry  = "";
                            llmodel.bjljz = "0";
                            llmodel.dz    = sbxxitem.name;
                            llbll.Add(llmodel);
                        }
                    }
                }
            }
        }
예제 #2
0
파일: LowLyingDAL.cs 프로젝트: zkg642/JXXZ
        /// <summary>
        /// 根据ID查看详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public LowLyingModel GetLowLyingModel(int id)
        {
            LowLyingModel model = new LowLyingModel();

            using (Entities db = new Entities())
            {
                string sql = string.Format(@"select lo.id,lo.jkdmc,lo.zt,lo.whdw,lo.whry,lo.bjljz,lo.dz,count(ln.lowid) as lsbjsl from low_oldlying lo 
left JOIN low_newlying ln  on lo.id=ln.lowid and  ln.sfbj=1
GROUP BY ln.lowid");
                IEnumerable <LowLyingModel> querybale = db.Database.SqlQuery <LowLyingModel>(sql);
                model = querybale.FirstOrDefault(a => a.id == id);
            }
            return(model);
        }
예제 #3
0
파일: LowLyingDAL.cs 프로젝트: zkg642/JXXZ
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        public void Edit(LowLyingModel model)
        {
            using (Entities db = new Entities())
            {
                low_oldlying lmodel = db.low_oldlying.FirstOrDefault(a => a.id == model.id);

                lmodel.id    = model.id;
                lmodel.jkdmc = model.jkdmc;
                lmodel.zt    = model.zt;
                lmodel.whdw  = model.whdw;
                lmodel.whry  = model.whry;
                lmodel.dz    = model.dz;
                db.SaveChanges();
            }
        }
예제 #4
0
파일: LowLyingDAL.cs 프로젝트: zkg642/JXXZ
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        public void Add(LowLyingModel model)
        {
            using (Entities db = new Entities())
            {
                low_oldlying lmodel = new low_oldlying();

                lmodel.id    = model.id;
                lmodel.jkdmc = model.jkdmc;
                lmodel.zt    = model.zt;
                lmodel.whdw  = model.whdw;
                lmodel.whry  = model.whry;
                lmodel.bjljz = model.bjljz;
                lmodel.dz    = model.dz;
                db.low_oldlying.Add(lmodel);
                db.SaveChanges();
            }
        }
예제 #5
0
파일: LowLyingBLL.cs 프로젝트: zkg642/JXXZ
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="model"></param>
 public void Edit(LowLyingModel model)
 {
     dal.Edit(model);
 }
예제 #6
0
파일: LowLyingBLL.cs 프로젝트: zkg642/JXXZ
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="model"></param>
 public void Add(LowLyingModel model)
 {
     dal.Add(model);
 }