コード例 #1
0
 public ActionResult UserDashBoard()
 {
     ClinicalELDAL.Repository.UserRepository obj = new ClinicalELDAL.Repository.UserRepository();
     if (Session["UserID"] != null)
     {
         return(View());
     }
     else
     {
         return(RedirectToAction("Login"));
     }
 }
コード例 #2
0
        public ActionResult EditUser(string id)
        {
            ClinicalELDAL.Repository.UserRepository user = new ClinicalELDAL.Repository.UserRepository();
            ClinicalELDAL.EntityLayer.User          usr  = new ClinicalELDAL.EntityLayer.User();
            ViewModels.UserViewModel uvm = new ViewModels.UserViewModel();
            usr            = user.GetUserByID((id));
            uvm.UserID     = Convert.ToInt32(id);
            uvm.MedicareId = usr.MedicareID;
            uvm.UserID     = usr.UserID;
            uvm.Password   = usr.Password;
            uvm.Name       = usr.Name;
            uvm.RoleID     = usr.RoleID;
            uvm.Sex        = usr.Sex;
            uvm.Status     = usr.Status;

            return(View(uvm));
        }
コード例 #3
0
        public ActionResult EditUser(ViewModels.UserViewModel uvm)
        {
            ClinicalELDAL.Repository.UserRepository user = new ClinicalELDAL.Repository.UserRepository();
            ClinicalELDAL.EntityLayer.User          usr  = new ClinicalELDAL.EntityLayer.User();
            usr.UserID     = uvm.UserID;
            uvm.MedicareId = usr.MedicareID;
            usr.Password   = uvm.Password;
            usr.Name       = uvm.Name;
            uvm.RoleID     = usr.RoleID;
            uvm.Sex        = usr.Sex;
            uvm.Status     = usr.Status;


            usr.Status = uvm.Status;
            if (user.EditUser(usr))
            {
                return(RedirectToAction("Index"));
            }
            return(View(usr));
        }
コード例 #4
0
        public ActionResult NewUser(ViewModels.UserViewModel uvm)
        {
            uvm.UserStatus = 1;
            if (ModelState.IsValid)
            {
                ClinicalELDAL.Repository.UserRepository user = new ClinicalELDAL.Repository.UserRepository();
                ClinicalELDAL.EntityLayer.User          usr  = new ClinicalELDAL.EntityLayer.User();
                usr.Name = uvm.Name;

                usr.UserID     = uvm.UserID;
                usr.MedicareID = uvm.MedicareId;
                usr.Password   = uvm.Password;
                usr.Name       = uvm.Name;
                usr.RoleID     = uvm.RoleID;
                usr.Sex        = uvm.Sex;
                usr.Status     = uvm.Status;
                user.AddUser(usr);
                return(RedirectToAction("Index"));
            }

            ViewModels.UserViewModel vm = new ViewModels.UserViewModel();
            return(View(vm));
        }
コード例 #5
0
 public UserController()
 {
     userRepo = new ClinicalELDAL.Repository.UserRepository();
 }
コード例 #6
0
 public DoctorController()
 {
     DrugRepo = new ClinicalELDAL.Repository.DrugRepository();
     UserRepo = new ClinicalELDAL.Repository.UserRepository();
 }