public string registerUser(User user)
        {
            string token            = null;
            EncryptionDecryption ed = new EncryptionDecryption();
            UserBo bo = new UserBo();

            user.role = new Role(3, "user");
            bool userExist = bo.checkUserExistance(user.pseudo);

            if (userExist)
            {
                return("alreadyExist");
            }
            string hashedPassword = ed.hashPassword(user.password);

            user.password = hashedPassword;
            int id = bo.addUser(user);

            if (id < 0)
            {
                return("error");
            }

            token = ed.generateToken(user);
            return(token);
        }
Example #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     rmVo = (RMVo)Session[SessionContents.RmVo];
     SessionBo.CheckSession();
     userBo          = new UserBo();
     userVo          = (UserVo)Session[SessionContents.UserVo];
     advisorVo       = (AdvisorVo)Session[SessionContents.AdvisorVo];
     currentUserRole = Session[SessionContents.CurrentUserRole].ToString().ToLower();
     if (!IsPostBack)
     {
         if (currentUserRole == "admin" || currentUserRole == "ops")
         {
             BindBranchDropDown(advisorVo.advisorId);
             BindGridview(advisorVo.advisorId, true, false, false);
         }
         else if (currentUserRole == "bm")
         {
             BindBranchDropDown(rmVo.RMId);
             if (ddlBMBranch.Items.Count > 1)
             {
                 BindGridview(rmVo.RMId, false, true, false);
             }
             else
             {
                 BindGridview(Convert.ToInt32(ddlBMBranch.SelectedValue.ToString()), false, false, true);
             }
         }
     }
 }
Example #3
0
 public GCUserSession LoginUser(UserBo item)
 {
     try
     {
         var obj = (from c1 in dba.Users_
                    where c1.Email == item.Email && c1.Password == item.Password
                    select new
         {
             userId = c1.UserId,
             roleId = c1.RoleId,
             name = c1.Name,
             ValidateEmail = c1.ValidateEmail
         }).FirstOrDefault();
         if (obj == null)
         {
             throw new InvaliedUserLoginInfomationException("user not founded");
         }
         if (!obj.ValidateEmail)
         {
             throw new EmailAddressNotValidateException();
         }
         return(new GCUserSession
         {
             Email = item.Email,
             UserId = obj.userId,
             Name = obj.name,
             UserType = (int)UserRole(obj.roleId.Trim())
         });
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #4
0
        public bool SaveContactUs(UserBo objbo)
        {
            DBConnection dbcon = new DBConnection();

            try
            {
                string     strQuery = "SaveContactUs";
                SqlCommand cmd      = dbcon.setCommandProperties(strQuery);
                cmd.Parameters.AddWithValue("@UserName", objbo.UserName);
                cmd.Parameters.AddWithValue("@EmailId", objbo.EmailId);
                cmd.Parameters.AddWithValue("@Comments", objbo.Comments);
                cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                if (dbcon != null)
                {
                    dbcon.closeDBConnection();
                }
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MessageBoxResult box    = MessageBox.Show("האם אתה בטוח שברצונך להוסיף את המשתמש?", "ask", MessageBoxButton.OKCancel, MessageBoxImage.Question);
                UserBo           userBo = new UserBo
                {
                    Username    = usernameTextBox.Text,
                    Password    = passwordTextBox.Text,
                    Permission1 = (Permission)permission1ComboBox.SelectedItem,
                    ChackDelete = (bool)chackDeleteCheckBox.IsChecked
                };
                switch (box)
                {
                case MessageBoxResult.OK:
                    bl.AddUserToDo(userBo);
                    User user = new User(bl);
                    user.Show();
                    MessageBoxResult messageBoxResult = MessageBox.Show("המשתמש נוסף למערכת", "Good");
                    Close();
                    break;

                case MessageBoxResult.Cancel:
                    Close();
                    break;
                }
            }
            catch (BOExceptionUser ex)
            {
                _ = MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                ClearValue(TextBox.TextProperty);
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userBo    = new UserBo();
            advisorVo = (AdvisorVo)Session[SessionContents.AdvisorVo];
            userVo    = (UserVo)Session[SessionContents.UserVo];
            AssetBo assetBo = new AssetBo();

            path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());

            if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "admin")
            {
                roleId = 1000;
            }
            else if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "ops")
            {
                roleId = 1004;
            }
            else if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "rm")
            {
                roleId = 1001;
            }
            else if (Session[SessionContents.CurrentUserRole].ToString().ToLower() == "bm")
            {
                roleId = 1002;
            }

            if (!IsPostBack)
            {
                BindReptReportDashBoard();
            }
        }
