Ejemplo n.º 1
0
        public IHttpActionResult Add(BI_Measure info)
        {
            string info1 = db.BI_Measure.ToList().OrderBy(x => x.MeasureNum).LastOrDefault().MeasureNum;

            info.MeasureNum = info1.Substring(0, 4) + (Convert.ToInt32(info1.Substring(4, 2)) + 1).ToString();
            db.BI_Measure.Add(info);
            var bl = db.SaveChanges() > 0;

            return(Json(bl));
        }
        public IHttpActionResult del(string id)
        {
            db.BI_Supplier.Find(id).IsDelete = 1;
            var bl = db.SaveChanges() > 0;

            return(Json(bl));
        }
Ejemplo n.º 3
0
        public ActionResult SysRelationDelete(int id)
        {
            Completion db = new Completion();

            db.SysRelation.Find(id);
            var bll = db.SaveChanges() > 0;

            return(Json(bll, JsonRequestBehavior.DenyGet));
        }
Ejemplo n.º 4
0
        public ActionResult SysResourceDelet(string id)
        {
            Completion db = new Completion();

            db.SysResource.Find(id).IsDelete = 1;
            var bll = db.SaveChanges() > 0;

            return(Json(bll, JsonRequestBehavior.DenyGet));
        }
Ejemplo n.º 5
0
        public ActionResult UpdateSysRole(SysRole info)
        {
            Completion db = new Completion();

            info.IsDelete   = 0;
            info.CreateTime = db.SysRole.Find(info.RoleNum).CreateTime;
            var ss = db.SysRole.Find(info.RoleNum);

            ss.RoleNum  = info.RoleNum;
            ss.RoleName = info.RoleName;
            ss.Remark   = info.Remark;
            var bl = db.SaveChanges() > 0;

            return(Json(bl, JsonRequestBehavior.DenyGet));
        }
Ejemplo n.º 6
0
        public ActionResult UpdateAdmin(Admin info)
        {
            Completion db = new Completion();

            info.IsDelete   = 0;
            info.CreateTime = db.Admin.Find(info.UserCode).CreateTime;
            var ss = db.Admin.Find(info.UserCode);

            ss.UserName  = info.UserName;
            ss.ZName     = info.ZName;
            ss.RoleNum   = info.RoleNum;
            ss.Remark    = info.Remark;
            ss.Phone     = info.Phone;
            ss.DepartNum = info.DepartNum;
            var bl = db.SaveChanges() > 0;

            return(Json(bl, JsonRequestBehavior.DenyGet));
        }
Ejemplo n.º 7
0
 public virtual bool Add(T info)
 {
     db.Set <T>().Add(info);
     return(db.SaveChanges() > 0);
 }