Ejemplo n.º 1
0
        protected void LoadWarehouses()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetUserWarehousesByUserId((string)LumexSessionManager.Get("ActiveUserId"));

                warehouseDropDownList.DataSource = dt;
                warehouseDropDownList.DataValueField = "WarehouseId";
                warehouseDropDownList.DataTextField = "WarehouseName";
                warehouseDropDownList.DataBind();
                //warehouseDropDownList.Items.Insert(0, "");
                //warehouseDropDownList.SelectedIndex = 0;
                warehouseDropDownList.SelectedValue = LumexSessionManager.Get("UserWareHouseId").ToString();
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
            }
        }
Ejemplo n.º 2
0
        protected void LoadUserInfoAndWarehouseList(string userId)
        {
            UserBLL user = new UserBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            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();

                    userWarehouseListListBox.Items.Clear();
                    DataTable dtWarehouse = warehouse.GetUserWarehousesByUserId(userIdLabel.Text.Trim());

                    for (int i = 0; i < dtWarehouse.Rows.Count; i++)
                    {
                        userWarehouseListListBox.Items.Add(new ListItem(dtWarehouse.Rows[i]["WarehouseName"].ToString(), dtWarehouse.Rows[i]["WarehouseId"].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;
                warehouse = null;
                countUserWarehouseLabel.Text = "Total: " + userWarehouseListListBox.Items.Count.ToString();
            }
        }