Example #7
0
        public DataSet CheckLogin(UserBo objbo)
        {
            int          Result = 0;
            DBConnection dbcon  = new DBConnection();

            try
            {
                string     strQuery = "CheckLogin";
                SqlCommand cmd      = dbcon.setCommandProperties(strQuery);
                cmd.Parameters.AddWithValue("@EmailID", objbo.EmailId);
                cmd.Parameters.AddWithValue("@Password", objbo.Password);
                cmd.Parameters.AddWithValue("@LoginTypeId", objbo.LoginTypeID);
                SqlDataAdapter sda = new SqlDataAdapter(cmd);
                DataSet        ds  = new DataSet();
                sda.Fill(ds);
                cmd.Dispose();
                return(ds);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbcon != null)
                {
                    dbcon.closeDBConnection();
                }
            }
        }
Example #8
0
        public ActionDetails Authenticate(string email)
        {
            try
            {
                var userInfo = (from users in dba.Users
                                join userdomain in dba.UserDomains on users.UserDomains.ToList().FirstOrDefault().DomainId equals userdomain.DomainId
                                where users.Email == email
                                select new { emailConfirim = users.EmailConfirmed, name = users.Name, domainId = userdomain.DomainId, email = users.Email, enable = userdomain.Enable }).FirstOrDefault();

                if (userInfo == null)
                {
                    throw new InvaliedLoginExceptions("username or password is wrong");
                }

                var x = new UserBo
                {
                    Name           = userInfo.name,
                    EmailConfirmed = userInfo.emailConfirim,
                    DomainId       = userInfo.domainId,
                    Email          = userInfo.email
                };

                return(ResponseMessage.Success(content: x));
            }
            catch (InvaliedLoginExceptions ex)
            {
                return(ResponseMessage.Error(ex.Message));
            }
            catch (Exception ex)
            {
                return(ResponseMessage.Error(ex, "invalied login info", responseCode: ResponseCode.ServerError));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userBo    = new UserBo();
            advisorVo = (AdvisorVo)Session[SessionContents.AdvisorVo];
            userVo    = (UserVo)Session[SessionContents.UserVo];
            AssetBo assetBo = new AssetBo();

            path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
            if (!IsPostBack)
            {
                BindReptTransactionDashBoard();

                if (advisorVo.advisorId == Convert.ToInt32(ConfigurationSettings.AppSettings["ONLINE_ADVISER"]))
                {
                    foreach (RepeaterItem ri in rptTransationTree.Items)
                    {
                        ri.FindControl("eqtrans").Visible = false;
                    }
                }
                else
                {
                    foreach (RepeaterItem ri in rptTransationTree.Items)
                    {
                        ri.FindControl("eqtrans").Visible = true;
                    }
                }
            }
        }
Example #10
0
        private List <UserBo> FillLst(DataTable pdtDataTable)
        {
            List <UserBo> lstItems = new List <UserBo>();

            try
            {
                UserBo userBo = null;

                foreach (DataRow dr in pdtDataTable.Rows)
                {
                    userBo = new UserBo
                    {
                        IdUser    = ABLib.Databases.GetInt32(dr, "IdUser"),
                        UserName  = ABLib.Databases.GetString(dr, "UserName"),
                        TypeUser  = ABLib.Databases.GetByte(dr, "TypeUser"),
                        Activated = ABLib.Databases.GetBoolean(dr, "Activated")
                    };

                    lstItems.Add(userBo);
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(lstItems);
        }
 public AccountViewModel(bool init)
 {
     if (init)
     {
         UserBo = new UserBo(true);
     }
 }
        public async Task <GenericResponse> Delete(long id)
        {
            UserBo userDto = null;
            ServiceResult <UserBo> result = await serviceManager.User_Service.GetByIdAsync(id);

            if (result.Success)
            {
                userDto = result.Data;

                // Yetki kontrolü yapılıyor
                ServiceResult <bool> resultAutorized = await GetAutorizedUserStatusById(userDto);

                if (!resultAutorized.Success || !resultAutorized.Data)
                {
                    return(GenericResponse.Error(ResultType.Error, "Not Autorized Access!", "U_DLT_01", StatusCodes.Status203NonAuthoritative));
                }
            }
            else
            {
                return(GenericResponse.Error(ResultType.Error, "Not Found!", "U_DLT_02", StatusCodes.Status404NotFound));
            }

            ServiceResult serviceResult = await serviceManager.User_Service.DeleteAsync(id);

            if (serviceResult.Success)
            {
                return(GenericResponse.Ok());
            }
            else
            {
                Log(serviceResult.Error, LogLevel.Error, this.ControllerContext.RouteData.Values);

                return(GenericResponse.Error(ResultType.Error, serviceResult.Error, "U_DLT_03", StatusCodes.Status500InternalServerError));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userBo    = new UserBo();
            userVo    = (UserVo)Session[SessionContents.UserVo];
            adviserVo = (AdvisorVo)Session["advisorVo"];
            CustomerVo cusromerVo = new CustomerVo();

            cusromerVo = (CustomerVo)Session["customerVo"];
            if (!IsPostBack)
            {
                if (Session["IsCustomerDrillDown"] != null)
                {
                    txtCustomerId.Value = cusromerVo.CustomerId.ToString();
                    BindCustomerAlertSetup();
                    lblType.Visible = false;
                    ddlType.Visible = false;
                    btngo.Visible   = false;
                    //gvCustomerAlertSetup.MasterTableView.IsItemInserted = false;
                    //GridEditableItem gridEditableItem = (GridEditableItem)e.(sender);
                    //gridEditableItem.OwnerTableView.IsItemInserted = false;
                    //this.gvCustomerAlertSetup.MasterTableView.Items[0].EditFormItem.Enabled = false;
                }
            }
            txtCustomerName_autoCompleteExtender.ContextKey    = adviserVo.advisorId.ToString();
            txtCustomerName_autoCompleteExtender.ServiceMethod = "GetAdviserCustomerName";
            txtPansearch_autoCompleteExtender.ContextKey       = adviserVo.advisorId.ToString();
            txtPansearch_autoCompleteExtender.ServiceMethod    = "GetAdviserCustomerPan";
            txtClientCode_autoCompleteExtender.ContextKey      = adviserVo.advisorId.ToString();
            txtClientCode_autoCompleteExtender.ServiceMethod   = "GetCustCode";
        }
Example #14
0
        protected void btnsubmit_Click(object sender, EventArgs e)
        {
            UserBo objbo = new UserBo();

            objbo.UserId   = txtuserid.Text.Trim();
            objbo.Password = txtpassword.Text.Trim();
            //int Result = objDAL.CheckLogin(objbo);
            //if (Result > 0)
            //{
            //    msgdiv.InnerText="Successfully Login.";
            //    if (chkremeber.Checked)
            //    {
            //        Response.Cookies["UserID"].Expires = DateTime.Now.AddDays(30);
            //        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(30);
            //    }
            //    else
            //    {
            //        Response.Cookies["UserID"].Expires = DateTime.Now.AddDays(-1);
            //        Response.Cookies["Password"].Expires = DateTime.Now.AddDays(-1);
            //    }
            //    Response.Cookies["UserID"].Value = txtuserid.Text;
            //    Response.Cookies["Password"].Value = txtpassword.Text;
            //}
            //else
            //    msgdiv.InnerText="UserID/Password incorrect.";
        }
Example #15
0
 protected void btnRegister_Click(object sender, EventArgs e)
 {
     try
     {
         UserBo objBo = new UserBo();
         objBo.UserId   = txtSignupUserId.Text.Trim();
         objBo.Password = txtSignupPwd.Text.Trim();
         //objBo.CnfPassword = txtConfirmPassword.Text.Trim();
         objBo.FirstName = txtfname.Text.Trim();
         objBo.LastName  = txtlname.Text.Trim();
         objBo.DOB       = txtdob.Text.Trim();
         objBo.Institute = ddlinstitute.SelectedValue;
         objBo.EmailId   = txtEmailID.Text;
         int Result = objreg.InsertStudentDet(objBo);
         if (Result > 0)
         {
             lblMessage.Text = "Registration Successfully Completed";
             clearControls(pnlReg);
         }
         else
         {
             lblMessage.Text = "Error occur while registration";
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #16
0
        public Object CheckUsername(string username)
        {
            if (String.IsNullOrEmpty(username))
            {
                var responseMessage = new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("Username is not provided")
                };
                throw new HttpResponseException(responseMessage);
            }
            else
            {
                Object status;
                try
                {
                    var userBo = new UserBo();
                    status = userBo.CheckUsername(username) ? Available : NotAvailable;
                }
                catch (Exception exception)
                {
                    var message = new HttpResponseMessage(HttpStatusCode.ServiceUnavailable)
                    {
                        Content = new StringContent(exception.Message)
                    };
                    Logger.Error("API LAYER: ERROR IN CLASS: UserController, METHOD: GET =>> EXCEPTION MESSAGE: " + exception.Message);
                    throw new HttpResponseException(message);
                }


                return(status);
            }
        }
Example #17
0
        protected async Task <ServiceResult <List <OrganizationBo> > > GetAutorizedOrganizationList()
        {
            ServiceResult <List <OrganizationBo> > result;

            if (this.currentUserId > 0)
            {
                ServiceResult <IEnumerable <UserBo> > resultList = await serviceManager.User_Service.GetAsync(filter : (x => x.Id == this.currentUserId), includeProperties : (x => x.Organization));

                if (!resultList.Success || resultList.Data == null)
                {
                    result = new ServiceResult <List <OrganizationBo> >(null, false, "Logged user not found!");
                }
                else
                {
                    UserBo userDto = resultList.Data.FirstOrDefault();
                    result = await serviceManager.Organization_Service.GetOrganizationHierarchicaly(userDto.Organization);
                }
            }
            else
            {
                result = new ServiceResult <List <OrganizationBo> >(null, false, "Logged user identity not found!");
            }

            return(result);
        }
Example #18
0
 public void  Register(UserBo item)
 {
     try
     {
         if (dba.Users.Count(p => p.Email == item.Email) != 0)
         {
             throw new PrimaryKeyVialationException("user is already registed");
         }
         string userId = Guid.NewGuid().ToString();
         dba.Users.Add(new Domain.User()
         {
             Email         = item.Email,
             Password      = item.Password,
             UserId        = userId,
             Active        = false,
             ValidateEmail = false,
             Name          = item.Name
         });
         dba.UserRoleGroups.Add(new UserRoleGroup
         {
             UserId = userId,
             RoleId = item.UserType.ToString()
         });
     }
     catch (Exception)
     {
         throw;
     }
 }
        private void BindTcStatus()
        {
            int    userId = Convert.ToInt32(Session["UserId"]);
            UserBo user   = _tcDal.GetUserDetailsByUserId(userId);

            ddlStatus.SelectedValue = user.PartialTc ? "0" : "1";
        }
Example #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SessionBo.CheckSession();
     userBo    = new UserBo();
     userVo    = (UserVo)Session[SessionContents.UserVo];
     adviserVo = (AdvisorVo)Session[SessionContents.AdvisorVo];
 }
Example #21
0
        public UserKanriAddServiceOutBo execute()
        {
            UserKanriAddServiceOutBo outBo = new UserKanriAddServiceOutBo();

            using (var context = new MyContext())
            {
                int condition = this.inBo.empId.ToIntType();
                var products  = context.UserMst
                                .Where(x => x.emp_id == condition)
                                .ToArray();

                if (products.Count() > 0)
                {
                    outBo.errorMessage = "既に登録されています\n";
                    return(outBo);
                }
            }

            for (int i = 0; i < this.inBo.userKanriDataGridView1.Rows.Count; i++)
            {
                if (this.inBo.userKanriDataGridView1.Rows[i].Cells["emp_id"].Value.ToString().ToIntType()
                    == this.inBo.empId.ToIntType())
                {
                    outBo.errorMessage = "既に追加されています\n";
                    return(outBo);
                }
            }

            List <UserBo> userList = new List <UserBo>();
            UserBo        user     = new UserBo();

            for (int i = 0; i < this.inBo.userKanriDataGridView1.Rows.Count; i++)
            {
                user              = new UserBo();
                user.user_id      = this.inBo.userKanriDataGridView1.Rows[i].Cells["user_id"].Value.ToString().ToIntType();
                user.emp_id       = this.inBo.userKanriDataGridView1.Rows[i].Cells["emp_id"].Value.ToString().ToIntType();
                user.user_name    = this.inBo.userKanriDataGridView1.Rows[i].Cells["user_name"].Value.ToString();
                user.kengen       = this.inBo.userKanriDataGridView1.Rows[i].Cells["kengen"].Value.ToString().ToIntType();
                user.sanka_kahi   = (bool)this.inBo.userKanriDataGridView1.Rows[i].Cells["sanka_kahi"].Value;
                user.mail_id      = common.nullAble(this.inBo.userKanriDataGridView1.Rows[i].Cells["mail_id"].Value);
                user.mail_address = common.nullAble(this.inBo.userKanriDataGridView1.Rows[i].Cells["mail_address"].Value);
                user.password     = common.nullAble(this.inBo.userKanriDataGridView1.Rows[i].Cells["password"].Value);
                user.cre_date     = common.nullAble(this.inBo.userKanriDataGridView1.Rows[i].Cells["cre_date"].Value);
                userList.Add(user);
            }

            user              = new UserBo();
            user.emp_id       = this.inBo.empId.ToIntType();
            user.user_name    = this.inBo.userName;
            user.kengen       = this.inBo.kengenSelectedIndex;
            user.sanka_kahi   = true;
            user.mail_id      = this.inBo.empId;
            user.mail_address = this.inBo.empId;
            user.password     = this.inBo.empId;
            userList.Add(user);
            outBo.userList = userList;

            return(outBo);
        }
Example #22
0
        public IActionResult SaveUserInfo([FromForm] UserModifyDto input)
        {
            var    user   = _boProvider._userInfoRepo.GetByName(input.NickName);
            UserBo userBo = _boProvider.NewBo <UserBo, UserInfo>(user);

            userBo.Save(input);
            return(Ok());
        }
        protected void btnSaveChanges_Click(object sender, EventArgs e)
        {
            AdvisorStaffBo advisorStaffBo = new AdvisorStaffBo();
            RMVo           rmvo           = new RMVo();
            UserBo         userBo         = new UserBo();

            try
            {
                if (Validation())
                {
                    rmvo.RMId = rmVo.RMId;


                    userVo.Email      = txtEmail.Text.ToString();
                    userVo.FirstName  = txtFirstName.Text.ToString();
                    userVo.LastName   = txtLastName.Text.ToString();
                    userVo.MiddleName = txtMiddleName.Text.ToString();
                    userBo.UpdateUser(userVo);

                    rmvo.Email = txtEmail.Text.ToString();
                    rmvo.Fax   = int.Parse(txtPhDirectPhoneNumber2.Text.ToString());
                    rmvo.OfficePhoneDirectNumber = int.Parse(txtPhDirectPhoneNumber.Text.ToString());
                    rmvo.OfficePhoneExtNumber    = int.Parse(txtPhDirectPhoneNumber0.Text.ToString());
                    rmvo.ResPhoneNumber          = int.Parse(txtPhDirectPhoneNumber1.Text.ToString());
                    rmvo.FaxIsd = int.Parse(txtPhDirectISD2.Text.ToString());
                    rmvo.OfficePhoneDirectIsd = txtPhDirectISD.Text.ToString();
                    rmvo.OfficePhoneExtIsd    = txtPhDirectISD0.Text.ToString();
                    rmvo.ResPhoneIsd          = int.Parse(txtPhDirectISD1.Text.ToString());
                    rmvo.FaxStd = int.Parse(txtPhDirectSTD2.Text.ToString());
                    rmvo.OfficePhoneDirectStd = txtPhDirectSTD.Text.ToString();
                    rmvo.OfficePhoneExtStd    = txtPhDirectSTD0.Text.ToString();
                    rmvo.ResPhoneStd          = int.Parse(txtPhDirectSTD1.Text.ToString());
                    rmvo.FirstName            = userVo.FirstName.ToString();
                    rmvo.LastName             = userVo.MiddleName.ToString();
                    rmvo.MiddleName           = userVo.LastName.ToString();
                    rmvo.Mobile = int.Parse(txtMobileNumber.Text.ToString());

                    advisorStaffBo.UpdateStaff(rmvo);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "RMEditProfile.ascx.cs:btnSaveChanges_Click()");
                object[] objects = new object[2];
                objects[0]   = rmVo;
                objects[1]   = userVo;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        private void LogOut()
        {
            var userBo = new UserBo();

            userBo.LogOut();

            _isFormClosing = true;
            BackToLogin();
        }
Example #25
0
 public UdaptingUser(IBL1 bl1, UserBo UserBo1)
 {
     InitializeComponent();
     bl     = bl1;
     UserBo = UserBo1;
     usernameTextBox.Text              = UserBo.Username;
     permission1ComboBox.ItemsSource   = Enum.GetValues(typeof(Permission));
     permission1ComboBox.SelectedIndex = 0;
 }
Example #26
0
        protected void ddlActionForProspect_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            int                 userId              = 0;
            UserBo              userBo              = new UserBo();
            bool                isGrpHead           = false;
            CustomerVo          customerVo          = new CustomerVo();
            CustomerPortfolioVo customerPortfolioVo = new CustomerPortfolioVo();
            PortfolioBo         portfolioBo         = new PortfolioBo();
            CustomerBo          customerBo          = new CustomerBo();
            int                 ParentId;

            if (Session[SessionContents.PortfolioId] != null)
            {
                Session.Remove(SessionContents.PortfolioId);
            }
            LinkButton lnkAction = (LinkButton)sender;
            //RadComboBox ddlAction = (RadComboBox)sender;
            GridDataItem item = (GridDataItem)lnkAction.NamingContainer;

            ParentId = int.Parse(gvLeadList.MasterTableView.DataKeyValues[item.ItemIndex]["C_CustomerId"].ToString());

            Session["ParentIdForDelete"] = ParentId;
            customerVo            = customerBo.GetCustomer(ParentId);
            Session["CustomerVo"] = customerVo;
            isGrpHead             = customerBo.CheckCustomerGroupHead(ParentId);

            //to set portfolio Id and its details
            customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(ParentId);
            //Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
            Session["customerPortfolioVo"] = customerPortfolioVo;

            Session["IsDashboard"] = "false";
            customerPortfolioVo    = portfolioBo.GetCustomerDefaultPortfolio(ParentId);
            if (customerVo.IsProspect == 0)
            {
                //Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
                //Session["customerPortfolioVo"] = customerPortfolioVo;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "RMCustomerIndividualDashboard", "loadcontrol('RMCustomerIndividualDashboard','login');", true);
            }
            else
            {
                isGrpHead = customerBo.CheckCustomerGroupHead(ParentId);
                if (isGrpHead == false)
                {
                    ParentId = customerBo.GetCustomerGroupHead(ParentId);
                }
                else
                {
                    ParentId = customerVo.CustomerId;
                }
                Session[SessionContents.FPS_ProspectList_CustomerId]     = ParentId;
                Session[SessionContents.FPS_AddProspectListActionStatus] = "View";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "loadcontrol('AddProspectList','login');", true);
                //Session[SessionContents.FPS_TreeView_Status] = "FinanceProfile";
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     SessionBo.CheckSession();
     userBo = new UserBo();
     userVo = (UserVo)Session[SessionContents.UserVo];
     if (Session["Theme"] != null)
     {
         ddlTheme.SelectedValue = Session["Theme"].ToString();
     }
 }
        public async Task <GenericResponse <IEnumerable <UserDto> > > GetList([FromBody] FilterCriteria filterCriteria)
        {
            IEnumerable <UserBo>  listBo  = null;
            IEnumerable <UserDto> listDto = null;
            ServiceResult <IEnumerable <UserBo> > resultList;
            CultureInfo enCulture = new CultureInfo("en-US");

            long organizationId = 0;

            if (filterCriteria == null)
            {
                filterCriteria = new FilterCriteria();
            }

            DictonaryFilter dictonaryFilter = filterCriteria.DictonaryBasedFilter.FirstOrDefault(x => x.Key == "organizationId");

            if (dictonaryFilter == null || !long.TryParse(dictonaryFilter.Data, out organizationId))
            {
                organizationId = 0;
            }

            if (organizationId > 0)
            {
                // Yetki kontrolü yapılıyor
                ServiceResult <bool> resultAutorized = await GetAutorizedOrganizationStatusById(organizationId);

                if (!resultAutorized.Success || !resultAutorized.Data)
                {
                    return(GenericResponse <IEnumerable <UserDto> > .Error(ResultType.Error, "Not Autorized Access!", "U_GL_01", StatusCodes.Status203NonAuthoritative));
                }
            }
            else
            {
                ServiceResult <UserBo> userDtoResult = await GetCurrentUser();

                if (!userDtoResult.Success || userDtoResult.Data == null)
                {
                    return(GenericResponse <IEnumerable <UserDto> > .Error(ResultType.Error, "User Not Found!", "U_GL_02", StatusCodes.Status404NotFound));
                }

                organizationId = userDtoResult.Data.OrganizationId;
            }

            resultList = await serviceManager.User_Service.GetListAsync(organizationId, filterCriteria);

            if (!resultList.Success || resultList.Data == null)
            {
                return(GenericResponse <IEnumerable <UserDto> > .Error(ResultType.Error, resultList.Error, "U_GL_03", StatusCodes.Status500InternalServerError));
            }

            listBo  = resultList.Data;
            listDto = listBo.Select(x => UserBo.ConvertToDto(x)).ToList();

            return(GenericResponse <IEnumerable <UserDto> > .Ok(listDto));
        }
Example #29
0
        //create User
        public TransactionStatus CreateUser(UserBo userBo)
        {
            var transactionStatus = new TransactionStatus();
            var user = BuiltUserDomain(userBo);


            CemexDb.User.Add(user);
            CemexDb.SaveChanges();

            return(transactionStatus);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SessionBo.CheckSession();
            userBo = new UserBo();
            userVo = (UserVo)Session[SessionContents.UserVo];

            BindAMCGrid();
            if (!IsPostBack)
            {
            }
        }