protected void LoadSalesCenters()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                drpdwnSalesCenterOrWarehouse.DataSource = dt;
                drpdwnSalesCenterOrWarehouse.DataValueField = "SalesCenterId";
                drpdwnSalesCenterOrWarehouse.DataTextField = "SalesCenterName";
                drpdwnSalesCenterOrWarehouse.DataBind();
                //drpdwnSalesCenterOrWarehouse.Items.Insert(0, "");
                //drpdwnSalesCenterOrWarehouse.SelectedIndex = 0;

                drpdwnSalesCenterOrWarehouse.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Joining Sales Center 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
            {
                salesCenter = null;
            }
        }
        protected void LoadSalesCenters()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                salesCenterDropDownList.DataSource = dt;
                salesCenterDropDownList.DataValueField = "SalesCenterId";
                salesCenterDropDownList.DataTextField = "SalesCenterName";
                salesCenterDropDownList.DataBind();
                salesCenterDropDownList.Items.Insert(0, "All");
                salesCenterDropDownList.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
            }
        }
        protected void LoadTransferFromToItems(string transferType)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                //if (transferType == "WH-WH")
                //{
                //    DataTable dt = warehouse.GetActiveWarehouseListByUser();

                //    transferFromDropDownList.DataSource = dt;
                //    transferFromDropDownList.DataValueField = "WarehouseId";
                //    transferFromDropDownList.DataTextField = "WarehouseName";
                //    transferFromDropDownList.DataBind();
                //    transferFromDropDownList.Items.Insert(0, "");
                //    transferFromDropDownList.SelectedIndex = 0;

                //    transferToDropDownList.DataSource = dt;
                //    transferToDropDownList.DataValueField = "WarehouseId";
                //    transferToDropDownList.DataTextField = "WarehouseName";
                //    transferToDropDownList.DataBind();
                //    transferToDropDownList.Items.Insert(0, "");
                //    transferToDropDownList.SelectedIndex = 0;
                //}
                //else 
                if (transferType == "WH-SC")
                {
                    DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                    salesCenterDropDownList.DataSource = dt;
                    salesCenterDropDownList.DataValueField = "SalesCenterId";
                    salesCenterDropDownList.DataTextField = "SalesCenterName";
                    salesCenterDropDownList.DataBind();
                    salesCenterDropDownList.Items.Insert(0, "Select Please...");
                    salesCenterDropDownList.SelectedIndex = 0;
                    salesCenterDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();


                }
                //else if (transferType == "SC-SC")
                //{
                //    DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                //    transferFromDropDownList.DataSource = dt;
                //    transferFromDropDownList.DataValueField = "SalesCenterId";
                //    transferFromDropDownList.DataTextField = "SalesCenterName";
                //    transferFromDropDownList.DataBind();
                //    transferFromDropDownList.Items.Insert(0, "");
                //    transferFromDropDownList.SelectedIndex = 0;

                //    transferToDropDownList.DataSource = dt;
                //    transferToDropDownList.DataValueField = "SalesCenterId";
                //    transferToDropDownList.DataTextField = "SalesCenterName";
                //    transferToDropDownList.DataBind();
                //    transferToDropDownList.Items.Insert(0, "");
                //    transferToDropDownList.SelectedIndex = 0;
                //}
                else if (transferType == "SC-WH")
                {


                    DataTable dt = warehouse.GetActiveWarehouseListByUser();


                    salesCenterDropDownList.DataSource = dt;
                    salesCenterDropDownList.DataValueField = "WarehouseId";
                    salesCenterDropDownList.DataTextField = "WarehouseName";
                    salesCenterDropDownList.DataBind();
                    salesCenterDropDownList.Items.Insert(0, "Select Please...");
                    salesCenterDropDownList.SelectedIndex = 0;
                    salesCenterDropDownList.SelectedValue = LumexSessionManager.Get("UserWareHouseId").ToString();

                }
                else
                {
                    salesCenterDropDownList.Items.Clear();

                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }
        protected void LoadTransferFromToItems(string transferType)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (transferType == "WH-WH")
                {
                    DataTable dt = warehouse.GetActiveWarehouseListByUser();

                    transferFromDropDownList.DataSource = dt;
                    transferFromDropDownList.DataValueField = "WarehouseId";
                    transferFromDropDownList.DataTextField = "WarehouseName";
                    transferFromDropDownList.DataBind();
                    transferFromDropDownList.Items.Insert(0, "");
                    transferFromDropDownList.SelectedIndex = 0;

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "WarehouseId";
                    transferToDropDownList.DataTextField = "WarehouseName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                    transferToDropDownList.SelectedIndex = 0;
                }
                else if (transferType == "WH-SC")
                {
                    DataTable dt1 = warehouse.GetActiveWarehouseListByUser();

                    transferFromDropDownList.DataSource = dt1;
                    transferFromDropDownList.DataValueField = "WarehouseId";
                    transferFromDropDownList.DataTextField = "WarehouseName";
                    transferFromDropDownList.DataBind();
                    transferFromDropDownList.Items.Insert(0, "");
                    transferFromDropDownList.SelectedIndex = 0;

                    DataTable dt2 = salesCenter.GetActiveSalesCenterListByUser();

                    transferToDropDownList.DataSource = dt2;
                    transferToDropDownList.DataValueField = "SalesCenterId";
                    transferToDropDownList.DataTextField = "SalesCenterName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                    transferToDropDownList.SelectedIndex = 0;
                }
                else if (transferType == "SC-SC")
                {
                    DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                    transferFromDropDownList.DataSource = dt;
                    transferFromDropDownList.DataValueField = "SalesCenterId";
                    transferFromDropDownList.DataTextField = "SalesCenterName";
                    transferFromDropDownList.DataBind();
                    transferFromDropDownList.Items.Insert(0, "");
                    transferFromDropDownList.SelectedIndex = 0;

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "SalesCenterId";
                    transferToDropDownList.DataTextField = "SalesCenterName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                    transferToDropDownList.SelectedIndex = 0;
                }
                else if (transferType == "SC-WH")
                {
                    DataTable dt1 = salesCenter.GetActiveSalesCenterListByUser();

                    transferFromDropDownList.DataSource = dt1;
                    transferFromDropDownList.DataValueField = "SalesCenterId";
                    transferFromDropDownList.DataTextField = "SalesCenterName";
                    transferFromDropDownList.DataBind();
                    transferFromDropDownList.Items.Insert(0, "");
                    transferFromDropDownList.SelectedIndex = 0;

                    DataTable dt2 = warehouse.GetActiveWarehouseListByUser();

                    transferToDropDownList.DataSource = dt2;
                    transferToDropDownList.DataValueField = "WarehouseId";
                    transferToDropDownList.DataTextField = "WarehouseName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                    transferToDropDownList.SelectedIndex = 0;
                }
                else
                {
                    transferFromDropDownList.Items.Clear();
                    transferToDropDownList.Items.Clear();
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }