コード例 #1
0
        public static bool updateMode(ModeModel model)
        {
            using (LIC_CMSEntities db = new LIC_CMSEntities())
            {
                var query = db.MODE_MASTER.Where(x => x.MODE_ID == model.MODE_ID).FirstOrDefault();
                query.MODE_NAME  = model.MODE_NAME;
                query.UPDATED_BY = SessionWrapper.UserId;
                query.UPDATED_ON = DateTime.Now;

                db.SaveChanges();
                return(true);
            }
        }
コード例 #2
0
 public static bool insertMode(ModeModel model)
 {
     using (LIC_CMSEntities db = new LIC_CMSEntities())
     {
         db.MODE_MASTER.Add(new MODE_MASTER
         {
             MODE_NAME  = model.MODE_NAME,
             IS_ACTIVE  = 1,
             CREATED_BY = SessionWrapper.UserId,
             CREATED_ON = DateTime.Now
         });
         db.SaveChanges();
         return(true);
     }
 }