protected void LoadUserInfoAndSalesCenterList(string userId)
        {
            UserBLL user = new UserBLL();
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);

                if (dt.Rows.Count > 0)
                {
                    userIdLabel.Text = dt.Rows[0]["UserId"].ToString();
                    userNameLabel.Text = dt.Rows[0]["UserName"].ToString();
                    employeeIdLabel.Text = dt.Rows[0]["EmployeeId"].ToString();
                    userGroupNameLabel.Text = dt.Rows[0]["UserGroupName"].ToString();
                    activeStatusLabel.Text = dt.Rows[0]["IsActive"].ToString();

                    userSalesCenterListListBox.Items.Clear();
                    DataTable dtSalesCenter = salesCenter.GetUserSalesCentersByUserId(userIdLabel.Text.Trim());

                    for (int i = 0; i < dtSalesCenter.Rows.Count; i++)
                    {
                        userSalesCenterListListBox.Items.Add(new ListItem(dtSalesCenter.Rows[i]["SalesCenterName"].ToString(), dtSalesCenter.Rows[i]["SalesCenterId"].ToString()));
                    }

                    userPriviligePane.Visible = true;
                }
                else
                {
                    userPriviligePane.Visible = false;
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
                salesCenter = null;
                countUserSalesCenterLabel.Text = "Total: " + userSalesCenterListListBox.Items.Count.ToString();
            }
        }
        protected void GetUserById(string userId)
        {
            UserBLL user = new UserBLL();

            try
            {
                DataTable dt = new DataTable();
                if (userId != "developer" || userId != "Developer")
                {
                    dt = user.GetUserById(userId);
                }
                if (dt.Rows.Count > 0)
                {
                    userIdLabel.Text = dt.Rows[0]["UserId"].ToString();
                    userNameLabel.Text = dt.Rows[0]["UserName"].ToString();
                    //employeeIdLabel.Text = dt.Rows[0]["EmployeeId"].ToString();
                    userGroupLabel.Text = dt.Rows[0]["UserGroupName"].ToString();
                    contactNumberLabel.Text = dt.Rows[0]["ContactNumber"].ToString();

                    actionPane.Visible = true;
                }
                else
                {
                    actionPane.Visible = false;
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
                MyAlertBox("MyOverlayStop();");
            }
        }
Пример #3
0
        protected void GetUserById(string userId)
        {
            UserBLL user = new UserBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);

                if (dt.Rows.Count > 0)
                {
                    userIdLabel.Text = dt.Rows[0]["UserId"].ToString();
                    userNameLabel.Text = dt.Rows[0]["UserName"].ToString();
                    employeeIdLabel.Text = dt.Rows[0]["EmployeeId"].ToString();
                    departmentLabel.Text = dt.Rows[0]["Department"].ToString();
                    designationLabel.Text = dt.Rows[0]["Designation"].ToString();
                    addressLabel.Text = dt.Rows[0]["Address"].ToString();
                    contactNumberLabel.Text = dt.Rows[0]["ContactNumber"].ToString();
                    emailLabel.Text = dt.Rows[0]["Email"].ToString();
                    nationalIdLabel.Text = dt.Rows[0]["NationalId"].ToString();
                    passportNumberLabel.Text = dt.Rows[0]["PassportNumber"].ToString();
                    userGroupLabel.Text = dt.Rows[0]["UserGroupName"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
            }
        }
Пример #4
0
        private void getUserById(string userId)
        {
            UserBLL user = new UserBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);
                lblUserId.Text = dt.Rows[0]["UserId"].ToString();
                lblUserName.Text = dt.Rows[0]["UserName"].ToString();
                lblUserGroup.Text = dt.Rows[0]["UserGroupName"].ToString();
                lblContactNumber.Text = dt.Rows[0]["ContactNumber"].ToString();
                lblEmail.Text = dt.Rows[0]["Email"].ToString(); ;
                lblAddress.Text = dt.Rows[0]["Address"].ToString();
                //lblSalesCenterName.Text = dt.Rows[0]["SalesCenterName"].ToString();
                lblWarehouseName.Text = dt.Rows[0]["WareHouseName"].ToString();

                if (dt.Rows[0]["IsActive"].ToString() == "True")
                {
                    lblStatus.Text = "Active";
                    lblStatus.CssClass = "bold text-success";
                }
                else
                {
                    lblStatus.Text = "Deactive";
                    lblStatus.CssClass = "bold text-error";
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " Sorry Somthing going worng to get User. Try later!! "; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
            }
        }
Пример #5
0
        protected void LoadUserInfo(string userId)
        {
            UserBLL user = new UserBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);

                if (dt.Rows.Count > 0)
                {
                    userIdLabel.Text = dt.Rows[0]["UserId"].ToString();
                    userNameLabel.Text = dt.Rows[0]["UserName"].ToString();
                    employeeIdLabel.Text = dt.Rows[0]["EmployeeId"].ToString();
                    userGroupNameLabel.Text = dt.Rows[0]["UserGroupName"].ToString();
                    activeStatusLabel.Text = dt.Rows[0]["IsActive"].ToString();

                    userPriviligePane.Visible = true;
                }
                else
                {
                    userPriviligePane.Visible = false;
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
            }
        }
Пример #6
0
        protected void unlockButton_Click(object sender, EventArgs e)
        {
            UserBLL user = new UserBLL();

            try
            {
                // user.UserId = userIdLockTextBox.Text.Trim();
                // user.Password = passwordLockTextBox.Text.Trim();

                if (user.ValidateUser() && user.UserId == LumexSessionManager.Get("ActiveUserId").ToString())
                {
                    DataTable dt = user.GetUserById(user.UserId);

                    if (dt.Rows[0]["IsActive"].ToString() == "True" && dt.Rows[0]["IsUserGroupActive"].ToString() == "True")
                    {
                        //        screenLock.Visible = false;
                        //      main.Visible = true;

                        if (Session["ScreenLockURL"] != null)
                        {
                            LumexSessionManager.Remove("ScreenLockURL");
                        }

                        if (Session["ScreenLock"] != null)
                        {
                            LumexSessionManager.Remove("ScreenLock");
                        }
                    }
                    else
                    {
                        //  screenStatusLabel.Text = "User Access Denied!!!";
                    }
                }
                else
                {
                    // screenStatusLabel.Text = "Invalid User or Password";
                }
            }
            catch (Exception)
            {
                LumexSessionManager.RemoveAll();
                Response.Redirect("~/Login.aspx", false);
            }
            finally
            {
                user = null;
            }
        }
Пример #7
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            UserBLL user = new UserBLL();

            try
            {
                user.UserId = txtbxUserName.Text.Trim();
                user.Password = txtbxPass.Text.Trim();

                if (user.ValidateUser())
                {
                    DataTable dt = user.GetUserById(user.UserId);

                    if (dt.Rows[0]["IsActive"].ToString() == "True" && dt.Rows[0]["IsUserGroupActive"].ToString() == "True")
                    {
                        LumexSessionManager.Add("ActiveUserId", dt.Rows[0]["UserId"].ToString());
                        LumexSessionManager.Add("ActiveUserName", dt.Rows[0]["UserName"].ToString());
                        LumexSessionManager.Add("isMenu", "N");
                        LumexSessionManager.Add("ActiveMenuFor", "inv");
                       
                        LumexSessionManager.Add("ScreenLock", "False");
                        LumexSessionManager.Add("ScreenLock", "False");
                        LumexSessionManager.Add("UserSalesCenterId", dt.Rows[0]["SalesCenterId"].ToString());
                        LumexSessionManager.Add("UserWareHouseId", dt.Rows[0]["WarehouseId"].ToString());
                        LumexSessionManager.Add("UserGroupId", dt.Rows[0]["UserGroupId"].ToString());


                        Response.Redirect("~/Default.aspx");
                    }
                    else
                    {
                        lblnotify.Text = "User Access Denied!!!";
                    }
                }
                else
                {
                    lblnotify.Text = "Invalid User or Password";
                }
                //if (txtbxUserName.Text != "" && txtbxPass.Text != "")
                //{
                //    UserLogin user = new UserLogin();
                //    user.UserId = txtbxUserName.Text.Trim();
                //    user.Password = txtbxPass.Text.Trim();


                //    if (user.ValidateUser(user))
                //    {

                //        LumexSessionManager.Add("ActiveUserId", user.UserId);
                //        LumexSessionManager.Add("ActiveUserName", user.UserName);
                //        LumexSessionManager.Add("ScreenLock", "False");
                //        LumexSessionManager.Add("UserDasignation", user.Designation);

                //        Response.Redirect("~/Default.aspx");
                //        //statusLabel.Text = "Invalid User or Password";
                //    }
                //    else
                //    {
                //        lblnotify.Text = "Invalid User or Password";
                //    }
                // }
                //else
                //{
                //    lblnotify.Text = "Enter UserID or Password";
                //}

            }
            catch (Exception ex)
            {
                lblnotify.Text = ex.Message;
            }
            finally
            {
                //     user = null;
            }
        }
Пример #8
0
        protected void GetUserById(string userId)
        {
            UserBLL user = new UserBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);

                if (dt.Rows.Count > 0)
                {
                    userIdTextBox.Text = dt.Rows[0]["UserId"].ToString();
                    userNameTextBox.Text = dt.Rows[0]["UserName"].ToString();
                    //  employeeIdTextBox.Text = dt.Rows[0]["EmployeeId"].ToString();
                    //  salesCenterDropDownList.SelectedValue = "";//dt.Rows[0]["SalesCenterId"].ToString();
                    warehouseDropDownList.SelectedValue = dt.Rows[0]["WarehouseId"].ToString();
                    //   designationTextBox.Text = dt.Rows[0]["Designation"].ToString();
                    addressTextBox.Text = dt.Rows[0]["Address"].ToString();
                    contactNumberTextBox.Text = dt.Rows[0]["ContactNumber"].ToString();
                    emailTextBox.Text = dt.Rows[0]["Email"].ToString();

                    //  nationalIdTextBox.Text = dt.Rows[0]["NationalId"].ToString();
                    // passportNumberTextBox.Text = dt.Rows[0]["PassportNumber"].ToString();
                    userGroupDropDownList.SelectedValue = dt.Rows[0]["UserGroupId"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
            }
        }