/// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public static int GetDelete(string id)
        {
            var obj = (from p in entity.Probaict where p.ProId == id select p).First();

            entity.Probaict.Remove(obj);
            return(entity.SaveChanges());
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        public static int GetDelete(string id)
        {
            var obj = (from p in entity.Probaict where p.ProId == id select p).First();

            if (obj != null)
            {
                obj.IsDelete = 1;
            }
            return(entity.SaveChanges());
        }
示例#3
0
        public static int CustAdd(Customer cust)
        {
            CangChuEntities1 contxt = new CangChuEntities1();

            contxt.Customer.Add(cust);
            return(contxt.SaveChanges());
        }
示例#4
0
        public static int Add(Role r)
        {
            CangChuEntities1 entities = new CangChuEntities1();

            entities.Role.Add(r);
            return(entities.SaveChanges());
        }
示例#5
0
        public static int Add(Storehouse stroe)
        {
            CangChuEntities1 contxt = new CangChuEntities1();

            contxt.Storehouse.Add(stroe);
            return(contxt.SaveChanges());
        }
示例#6
0
        public static int Add(Dept de)
        {
            CangChuEntities1 entities = new CangChuEntities1();

            entities.Dept.Add(de);
            return(entities.SaveChanges());
        }
示例#7
0
        public static int Add(GarageShift kk)
        {
            CangChuEntities1 hh = new CangChuEntities1();

            hh.GarageShift.Add(kk);
            return(hh.SaveChanges());
        }
示例#8
0
        public static int VendorAdd(Vendor ven)
        {
            CangChuEntities1 contxt = new CangChuEntities1();

            contxt.Vendor.Add(ven);
            return(contxt.SaveChanges());
        }
示例#9
0
        public static int UnitAdd(Unit unit)
        {
            CangChuEntities1 contxt = new CangChuEntities1();

            contxt.Unit.Add(unit);
            return(contxt.SaveChanges());
        }
示例#10
0
        public static int Add(Admin r)
        {
            CangChuEntities1 entities = new CangChuEntities1();

            entities.Admin.Add(r);
            return(entities.SaveChanges());
        }
示例#11
0
        public static int tadd(GarageShiftStorage ll)
        {
            CangChuEntities1 hh = new CangChuEntities1();

            hh.GarageShiftStorage.Add(ll);
            return(hh.SaveChanges());
        }
示例#12
0
        public static int dele(Dept dd)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Dept where p.DeptId == dd.DeptId select p).First();

            obj.IsDelete = dd.IsDelete;
            return(entity.SaveChanges());
        }
示例#13
0
        public static int Del(int RoleId)
        {
            CangChuEntities1 entities = new CangChuEntities1();
            var obj = (from p in entities.Role where p.RoleId == RoleId select p).First();

            entities.Role.Remove(obj);
            return(entities.SaveChanges());
        }
示例#14
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="admin">对象</param>
        /// <returns>受影响行数</returns>
        public static int UpdatePwd(int id, string pwd)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var count = (from p in entity.Admin where p.Id == id select p).First();

            count.PassWord = pwd;
            return(entity.SaveChanges());
        }
示例#15
0
        public static int Edit(Role r)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Role where p.RoleId == r.RoleId select p).First();

            obj.RoleName = r.RoleName;
            return(entity.SaveChanges());
        }
示例#16
0
        public static int dele(Admin r)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Admin where p.Id == r.Id select p).First();

            obj.IsDelete = r.IsDelete;
            return(entity.SaveChanges());
        }
示例#17
0
        public static int Edit(Dept de)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Dept where p.DeptId == de.DeptId select p).First();

            obj.DeptName = de.DeptName;
            return(entity.SaveChanges());
        }
示例#18
0
        public static int updataUnit(Unit u)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Unit where p.UnId == u.UnId select p).First();

            obj.UnName   = u.UnName;
            obj.IsDelete = u.IsDelete;
            return(entity.SaveChanges());
        }
示例#19
0
        /// <summary>
        /// 修改个人信息
        /// </summary>
        /// <param name="admin"></param>
        /// <returns></returns>
        public static int UpdataUser(Admin admin)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var count = (from p in entity.Admin where p.UserName == admin.UserName select p).First();

            count.phone    = admin.phone;
            count.RealName = admin.RealName;
            count.Email    = admin.Email;
            return(entity.SaveChanges());
        }
示例#20
0
        public static int UnitDele(int id)
        {
            CangChuEntities1 txtcon = new CangChuEntities1();
            var obj = (from p in txtcon.Unit
                       where p.UnId == id
                       select p).First();

            obj.IsDelete = 0;
            return(txtcon.SaveChanges());
        }
示例#21
0
        public static int update(Storehouse s)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Storehouse where p.StorId == s.StorId select p).First();

            obj.StoreName = s.StoreName;
            obj.StId      = s.StId;
            obj.IsMoren   = s.IsMoren;
            obj.Supid     = s.Supid;
            return(entity.SaveChanges());
        }
示例#22
0
        public static int edit(int id)
        {
            CangChuEntities1 hh = new CangChuEntities1();
            var obj             = hh.Damage.Where(p => p.Damid == id).FirstOrDefault();

            if (obj != null)
            {
                obj.IsDelete = 1;
            }
            return(hh.SaveChanges());
        }
示例#23
0
        public static int Tuihuoedit(int id)
        {
            CangChuEntities1 hh = new CangChuEntities1();
            var obj             = hh.Comeback.Where(p => p.CobId == id).FirstOrDefault();

            if (obj != null)
            {
                obj.IsDelete = 1;
            }
            return(hh.SaveChanges());
        }
        public static int yikuedit(int id)
        {
            CangChuEntities1 hh = new CangChuEntities1();
            var obj             = hh.GarageShift.Where(p => p.GarSId == id).FirstOrDefault();

            if (obj != null)
            {
                obj.IsDelete = 1;
            }
            return(hh.SaveChanges());
        }
示例#25
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int GetDeleteWarehouse(int id)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Warehouse where p.WarId == id select p).First();

            if (obj != null)
            {
                obj.IsDelete = 1;
            }
            return(entity.SaveChanges());
        }
示例#26
0
        public static int updataVendor(Vendor d)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Vendor where p.VenId == d.VenId select p).First();

            obj.VenName    = d.VenName;
            obj.VenEmain   = d.VenEmain;
            obj.VenTel     = d.VenTel;
            obj.VenAddress = d.VenAddress;
            obj.VenPerson  = d.VenPerson;
            obj.VenType    = d.VenType;
            obj.Remake     = d.Remake;
            return(entity.SaveChanges());
        }
示例#27
0
        public static int Edit(Admin a)
        {
            CangChuEntities1 entity = new CangChuEntities1();
            var obj = (from p in entity.Admin where p.Id == a.Id select p).First();

            //obj.RoleName = r.RoleName;
            obj.UserName = a.UserName;
            obj.RealName = a.RealName;
            obj.PassWord = a.PassWord;
            obj.RoleId   = a.RoleId;
            obj.DeptId   = a.DeptId;
            obj.Email    = a.Email;
            obj.phone    = a.phone;
            obj.Remake   = a.Remake;
            return(entity.SaveChanges());
        }
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static int GetAddProbaictCatagory(ProbaictCatagory p)
 {
     entity.ProbaictCatagory.Add(p);
     return(entity.SaveChanges());
 }