예제 #1
0
 public void EditAdmin(Admin admin)
 {
     using (MSMSDBEntities db = new MSMSDBEntities())
     {
         db.Entry(admin).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #2
0
 //2.10)This method is used to delete owner from database
 public void DeleteOwner(string id)
 {
     using (MSMSDBEntities db = new MSMSDBEntities())
     {
         var a = db.Owner_Registration.Find(id);
         db.Owner_Registration.Remove(a);
         db.SaveChanges();
     }
 }
예제 #3
0
 public void DeleteAdmin(string id)
 {
     using (MSMSDBEntities db = new MSMSDBEntities())
     {
         var a = db.Admins.Find(id);
         db.Admins.Remove(a);
         db.SaveChanges();
     }
 }
예제 #4
0
        //2.11)This method is used to edit owner in database
        public int EditOwner(Owner_Registration adm)
        {
            int i = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Entry(adm).State = EntityState.Modified;
                i += db.SaveChanges();
            }
            return(i);
        }
예제 #5
0
        //2)OperationalAdmin Controller
        //2.1)This method is used to add new OA to database
        public int AddOwner(Owner_Registration adm)
        {
            int i = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Owner_Registration.Add(adm);
                i += db.SaveChanges();
            }
            return(i);
        }
예제 #6
0
        //2.9)This method is used to change Owner password in database
        public int OwnerChangePassword(string ownerID, string pwd)
        {
            int i = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                var owner = db.Owner_Registration.Find(ownerID);
                owner.Password = pwd;
                db.Owner_Registration.Attach(owner);
                db.Entry(owner).Property(a => a.Password).IsModified = true;
                i += db.SaveChanges();
            }
            return(i);
        }
예제 #7
0
        public int ChangePassword(string AdminID, string Pwd)
        {
            int i = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                var admin = db.Admins.Find(AdminID);
                admin.Password = Pwd;
                db.Admins.Attach(admin);
                db.Entry(admin).Property(a => a.Password).IsModified = true;
                i += db.SaveChanges();
            }
            return(i);
        }
예제 #8
0
        public bool AddAdmin(Admin adm)
        {
            bool flag = false; int i = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Admins.Add(adm);
                i += db.SaveChanges();
                if (i > 0)
                {
                    flag = true;
                }
            }
            return(flag);
        }
예제 #9
0
        //3.6)This method is used to add Company
        public bool AddCompany(Pharma_Company_Details CompanyDetails)
        {
            bool flag = false;
            int  i    = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Pharma_Company_Details.Add(CompanyDetails);
                i += db.SaveChanges();
                if (i > 0)
                {
                    return(true);
                }
            }
            return(flag);
        }
예제 #10
0
        //3.5)This method is used to add Vendors
        public bool AddVendors(Vender_Details venderDetails)
        {
            bool flag = false;
            int  i    = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Vender_Details.Add(venderDetails);
                i += db.SaveChanges();
                if (i > 0)
                {
                    return(true);
                }
            }
            return(flag);
        }
예제 #11
0
        //3.4)This method is used to add Customers
        public bool AddCustomer(Customer_Details customerDetails)
        {
            bool flag = false;
            int  i    = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Customer_Details.Add(customerDetails);
                i += db.SaveChanges();
                if (i > 0)
                {
                    return(true);
                }
            }
            return(flag);
        }
예제 #12
0
        //2.4)This method is used to add new OA to database
        public bool AddStore(Store_Registration adm)
        {
            bool flag = false;
            int  i    = 0;

            using (MSMSDBEntities db = new MSMSDBEntities())
            {
                db.Store_Registration.Add(adm);
                i += db.SaveChanges();
                if (i > 0)
                {
                    flag = true;
                }
            }
            return(flag);
        }