示例#1
0
        public ActionResult AddManager(string name, string branch, string address, string phno, string mail)
        {
            try
            {
                SuperManagerClass obj = new SuperManagerClass();

                string res = obj.addManager(name, branch, address, phno, mail);
                ViewBag.result = res;
            }

            catch (Exception exp)
            {
                ViewBag.Error = "Exception " + exp;
            }
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult DeleteManager()
        {
            int mgrId = (int)Session["mgrId"];

            try
            {
                SuperManagerClass obj = new SuperManagerClass();

                string res = obj.deleteManager(mgrId);
                ViewBag.result = res;
            }

            catch (Exception exp)
            {
                ViewBag.Error = "Exception " + exp;
            }
            return(RedirectToAction("Index"));
        }
示例#3
0
        public ActionResult EditManager(int id)
        {
            ViewBag.mgrId    = id;
            Session["mgrId"] = id;
            BankEntities2 newObj = new BankEntities2();

            try
            {
                SuperManagerClass superManagerClass = new SuperManagerClass();
                List <string>     branchesList      = superManagerClass.getNonAssignedBranches();
            }
            catch (Exception e)
            {
                ViewBag.Error = "Exception " + e;
            }
            Manager obj = newObj.Managers.Single(x => x.managerId == id);

            return(View(obj));
        }
示例#4
0
        public ActionResult EditManager(string managerName, string address, string phoneNo, string emailId, string branchId)
        {
            int mgrId = (int)Session["mgrId"];

            try
            {
                SuperManagerClass obj = new SuperManagerClass();

                string res = obj.assignToZero(mgrId);
                //ViewBag.result = res;



                string resu = obj.editManager(mgrId, managerName, address, phoneNo, emailId, branchId);
                ViewBag.result1 = resu;
            }

            catch (Exception exp)
            {
                ViewBag.Error = "Exception " + exp;
            }
            return(RedirectToAction("Index"));
        }