Пример #1
0
 /// <summary>
 /// 修改签到区域
 /// </summary>
 /// <param name="patrolid"></param>
 /// <returns></returns>
 public int EditSigninAreas(QW_SigninAreasModel model)
 {
     using (Entities db = new Entities())
     {
         qw_signinareas qsmodel = db.qw_signinareas.SingleOrDefault(t => t.signinareaid == model.signinareaid);
         if (model != null)
         {
             qsmodel.sszd         = model.sszd;
             qsmodel.ssbc         = model.ssbc;
             qsmodel.name         = model.name;
             qsmodel.explain      = model.explain;
             qsmodel.start_stime  = model.start_stime;
             qsmodel.start_etime  = model.start_etime;
             qsmodel.end_stime    = model.end_stime;
             qsmodel.end_etime    = model.end_etime;
             qsmodel.grometry     = model.grometry;
             qsmodel.createuserid = model.createuserid;
         }
         return(db.SaveChanges());
     }
 }
Пример #2
0
 /// <summary>
 /// 添加签到区域
 /// </summary>
 /// <param name="model"></param>
 public void AddSigninAreas(QW_SigninAreasModel model)
 {
     using (Entities db = new Entities())
     {
         qw_signinareas qwmodel = new qw_signinareas();
         qwmodel.signinareaid = model.signinareaid;
         qwmodel.sszd         = model.sszd;
         qwmodel.ssbc         = model.ssbc;
         qwmodel.name         = model.name;
         qwmodel.explain      = model.explain;
         qwmodel.start_stime  = model.start_stime;
         qwmodel.start_etime  = model.start_etime;
         qwmodel.end_stime    = model.end_stime;
         qwmodel.end_etime    = model.end_etime;
         qwmodel.grometry     = model.grometry;
         qwmodel.createtime   = model.createtime;
         qwmodel.createuserid = model.createuserid;
         qwmodel.isnot        = 0;
         db.qw_signinareas.Add(qwmodel);
         db.SaveChanges();
     }
 }
Пример #3
0
 /// <summary>
 /// 删除签到区域
 /// </summary>
 /// <param name="patrolid"></param>
 /// <returns></returns>
 public int DeleteSigninAreas(int signinareaid)
 {
     using (Entities db = new Entities())
     {
         qw_signinareas model = db.qw_signinareas.SingleOrDefault(t => t.signinareaid == signinareaid);
         if (model != null)
         {
             try
             {
                 model.isnot = 1;
                 return(db.SaveChanges());
             }
             catch (Exception e)
             {
                 return(0);
             }
         }
         else
         {
             return(0);
         }
     }
 }