Example #1
0
        public ActionResult Index(UserViewModel piUserViewData)
        {
            if (ModelState.IsValid)
            {
                var user = Session["CurrentUser"] as UserAndRole;
                string UserId = piUserViewData.Patient.UserId;
                string UserName = piUserViewData.Patient.UserName;
                if (UserName == null)
                {
                    UserName = "";
                }
                string Password = piUserViewData.Patient.Password;
                if (Password == null)
                {
                    Password = "";
                }
                string Class = piUserViewData.Patient.Class;
                string strEndDate = piUserViewData.Patient.EndDate;
                int EndDate = 0;
                EndDate = Convert.ToInt32(strEndDate.Replace("-", ""));

                //往数据库插数据
                //

                bool SetUserInfoFlag = _ServicesSoapClient.SetMstUserUM(UserId, UserName, Password, Class, EndDate, user.UserId, user.TerminalName, user.TerminalIP, user.DeviceType);
                if (SetUserInfoFlag)
                {
                    return RedirectToAction("Index");
                }
            }
            return View(piUserViewData);
        }
Example #2
0
 public ActionResult UserPartialView(UserViewModel userVM)
 {
     try
     {
         if (userVM.SearchUserId == null)
         {
             userVM.SearchUserId = "";
         }
         if (userVM.SearchUserName == null)
         {
             userVM.SearchUserName = "";
         }
         GetUserInfoList(userVM.SearchUserId, userVM.SearchUserName, ref userVM);
         return View(userVM);
     }
     catch (Exception ex)
     {
         return Content(ex.ToString());
     }
 }
Example #3
0
 //用户管理
 public ActionResult Index()
 {
     UserViewModel userVM = new UserViewModel();
     GetUserInfoList("", "", ref userVM);
     return View(userVM);
 }
Example #4
0
        //查询输出所有用户信息列表
        public void GetUserInfoList(string id, string name, ref UserViewModel userInfoVM)
        {
            List<User> userList = new List<User>();
            int Row = 0;

            System.Data.DataTable userListDT = _ServicesSoapClient.GetUserInfoList(id, name).Tables[0];
            foreach (DataRow row in userListDT.Rows)
            {
                userList.Add(new User { UserId = row["UserId"].ToString(), UserName = row["UserName"].ToString(), Password = row["Password"].ToString(), Class = row["Class"].ToString(), ClassName = row["ClassName"].ToString(), StartDate = row["StartDate"].ToString(), EndDate = row["EndDate"].ToString().Substring(0, 4) + "-" + row["EndDate"].ToString().Substring(4, 2) + "-" + row["EndDate"].ToString().Substring(6, 2) });
                Row++;
            }

            userInfoVM.UserList = userList;
            userInfoVM.RowCount = Row;
        }