Ejemplo n.º 1
0
        public User ValidateUserLogin(string loginId, string password, string terminalId)
        {
            string username = loginId.Trim().ToUpper();
            string userpass = password.Trim();
            string UserPass = EncryptDecryptManager.Encrypt(userpass, true);

            return(_loginDataService.GetUserById(username, UserPass, terminalId));
        }
Ejemplo n.º 2
0
        public string ChangePassword(string curpassword, string newpassword, string usrid, string username)
        {
            //string UserNameR = StrReverse(usrid);
            //string Curr_userpass = EncodeMD5(UserNameR + curpassword.Trim());
            //string New_UserPass = EncodeMD5(UserNameR + newpassword);
            string Curr_userpass = EncryptDecryptManager.Encrypt(curpassword, true);
            string New_UserPass  = EncryptDecryptManager.Encrypt(newpassword, true);

            return(_userDataService.ChangePassword(usrid, Curr_userpass, New_UserPass));
        }
Ejemplo n.º 3
0
        public GridEntity <Entities.HDL.User> GetUserSummary(GridOptions options, string usrId)
        {
            var res = _userDataService.GetUserSummary(options, usrId);

            foreach (var obj in res.Items)
            {
                obj.USRPASS = EncryptDecryptManager.Decrypt(obj.USRPASS, true);
            }
            return(res);
        }
Ejemplo n.º 4
0
        public string SaveUserPermission(MenuPermission usrObj, List <MenuPermission> objUserMenuList, List <MenuPermission> objRemovedMenuList)
        {
            var usrMenu_dt = new DataTable();

            usrMenu_dt.Columns.Add("MENUPERMISSIONID");
            usrMenu_dt.Columns.Add("USERID");
            usrMenu_dt.Columns.Add("MENUID");

            if (objUserMenuList != null)
            {
                foreach (var objMenu in objUserMenuList)
                {
                    DataRow row1;
                    row1 = usrMenu_dt.NewRow();
                    row1["MENUPERMISSIONID"] = objMenu.MenuPermissionId;
                    row1["USERID"]           = usrObj.EmpId;
                    row1["MENUID"]           = objMenu.MenuId;
                    usrMenu_dt.Rows.Add(row1);
                }
            }
            usrMenu_dt.TableName = "tblmenu";
            DataSet dsMenu = new DataSet("dsMenu");

            dsMenu.Tables.Add(usrMenu_dt);

            //RemoveMenu
            var removeMenu_dt = new DataTable();

            removeMenu_dt.Columns.Add("MENUPERMISSIONID");
            removeMenu_dt.Columns.Add("USERID");
            removeMenu_dt.Columns.Add("MENUID");
            if (objRemovedMenuList != null)
            {
                foreach (var objMenu in objRemovedMenuList)
                {
                    DataRow row1;
                    row1 = removeMenu_dt.NewRow();
                    row1["MENUPERMISSIONID"] = objMenu.MenuPermissionId;
                    row1["USERID"]           = usrObj.EmpId;
                    row1["MENUID"]           = objMenu.MenuId;
                    removeMenu_dt.Rows.Add(row1);
                }
            }
            removeMenu_dt.TableName = "tblRemoveMenu";
            DataSet dsRemoveMenu = new DataSet("dsRemoveMenu");

            dsRemoveMenu.Tables.Add(removeMenu_dt);

            usrObj.UsrPass = EncryptDecryptManager.Encrypt(usrObj.UsrPass, true);

            return(_userDataService.SaveUserPermission(usrObj, dsMenu, dsRemoveMenu));
        }