Example #1
0
 /// <summary>
 /// 房屋列表页面
 /// </summary>
 /// <param name="house"></param>
 /// <param name="page"></param>
 /// <param name="size"></param>
 /// <returns></returns>
 public ActionResult HouseList(House_Info house, int delete = 0, int page = 1, int size = 8)
 {
     if (HasHouseUser())
     {
         string username = "";
         int    pages = 0, count = 0;
         bool   isdelete = false;
         if (delete == 1)
         {
             isdelete = true;
         }
         User_Info user = GetUser();
         if (user.UserRole == EnumCode.UserRole.Normal)
         {
             username = user.LoginName;
         }
         List <House_Info> list = _houseService.GetHouseList(house, isdelete, username, page, size, out pages, out count);
         ViewBag.house  = house;
         ViewBag.count  = count;
         ViewBag.pages  = pages;
         ViewBag.page   = page;
         ViewBag.delete = delete;
         return(View(list));
     }
     return(RedirectToAction("Login", "User"));
 }
        public void Delete(int Id)
        {
            User_Info user = this.context.User_Info.SingleOrDefault(x => x.Id == Id);

            this.context.User_Info.Remove(user);
            this.context.SaveChanges();
        }
        public JsonResult LoginUser(string Name, string Pwd)
        {
            JsonResult  json        = new JsonResult();
            ResultModel resultModel = new ResultModel();
            User_Info   result      = user.GetUser_Info(Name);
            string      pwd         = EncryptHelper.MD5(Pwd);

            if (result != null)
            {
                if (result.PassWord == pwd)
                {
                    resultModel.Ret     = 200;
                    Session["UserName"] = Name;

                    resultModel.Data = Json(result);
                }
            }
            else
            {
                resultModel.code = 500;
                resultModel.Msg  = "登陆失败";
            }
            json.Data = resultModel;
            return(json);
        }
Example #4
0
        protected void Add_ShiftUpdate(object sender, EventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                Shift         objShift_Data = new Shift();
                AdminBLL      ws            = new AdminBLL();
                AdminDAL      aa            = new AdminDAL();
                SqlConnection conn          = new SqlConnection();
                conn = aa.getconnection();
                DateTime datetime;

                objShift_Data.Shift_ID      = txtaddshiftID.Text;
                objShift_Data.shiftdep      = txtaddshiftName.Text;
                objShift_Data.ShiftDateFrom = DateTime.TryParse(txtaddDateFrom.Text, out datetime) ? (DateTime?)datetime : null;;
                objShift_Data.ShiftDateTo   = DateTime.TryParse(txtaddDateTo.Text, out datetime) ? (DateTime?)datetime : null;;
                objShift_Data.ShiftTimeFrom = TimeSelector1.Date.TimeOfDay.ToString();
                objShift_Data.ShiftTimeTo   = TimeSelector2.Date.TimeOfDay.ToString();
                objShift_Data.Location      = txtaddLocationName.Text;


                AddNewStaffShiftRequest objstaffshift = new AddNewStaffShiftRequest();
                Staff_Shift             objStaff      = new Staff_Shift();


                User_Info objuser = new User_Info();

                foreach (TextBox tb in dynamicTextBoxes)
                {
                    string        ss  = Convert.ToString(objuser.Staff_ID);
                    SqlCommand    cmd = new SqlCommand("select Staff_ID from userinformation", conn);
                    SqlDataReader rd  = cmd.ExecuteReader();
                    while (rd.Read())
                    {
                        ss = rd.GetValue(0).ToString();

                        if (ss == tb.Text)
                        {
                            objStaff.Shift_ID = objShift_Data.Shift_ID;
                            objStaff.Staff_ID = tb.Text;
                            ws.AddStaffShift(objStaff);
                        }
                    }
                    rd.Close();
                }


                ws.UpdateShiftData(objShift_Data);

                HttpContext.Current.Items.Add(ContextKeys.CTX_COMPLETE, "UPDATE");
                Server.Transfer("AlertUpdateComplete.aspx");
            }
            catch (System.Threading.ThreadAbortException)
            {
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
Example #5
0
 public static int?CheckUserMemberShip(User_Info u)
 {
     using (var db = new PetsPlanetDBContext())
     {
         return(db.User_Info.Where(x => x.US_Name == u.US_Name).FirstOrDefault().U_Id);
     }
 }
Example #6
0
        public ActionResult User_Registraion_Form(User_Info dcc, HttpPostedFileBase postedFile)
        {
            if (ModelState.IsValid)
            {
                string fileName = System.IO.Path.GetFileName(postedFile.FileName);

                //Set the Image File Path.
                string filePath = "~/Uploads/" + fileName;

                //Save the Image File in Folder.
                postedFile.SaveAs(Server.MapPath(filePath));



                using (var context = new DestCoveryContext())
                {
                    context.Users.Add(dcc);

                    context.SaveChanges();
                }
                return(View("Thanks", dcc));
            }
            else
            {
                return(View());
            }
        }
Example #7
0
        private void SetRight()
        {
            try
            {
                c_row_select = dgrUser.SelectedIndex;

                User_Rights frmUser_Rights = new User_Rights();
                frmUser_Rights.Owner = Window.GetWindow(this);

                User_Info _us = new User_Info();
                _us = (User_Info)dgrUser.SelectedItem;
                if (_us != null)
                {
                    frmUser_Rights.c_UsersInfo = _us;
                    frmUser_Rights.ShowDialog();

                    DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                }
                else
                {
                    NoteBox.Show("Bạn chưa chọn user để set quyền", "Thông báo", NoteBoxLevel.Error);
                    DataGridHelper.NVSFocus(dgrUser, 0, 1);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #8
0
 public User_Info UserInfo_CheckLogin(string p_username, string p_password)
 {
     try
     {
         string    pass_used_check = NaviCommon.CommonFuc.Encrypt(p_username.ToUpper() + p_password);
         User_Info objUser         = UserInfo_GetByName(p_username);
         if (objUser == null || objUser.User_Id == 0)
         {
             return(null);
         }
         User_Info ResultUser = UserInfo_GetById(objUser.User_Id);
         if (ResultUser != null)
         {
             if (pass_used_check == ResultUser.Password)
             {
                 return(ResultUser);
             }
         }
         return(null);
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(null);
     }
 }
Example #9
0
        void Delete_User()
        {
            try
            {
                c_row_select = dgrUser.SelectedIndex;
                User_Info _User_Info = (User_Info)dgrUser.SelectedItem;

                if (_User_Info == null)
                {
                    return;
                }

                MessageBoxResult result = NoteBox.Show("Bạn chắc chắn muốn xóa người dùng này hay không?", "Thông báo", NoteBoxLevel.Question);
                if (MessageBoxResult.Yes == result)
                {
                    if (c_User_Controller.User_Delete(_User_Info.User_Id))
                    {
                        NoteBox.Show("Xóa dữ liệu thành công");
                        LoadData();
                    }
                }
                else
                {
                    DataGridHelper.NVSFocus(dgrUser, c_row_select, 0);
                }
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #10
0
        void User_Reset_Pass()
        {
            try
            {
                c_row_select = dgrUser.SelectedIndex;
                User_Info _User_Info = (User_Info)dgrUser.SelectedItem;

                if (_User_Info == null)
                {
                    return;
                }
                Update_Pass _Update_Pass = new Update_Pass();
                _Update_Pass.c_is_reset = 1;

                _Update_Pass.c_User_Info = _User_Info;
                _Update_Pass.Owner       = Window.GetWindow(this);
                _Update_Pass.ShowDialog();

                if (_Update_Pass.c_ok != 0)
                {
                    LoadData();
                }

                DataGridHelper.NVSFocus(dgrUser, c_row_select, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #11
0
        void Insert_User()
        {
            try
            {
                frmCreate_User _frmCreate_User = new frmCreate_User();
                _frmCreate_User.c_type = Convert.ToInt16(Form_Type.Insert);
                _frmCreate_User.Owner  = Window.GetWindow(this);
                _frmCreate_User.ShowDialog();

                if (_frmCreate_User.c_id_insert != 0)
                {
                    LoadData();

                    for (int i = 0; i < c_lst.Count; i++)
                    {
                        User_Info ui = (User_Info)c_lst[i];
                        if (ui.User_Id == _frmCreate_User.c_id_insert)
                        {
                            c_row_select = i;
                            _frmCreate_User.c_id_insert = 0;
                            break;
                        }
                    }
                }

                DataGridHelper.NVSFocus(dgrUser, c_row_select, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #12
0
        private void btnPhanQuyen_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                User_Info ms = new User_Info();
                ms = (User_Info)dgrUser.SelectedItem;

                c_row_select = dgrUser.SelectedIndex;
                if (ms != null)
                {
                    User_Rights frm_GroupUser_Right = new User_Rights();
                    frm_GroupUser_Right.Owner       = Window.GetWindow(this);
                    frm_GroupUser_Right.c_UsersInfo = ms;
                    frm_GroupUser_Right.ShowDialog();
                    if (frm_GroupUser_Right.c_ok == 1)
                    {
                        DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                        frm_GroupUser_Right.c_ok = 0;
                    }
                    else
                    {
                        DataGridHelper.NVSFocus(dgrUser, c_row_select, 1);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLog.log.Error(ex.ToString());
            }
        }
Example #13
0
        public ActionResult UpdatingUser()
        {
            if (Convert.ToBoolean(Session["loggedOn"]) == true && Convert.ToInt32(Session["userType"]) == 1)
            {
                if (Request.Form["editBtn"] != null)
                {
                    try
                    {
                        User_Info user = new User_Info();
                        user.Id   = Convert.ToInt32(Request.Form["id"]);
                        user.Name = Request.Form["Name"];

                        users.Update(user);

                        return(RedirectToAction("showUsers"));
                    }
                    catch (Exception e)
                    {
                        ViewBag.Errormsg = e;
                        Response.Write(e);
                    }
                }
            }
            return(View("Index"));
        }
        public ActionResult Index(FormCollection collection)
        {
            string username = collection["username"];
            string password = collection["password"];

            UserRepository repo = new UserRepository();
            User_Info      u    = repo.login(username, password);

            if (u != null)
            {
                Session["user"]         = u;
                Session["is_logged_in"] = true;
                if (u.UserType == 1)
                {
                    return(RedirectToAction("Index", "Admin"));
                }
                else if (u.UserType == 2)
                {
                    return(RedirectToAction("index", "ProjectManager"));
                }
                else
                {
                    return(RedirectToAction("index", "Developer"));
                }
            }
            else
            {
                Session["Error Messeage"] = "Invalid username or password";
                return(RedirectToAction("Index"));
            }
        }
Example #15
0
        void User_View()
        {
            try
            {
                c_row_select = dgrUser.SelectedIndex;
                User_Info _User_Info = (User_Info)dgrUser.SelectedItem;

                if (_User_Info == null)
                {
                    return;
                }

                frmCreate_User _Users_View = new frmCreate_User();
                _Users_View.Owner = Window.GetWindow(this);

                _Users_View.c_User_Info = _User_Info;
                _Users_View.c_type      = Convert.ToInt16(Form_Type.View);
                _Users_View.ShowDialog();

                DataGridHelper.NVSFocus(dgrUser, c_row_select, 0);
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
            }
        }
Example #16
0
 /// <summary>
 /// 移除上侧菜单HTML缓存
 /// </summary>
 /// <param name="loginUser"></param>
 public static void RemoveTopMenuCache(User_Info loginUser)
 {
     if (GetTopMenuCache(loginUser) != null)
     {
         HttpRuntime.Cache.Remove(topMenuCacheName + loginUser.ID);
     }
 }
Example #17
0
    public static string GetGIT_UserName(string pid)
    {
        User_Info u = new User_Info();

        u.GetdgUsererPid(pid);
        return(u.NAME);
    }
Example #18
0
        public static TokenResponseModel GenerateToken(User_Info user, JwtTokenModel jwtToken)
        {
            TokenResponseModel response = new TokenResponseModel();

            var secretKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtToken.JwtKey));

            var claims = new Claim[]
            {
                new Claim("UserID", user.Id.ToString()),
                new Claim("Account", user.Account),
                new Claim("Name", user.Name)
            };


            var token = new JwtSecurityToken(
                issuer: jwtToken.JwtIssuer,
                audience: jwtToken.JwtAudience,
                claims: claims,
                notBefore: DateTime.Now,
                expires: DateTime.Now.AddDays(jwtToken.JwtExpireDays),
                signingCredentials: new SigningCredentials(secretKey, SecurityAlgorithms.HmacSha256)
                );

            response.access_token = new JwtSecurityTokenHandler().WriteToken(token);

            response.type = JwtBearerDefaults.AuthenticationScheme;

            response.expires = DateTime.Now.AddDays(jwtToken.JwtExpireDays);

            return(response);
        }
Example #19
0
        public User_Info GetInfoAndDepartByUserid(int id)
        {
            User_Info user_Info = DbSet.Include(a => a.User_Depart).Include(a => a.User_Union)
                                  .Single(uid => uid.Id.Equals(id));

            return(user_Info);
        }
 /// <summary>
 /// 判断密码是否有效。
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void tbPwd_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar != 13)
     {
         return;
     }
     if (String.IsNullOrEmpty(tbUserName.Text.Trim()))
     {
         return;
     }
     if (String.IsNullOrEmpty(tbPwd.Text.Trim()))
     {
         return;
     }
     //检查密码
     if (!CheckUsers.isPasswordRight(tbUserName.Text.Trim(), tbPwd.Text.Trim(), Application.ProductName))
     {
         MessageBox.Show("密码无效", "提示:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         tbPwd.Clear();
         return;
     }
     ;
     this._user_Info   = CheckUsers.getUserInfo(tbUserName.Text.Trim(), Application.ProductName);
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Example #21
0
        public static User_Info GetReviewer(string _rowid)
        {
            User_Info a = new User_Info();

            try
            {
                using (SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead))
                {
                    //取得目前的簽核中的階層
                    StringBuilder sb = new StringBuilder();
                    sb.Append(" SELECT  top 1  text,reviewdate,qseq, REPLACE(requesturl,'EDIT','VIEW') requesturl,b.name name,email,b.id bid, revieweruid , ");
                    sb.Append(" convert(varchar(20), a.initdate,120)'initdate' ");
                    sb.Append(" FROM   eipa.dbo.dgflowqueue a  ");
                    sb.Append(" left join eipa.dbo.dguser b   on revieweruid=b.id  ");
                    sb.AppendFormat(" where requesturl like '%{0}' AND reviewdate IS NULL AND qseq is not null order by a.initdate  desc  ", _rowid);

                    ds.Open(sb.ToString());

                    if (!ds.EOF)
                    {
                        string uid = ds["revieweruid"].ToString();

                        a.GetUserByID(uid);
                    }

                    return(a);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public User_Info GetByIdnumber(string idnumber)
        {
            var res = new User_Info();
            //查询条件
            var predicate = WhereExtension.True <User_Info>();//初始化where表达式

            //Console.WriteLine("aaaaaaaa" + idnumber);这什么玩意
            if (!String.IsNullOrEmpty(idnumber))
            {
                predicate = predicate.And(p => Dtol.Helper.MD5.Decrypt(p.Idnumber).Equals(idnumber));
            }

            var result = DbSet.Where(predicate).ToList();

            if (result.Count > 0)
            {
                res = result.First();
            }
            else
            {
                res = null;
            }

            return(res);
        }
Example #23
0
        /// <summary>
        /// Lấy danh sách ck phân quyền theo user (trong session)
        /// </summary>
        /// <returns></returns>
        public static Dictionary <decimal, string> Get_ListWareHouse_Auz()
        {
            try
            {
                Dictionary <decimal, string> _dic_WareHouse_byUser = new Dictionary <decimal, string>();
                if (SessionData.CurrentUser == null)
                {
                    return(_dic_WareHouse_byUser);
                }

                User_Info currentUser = (User_Info)SessionData.CurrentUser;
                string    _key        = NaviCommon.SystemParaKey.c_dic_USER_WAREHOUSE + "_" + currentUser.User_Id.ToString();

                if (SessionData.GetDataSession(_key) != null)
                {
                    _dic_WareHouse_byUser = (Dictionary <decimal, string>)SessionData.GetDataSession(_key);
                }

                return(_dic_WareHouse_byUser);
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(new Dictionary <decimal, string>());
            }
        }
        public JsonResult AddUser(string Name, string Email, string UserType, string Telephone, string pwd)
        {
            ResultModel resultModel = new ResultModel();
            User_Info   user_Info   = new User_Info();

            user_Info.LoginName  = Name;
            user_Info.Email      = Email;
            user_Info.UserType   = int.Parse(UserType);
            user_Info.Telephone  = Telephone;
            user_Info.PassWord   = EncryptHelper.MD5(pwd);
            user_Info.CreateTime = DateTime.Now;
            user_Info.IsDel      = true;
            int result = user.AddUser(user_Info);

            if (result > 0)
            {
                resultModel.Ret  = 200;
                resultModel.data = result;
            }
            else
            {
                resultModel.Ret = 500;
                resultModel.Msg = "添加失败!";
            }
            var aa = Json(resultModel);

            return(Json(resultModel));
        }
Example #25
0
        public static List <User_Info> Get_LisUserDoanhNghiep(bool p_isAdd_None = true)
        {
            try
            {
                Get_DBMemoryBL   _Get_DBMemoryBL = new Get_DBMemoryBL();
                List <User_Info> _lst_re         = new List <User_Info>();
                List <User_Info> _lst            = _Get_DBMemoryBL.DBMem_GetDataRealTime_Object <List <User_Info> >("c_lst_UserDoanhNghiep");
                if (p_isAdd_None)
                {
                    User_Info _User_Info = new User_Info();
                    _User_Info.User_Id   = -1;
                    _User_Info.User_Name = "-- Chọn Doanh Nghiệp -- ";
                    _lst_re.Add(_User_Info);
                }

                foreach (User_Info item in _lst)
                {
                    _lst_re.Add(item);
                }
                return(_lst_re);
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(new List <User_Info>());
            }
        }
 public ActionResult EditPassword(string p_old_pass, string p_new_pass)
 {
     try
     {
         User_Info currentUser = (User_Info)SessionData.CurrentUser;
         string    old_pass_in = NaviCommon.CommonFuc.Encrypt(currentUser.User_Name.ToUpper() + p_old_pass);
         if (old_pass_in != currentUser.Password)
         {
             return(Json(new { success = -1 }));
         }
         UserInfo_BL _UserBl    = new UserInfo_BL();
         string      new_pass   = NaviCommon.CommonFuc.Encrypt(currentUser.User_Name.ToUpper() + p_new_pass);
         decimal     resultEdit = _UserBl.UserInfo_Update_Pass(currentUser.User_Id, new_pass, DateTime.Now.Date);
         if (resultEdit < 0)
         {
             return(Json(new { success = -2 }));
         }
         currentUser.Last_Update_Pass = DateTime.Now;
         return(Json(new { success = 1 }));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(Json(new { success = -2 }));
     }
 }
Example #27
0
        public static List <WareHouse_Info> Get_ListWareHouse_ByUser(bool p_is_add_None = false)
        {
            try
            {
                List <WareHouse_Info> _lst_re     = new List <WareHouse_Info>();
                User_Info             currentUser = (User_Info)SessionData.CurrentUser;
                string _key = NaviCommon.SystemParaKey.c_dic_USER_OF_WAREHOUSE + "_" + currentUser.User_Id.ToString();

                if (SessionData.GetDataSession(_key) != null)
                {
                    List <WareHouse_Info> _lst = (List <WareHouse_Info>)SessionData.GetDataSession(_key);
                    if (p_is_add_None)
                    {
                        WareHouse_Info _WareHouse_Info = new WareHouse_Info();
                        _WareHouse_Info.WareHouse_Id   = -1;
                        _WareHouse_Info.WareHouse_Name = "-- Chọn kho -- ";
                        _lst_re.Add(_WareHouse_Info);
                    }
                    foreach (WareHouse_Info item in _lst)
                    {
                        _lst_re.Add(item);
                    }
                }

                return(_lst_re);
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(new List <WareHouse_Info>());
            }
        }
Example #28
0
        public ActionResult User_Registraion_Form(User_Info dcc, HttpPostedFileBase postedFile)
        {
            if (ModelState.IsValid)
            {
                string fileName = System.IO.Path.GetFileName(postedFile.FileName);

                //Set the Image File Path.
                string filePath = "~/Uploads/user_img/" + fileName;

                //Save the Image File in Folder.
                postedFile.SaveAs(Server.MapPath(filePath));

                using (var context = new DestCoveryContext())
                {
                    context.Users.Add(dcc);



                    context.SaveChanges();
                }

                ViewBag.LOGINMSG = "Registered Successfully. Please Login";

                return(RedirectToAction("login", "Home"));
            }
            else
            {
                return(View());
            }
        }
Example #29
0
 /// <summary>
 /// 移除URL权限缓存
 /// </summary>
 /// <param name="loginUser"></param>
 public static void RemovePermissionUrlCache(User_Info loginUser)
 {
     if (GetPermissionUrlCache(loginUser) != null)
     {
         HttpRuntime.Cache.Remove(permissionUrlCacheName + loginUser.ID);
     }
 }
Example #30
0
        private void UserLogin()
        {
            try
            {
                tblError.Visibility = Visibility.Collapsed;
                if (c_LoadCommonDataStatus != 2)
                {
                    return;
                }

                User_Controller _User_Controller = new User_Controller();

                User_Info _User_Info = _User_Controller.User_Login(txtUsername.Text, txtPassword.Text);

                if (_User_Info == null)
                {
                    NoteBox.Show("Sai tên đăng nhập hoặc mật khẩu", "", NoteBoxLevel.Error);
                    txtPassword.Focus();
                    return;
                }

                _User_Controller.User_Update_Last_Login(_User_Info.User_Id, DateTime.Now);

                CommonData.c_Urser_Info = _User_Info;
                this.DialogResult       = true;
                this.Close();
            }
            catch (Exception ex)
            {
                CommonData.log.Error(ex.ToString());
                NoteBox.Show("Đăng nhập thất bại", "Thông báo");
            }
        }
Example #31
0
        public ActionResult Create(AddUserModel User)
        {
            //  var errors = ModelState
            //.Where(x => x.Value.Errors.Count > 0)
            //.Select(x => new { x.Key, x.Value.Errors })
            //.ToArray();
            if (ModelState.IsValid)
            {

                try
                {
                   // string usrpwd = Encode(User.Usr_pwd);
                    // Insert Product
                    User_Info objnewUser = new User_Info();
                    objnewUser.UidNo = (db.User_Info.Max(i => (int?)i.UidNo) ?? 0) + 1;  //Convert.ToInt32(db.PRODUCTs.Max(x => x.Pid)) + 1;
                    objnewUser.First_name = User.First_name;
                    objnewUser.Last_name = User.Last_name;
                    objnewUser.Isactive = true;
                    objnewUser.E_mail_id = User.Email_id;
                    objnewUser.Mobile_number = User.Mobile_number;
                    objnewUser.Address_Communication = User.Address_Communication;
                     objnewUser.DOB=User.DOB;
                    objnewUser.Gender=User.Gender;
                    objnewUser.Usr_pwd = Encode(User.Usr_pwd);
                    db.User_Info.Add(objnewUser);
                    db.SaveChanges();
                    TempData["Usr_Message"] = ConfigurationManager.AppSettings["INS_SUC"];
                    ModelState.Clear();
                    return RedirectToAction("Index", "checkout");

                }

                catch (Exception exception)
                {

                }

                return RedirectToAction("Create", "UserInfo");

            }

            return View(User);
        }