Esempio n. 1
0
        public Branch_Admin addBranchAdmin(Branch_Admin a)
        {
            var data = e.Branch_Admin.Add(a);

            e.SaveChanges();
            return(data);
        }
Esempio n. 2
0
        public ActionResult AddBranchAdmin(Branch_Admin b)//after clicking register button,this method is called and "thank you" messsage is displayed if all inputs are correct

        {
            b.Status    = "Pending";
            b.Role_Type = "BA";
            ViewBag.msg = DBOperations.InsertBranchAdmin(b);
            return(View("BranchAdmin"));//displays 'thank you" msg on the same BranchAdmin.cshtml
        }
Esempio n. 3
0
        public BranchAdminData updateBranchAdmin(Branch_Admin a)
        {
            Branch_Admin old = e.Branch_Admin.Where(
                x => x.Id == a.Id).SingleOrDefault();

            if (old != null)
            {
                e.Entry(old).CurrentValues.SetValues(a);
                e.SaveChanges();
                BranchAdminData d = new BranchAdminData();
                d.Id       = a.Id;
                d.Name     = a.Name;
                d.Contact  = a.Contact;
                d.DOB      = a.DOB;
                d.Email    = a.Email;
                d.Password = a.Password;
                return(d);
            }
            return(null);
        }
Esempio n. 4
0
        public ActionResult BranchAdmin() //to view the branch admin registration page,goes to BranchAdmin.cshtml
        {
            Branch_Admin b = new Branch_Admin();

            return(View());
        }