Exemple #1
0
        public bool Execute()
        {
            userObj = CheckUserExist();
            if (userObj != null)
            {
                if (!FillUserInfo())
                {
                    return(false);
                }
                if (!FillMenuTreeObject())
                {
                    return(false);
                }
                if (!FillMenuTiles())
                {
                    return(false);
                }
                if (!FillAllowedPages())
                {
                    return(false);
                }

                FillSessionObject();
                return(true);
            }

            return(false);
        }
Exemple #2
0
        private ResultObject FillParameters()
        {
            try
            {
                USER_USER UserObj = new USER_USER();
                if (!String.IsNullOrEmpty(slcSinif.Value))
                {
                    UserObj.SINIF = Convert.ToInt16(slcSinif.Value);
                }
                if (!String.IsNullOrEmpty(slcMahalle.Value))
                {
                    UserObj.BOLGE_ID = Convert.ToInt64(slcMahalle.Value);
                }
                if (!String.IsNullOrEmpty(hiddenOgrId.Value))
                {
                    UserObj.OGR_GUID  = Convert.ToInt64(hiddenOgrId.Value);
                    lstOgrBilgi       = (List <OGR_BILGI>)ViewState["lstOgrBilgi"];
                    UserObj.HOCA_GUID = lstOgrBilgi.Where(x => x.GUID == UserObj.OGR_GUID).ToList()[0].HOCA_GUID;
                }
                if (!String.IsNullOrEmpty(hiddenHocaId.Value))
                {
                    UserObj.HOCA_GUID = Convert.ToInt64(hiddenHocaId.Value);
                }
                UserObj.EMAIL       = txtEmail.Value;
                UserObj.INSERT_USER = KsfSI.UserGuid;
                UserObj.IS_ADMIN    = slcAdmin.Value == "1" ? short.Parse("1") : short.Parse("0");
                UserObj.NAME        = txtAd.Value;
                UserObj.PASSWORD    = KasifBusiness.Utilities.KasifHelper.GetSha512HashedData(txtPassword.Value);
                UserObj.SURNAME     = txtSoyad.Value;

                OUser        oUser  = new OUser(UserObj);
                ResultObject result = oUser.OUserOperation();

                if (result.isOk)
                {
                    USER_ROLE_OWNERSHIP uRo = new USER_ROLE_OWNERSHIP();
                    uRo.USER_GUID = UserObj.GUID;
                    uRo.ROLE_GUID = Convert.ToInt64(slcRole.Value);
                    DbOperations.Insert(uRo);
                }
                return(result);
            }
            catch (Exception ex)
            {
                ResultObject result = new ResultObject();
                result.errorMsg  = ex.Message;
                result.errPrefix = "Beklenmeyen Hata. ";
                result.isOk      = false;
                return(result);
            }
        }
Exemple #3
0
 private void DoChangePwd()
 {
     try
     {
         List <USER_USER> lstUser = new List <USER_USER>();
         USER_USER        usrObj  = new USER_USER();
         DbOperations.FindBy <USER_USER>(ref lstUser, usrObj, x => x.GUID == KsfSI.UserGuid);
         lstUser[0].PASSWORD             = KasifHelper.GetSha512HashedData(txtNewPwd.Value);
         lstUser[0].LAST_PWD_CHANGE_DATE = KasifHelper.GetCurrentDate();
         DbOperations.Update(lstUser[0]);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #4
0
        public static string DeleteCurrentRow(string RowGuid, string RoleGuid)
        {
            try
            {
                USER_USER userUSerObj = new USER_USER();
                userUSerObj.GUID = Convert.ToInt64(RowGuid);
                DbOperations.Delete(userUSerObj);

                long lRoleGuid             = Convert.ToInt64(RoleGuid);
                long lRowGuid              = Convert.ToInt64(RowGuid);
                OUserRoleOwnership  oUro   = new OUserRoleOwnership();
                USER_ROLE_OWNERSHIP uroObj = oUro.FindByKey(x => x.ROLE_GUID == lRoleGuid &&
                                                            x.USER_GUID == lRowGuid);
                DbOperations.Delete(uroObj);

                return("success");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
Exemple #5
0
 public OUser(USER_USER userObj)
 {
     this.UserObj = userObj;
 }