Пример #1
0
        protected void LoadWarehouses()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetActiveWarehouseListByUser();

                warehouseDropDownList.DataSource = dt;
                warehouseDropDownList.DataValueField = "WarehouseId";
                warehouseDropDownList.DataTextField = "WarehouseName";
                warehouseDropDownList.DataBind();
                warehouseDropDownList.Items.Insert(0, "");
                //warehouseDropDownList.SelectedIndex = 0;
                //warehouseDropDownList.Items[0].Value = "A";
                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;
            }
        }
Пример #2
0
        public DataTable SaveWarehouse(WarehouseBLL warehouse, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@WarehouseName", warehouse.WarehouseName.Trim());
                db.AddParameters("@Address", warehouse.Address.Trim());
                db.AddParameters("@Country", warehouse.Country.Trim());
                db.AddParameters("@City", warehouse.City.Trim());
                db.AddParameters("@District", warehouse.District.Trim());
                db.AddParameters("@PostalCode", warehouse.PostalCode.Trim());
                db.AddParameters("@Phone", warehouse.Phone.Trim());
                db.AddParameters("@Mobile", warehouse.Mobile.Trim());
                db.AddParameters("@Fax", warehouse.Fax.Trim());
                db.AddParameters("@Email", warehouse.Email.Trim());
                db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal());

                DataTable dt = db.ExecuteDataTable("INSERT_WAREHOUSE", true);
                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                warehouse = null;
            }
        }
Пример #3
0
        private void LoadWareHouses()
        {

            WarehouseBLL warehouseBll = new WarehouseBLL();

            try
            {
                DataTable dt = warehouseBll.GetActiveWarehouseListByUser();

                WarehouesDropDownList.DataSource = dt;
                WarehouesDropDownList.DataValueField = "WarehouseId";
                WarehouesDropDownList.DataTextField = "WarehouseName";
                WarehouesDropDownList.DataBind();
                WarehouesDropDownList.Items.Insert(0, "");
                //WarehouesDropDownList.Items[0].Value = "";
                //WarehouesDropDownList.SelectedIndex = 0;
                WarehouesDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                warehouseBll = null;
            }
        }
Пример #4
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (warehouseNameTextBox.Text == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Business Name field is required.";
                }
                else if (addressTextBox.Text == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Address field is required.";
                }
                else
                {
                    warehouse.WarehouseName = warehouseNameTextBox.Text.Trim();
                    warehouse.Address = addressTextBox.Text.Trim();
                    warehouse.Country = countryTextBox.Text.Trim();
                    warehouse.City = cityTextBox.Text.Trim();
                    warehouse.District = districtTextBox.Text.Trim();
                    warehouse.PostalCode = postalCodeTextBox.Text.Trim();
                    warehouse.Phone = phoneTextBox.Text.Trim();
                    warehouse.Mobile = mobileTextBox.Text.Trim();
                    warehouse.Fax = faxTextBox.Text.Trim();
                    warehouse.Email = emailTextBox.Text.Trim();

                    if (!warehouse.CheckDuplicateWarehouse(warehouse.WarehouseName.Trim()))
                    {
                        DataTable dt = warehouse.SaveWarehouse();

                        if (dt.Rows.Count > 0)
                        {
                            string message = "Business <span class='actionTopic'>Created</span> Successfully with Business ID: <span class='actionTopic'>" + dt.Rows[0][0].ToString() + "</span>.";
                            MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/business/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                        }
                        else
                        {
                            string message = "<span class='actionTopic'>Failed</span> to Create Business.";
                            MyAlertBox("ErrorAlert(\"" + "Process Failed" + "\", \"" + message + "\");");
                        }
                    }
                    else
                    {
                        string message = "This Business <span class='actionTopic'>already exist</span>, try another one.";
                        MyAlertBox("WarningAlert(\"" + "Data Duplicate" + "\", \"" + message + "\");");
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
            }
        }
        protected void GetWarehouseList()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetWarehouseList();

                if (dt.Rows.Count > 0)
                {
                    warehouseListListBox.Items.Clear();

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        warehouseListListBox.Items.Add(new ListItem(dt.Rows[i]["WarehouseName"].ToString(), dt.Rows[i]["WarehouseId"].ToString()));
                    }
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Business List 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
            {
                warehouse = null;
                countWarehouseLabel.Text = "Total: " + warehouseListListBox.Items.Count.ToString();
            }
        }
Пример #6
0
        protected void GetWarehouseList()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetWarehouseList();
                warehouseListGridView.DataSource = dt;
                warehouseListGridView.DataBind();

                if (warehouseListGridView.Rows.Count > 0)
                {
                    warehouseListGridView.UseAccessibleHeader = true;
                    warehouseListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Warehouse List 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
            {
                warehouse = null;
            }
        }
        protected void LoadWarehouses()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetActiveWarehouseList();

                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)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                warehouse = null;
            }
        }
Пример #8
0
        protected void LoadWarehouses()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetActiveWarehouseListByUser();

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



            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
            }
        }
Пример #9
0
        protected void btnNotificationLimit_Click(object sender, EventArgs e)
        {
            try
            {
                WarehouseBLL warehouseBll = new WarehouseBLL();

                warehouseBll.StockLimit = txtNotification.Text;
                // salesCenter.SalesCenterId = 
                bool status = warehouseBll.UpdateWareHouseNotificationLimit();
                if (status)
                {
                    string message = "Sales Center <span class='actionTopic'>Stock Margin</span> Successfully Updated";
                    MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");");
                }
                else
                {
                    string message = "<span class='actionTopic'>Failed</span> to Update Sales Center Stock.";
                    MyAlertBox("ErrorAlert(\"" + "Process Failed" + "\", \"" + message + "\");");
                }
            }
            catch (Exception ex)
            {

                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");

            }
        }
Пример #10
0
        private void LoadWarehouse()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetActiveWarehouseListByUser();

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

                salesCenterDropDownList.SelectedValue = LumexSessionManager.Get("UserWarehouseId").ToString();
                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Joining Warehouse  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 + "\", \"\");");
            }
        }
        protected void LoadSCWH()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();
            DataTable dt = new DataTable();

            try
            {
                //if (reportTypeDropDownList.SelectedValue == "Sales Center")
                //{
                //    dt = salesCenter.GetActiveSalesCenterListByUser();

                //    SCWHDropDownList.DataSource = dt;
                //    SCWHDropDownList.DataValueField = "SalesCenterId";
                //    SCWHDropDownList.DataTextField = "SalesCenterName";
                //    SCWHDropDownList.DataBind();
                //    SCWHDropDownList.Items.Insert(0, "All");
                //    SCWHDropDownList.Items[0].Value = "All";
                //    SCWHDropDownList.SelectedIndex = 0;
                //}
                
                
                    dt = warehouse.GetActiveWarehouseListByUser();

                    SCWHDropDownList.DataSource = dt;
                    SCWHDropDownList.DataValueField = "WarehouseId";
                    SCWHDropDownList.DataTextField = "WarehouseName";
                    SCWHDropDownList.DataBind();
                    SCWHDropDownList.Items.Insert(0, "All");
                    SCWHDropDownList.Items[0].Value = "All";
                    SCWHDropDownList.SelectedIndex = 0;
                

                //SCWHDropDownList.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;
                warehouse = null;
            }
        }
Пример #12
0
        protected void deletedListButton_Click(object sender, EventArgs e)
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (fromDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()) == "False")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date From field is required.";
                }
                else if (toDateTextBox.Text.Trim() == "" || LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()) == "False")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Date To field is required.";
                }
                else
                {
                    string fromDate = LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim());
                    string toDate = LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim());

                    DataTable dt = warehouse.GetDeletedWarehouseListByDateRangeAll(fromDate, toDate, "");

                    deletedListGridView.DataSource = dt;
                    deletedListGridView.DataBind();

                    if (deletedListGridView.Rows.Count > 0)
                    {
                        deletedListGridView.UseAccessibleHeader = true;
                        deletedListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                    }
                    else
                    {
                        msgbox.Visible = true; msgTitleLabel.Text = "Deleted Warehouse List Data Not Found!!!"; msgDetailLabel.Text = "";
                        msgbox.Attributes.Add("class", "alert alert-info");
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
                MyAlertBox("MyOverlayStop();");
            }
        }
Пример #13
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();
            }
        }
        protected void LoadTransferToItems(string transferDestination)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (transferDestination == "WH")
                {
                    DataTable dt = warehouse.GetActiveWarehouseList();

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "WarehouseId";
                    transferToDropDownList.DataTextField = "WarehouseName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                }
                else if (transferDestination == "SC")
                {
                    DataTable dt = salesCenter.GetActiveSalesCenterList();

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "SalesCenterId";
                    transferToDropDownList.DataTextField = "SalesCenterName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                }
                else
                {
                    transferToDropDownList.Items.Clear();
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }
Пример #15
0
        public string SaveProductRequisition(List<ProductRequisitionBLL> productRequisitions, string salesCenterId, string warehouseid, string requisationType, string narration)
        {
            ProductRequisitionDAL productRequisition = new ProductRequisitionDAL();
            WarehouseBLL salesCenter = new WarehouseBLL();
            try
            {

                LumexDBPlayer db = LumexDBPlayer.Start(true);
                string productRequisitionId = productRequisition.SaveProductRequisition(productRequisitions, salesCenterId, warehouseid, requisationType, narration, db);
                db.Stop();

                return productRequisitionId;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                productRequisition = null;
            }
        }
Пример #16
0
        protected void GetWarehouseById(string warehouseId)
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetWarehouseById(warehouseId);

                if (dt.Rows.Count > 0)
                {
                    warehouseNameLabel.Text = dt.Rows[0]["WarehouseName"].ToString();
                    countryLabel.Text = dt.Rows[0]["Country"].ToString();
                    cityLabel.Text = dt.Rows[0]["City"].ToString();
                    districtLabel.Text = dt.Rows[0]["District"].ToString();
                    postalCodeLabel.Text = dt.Rows[0]["PostalCode"].ToString();
                    phoneLabel.Text = dt.Rows[0]["Phone"].ToString();
                    mobileLabel.Text = dt.Rows[0]["Mobile"].ToString();
                    faxLabel.Text = dt.Rows[0]["Fax"].ToString();
                    emailLabel.Text = dt.Rows[0]["Email"].ToString();
                    addressLabel.Text = dt.Rows[0]["Address"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Warehouse 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
            {
                warehouse = null;
            }
        }
Пример #17
0
        public void UpdateWarehouse(WarehouseBLL warehouse, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@WarehouseId", warehouse.WarehouseId.Trim());
                db.AddParameters("@WarehouseName", warehouse.WarehouseName.Trim());
                db.AddParameters("@Address", warehouse.Address.Trim());
                db.AddParameters("@Country", warehouse.Country.Trim());
                db.AddParameters("@City", warehouse.City.Trim());
                db.AddParameters("@District", warehouse.District.Trim());
                db.AddParameters("@PostalCode", warehouse.PostalCode.Trim());
                db.AddParameters("@Phone", warehouse.Phone.Trim());
                db.AddParameters("@Mobile", warehouse.Mobile.Trim());
                db.AddParameters("@Fax", warehouse.Fax.Trim());
                db.AddParameters("@Email", warehouse.Email.Trim());
                db.AddParameters("@ModifiedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@ModifiedFrom", LumexLibraryManager.GetTerminal());

                db.ExecuteNonQuery("UPDATE_WAREHOUSE_BY_ID", true);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                warehouse = null;
            }
        }
Пример #18
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            WarehouseBLL warehouse = new WarehouseBLL();
            List<string> warehouses = new List<string>();

            try
            {
                for (int i = 0; i < userWarehouseListListBox.Items.Count; i++)
                {
                    warehouses.Add(userWarehouseListListBox.Items[i].Value.Trim());
                }

                warehouse.SaveUserWarehousesByUserId(userIdLabel.Text.Trim(), warehouses);

                string message = "User's Business List <span class='actionTopic'>Saved</span> Successfully.";
                MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/UserPrivilege/PrivilegeUserList.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
                warehouses = null;
            }
        }
Пример #19
0
        protected void activateLinkButton_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton lnkBtn = (LinkButton)sender;
                GridViewRow row = (GridViewRow)lnkBtn.NamingContainer;

                WarehouseBLL warehouse = new WarehouseBLL();
                warehouse.UpdateWarehouseActivation(warehouseListGridView.Rows[row.RowIndex].Cells[0].Text.ToString(), "True");

                warehouseListGridView.Rows[row.RowIndex].Cells[3].Text = "True";
                string message = "Warehouse <span class='actionTopic'>Activated</span> Successfully.";
                MyAlertBox("SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");");
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
        }
Пример #20
0
        //protected void drpdwnReportOn_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        if (drpdwnReportOn.SelectedIndex == 0)
        //        {
        //            drpdwnSalesCenterOrWarehouse.Items.Clear();
        //            LoadSalesCenters();
        //            titleSalesCenterOrWarehouse.Text = "Sales Center";
        //        }
        //        else if (drpdwnReportOn.SelectedIndex == 1)
        //        {
        //            drpdwnSalesCenterOrWarehouse.Items.Clear();
        //            LoadWarehouse();
        //            titleSalesCenterOrWarehouse.Text = "Warehouse";
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        string message = ex.Message;
        //        if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
        //        MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
        //    }
        //}

        private void LoadWarehouse()
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                DataTable dt = warehouse.GetActiveWarehouseListByUser();

                drpdwnSalesCenterOrWarehouse.DataSource = dt;
                drpdwnSalesCenterOrWarehouse.DataTextField = "WarehouseName";
                drpdwnSalesCenterOrWarehouse.DataValueField = "WarehouseId";
                drpdwnSalesCenterOrWarehouse.DataBind();
                drpdwnSalesCenterOrWarehouse.Items.Insert(0, "");
                //drpdwnSalesCenterOrWarehouse.SelectedIndex = 0;
                drpdwnSalesCenterOrWarehouse.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 + "\", \"\");");
            }
        }
        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;
            }
        }
Пример #22
0
        protected void updateButton_Click(object sender, EventArgs e)
        {
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (warehouseIdForUpdateHiddenField.Value.Trim() == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = "Warehouse not found to update.";
                }
                else if (warehouseNameTextBox.Text == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Warehouse Name field is required.";
                }
                else if (emailTextBox.Text == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Email field is required.";
                }
                else if (addressTextBox.Text == "")
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Address field is required.";
                }
                else
                {
                    warehouse.WarehouseId = warehouseIdForUpdateHiddenField.Value.Trim();
                    warehouse.WarehouseName = warehouseNameTextBox.Text.Trim();
                    warehouse.Address = addressTextBox.Text.Trim();
                    warehouse.Country = countryTextBox.Text.Trim();
                    warehouse.City = cityTextBox.Text.Trim();
                    warehouse.District = districtTextBox.Text.Trim();
                    warehouse.PostalCode = postalCodeTextBox.Text.Trim();
                    warehouse.Phone = phoneTextBox.Text.Trim();
                    warehouse.Mobile = mobileTextBox.Text.Trim();
                    warehouse.Fax = faxTextBox.Text.Trim();
                    warehouse.Email = emailTextBox.Text.Trim();

                    if (!warehouse.CheckDuplicateWarehouse(warehouseNameTextBox.Text.Trim()))
                    {
                        warehouse.UpdateWarehouse();

                        warehouseNameForUpdateHiddenField.Value = "";
                        warehouseIdForUpdateHiddenField.Value = "";

                        string message = "Warehouse <span class='actionTopic'>Updated</span> Successfully.";
                        MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/business/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                    }
                    else
                    {
                        if (warehouseNameForUpdateHiddenField.Value == warehouseNameTextBox.Text.Trim())
                        {
                            warehouse.WarehouseName = "WithOut";
                            warehouse.UpdateWarehouse();

                            warehouseNameForUpdateHiddenField.Value = "";
                            warehouseIdForUpdateHiddenField.Value = "";

                            string message = "Warehouse <span class='actionTopic'>Updated</span> Successfully.";
                            MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/business/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                        }
                        else
                        {
                            string message = "This Warehouse <span class='actionTopic'>already exist</span>, try another one.";
                            MyAlertBox("WarningAlert(\"" + "Data Duplicate" + "\", \"" + message + "\");");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                warehouse = null;
            }
        }
Пример #23
0
        protected void getStockLimit()
        {
            try
            {
                WarehouseBLL warehouseBll = new WarehouseBLL();
                DataTable dt = warehouseBll.getStockNotificationLimit();
                if (dt.Rows.Count > 0)
                {
                    txtNotification.Text = dt.Rows[0][0].ToString();
                }
                else
                {
                    txtNotification.Text = "0";
                }
            }
            catch (Exception ex)
            {

                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");

            }
        }
Пример #24
0
        protected void drpdwnWarehoseName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                WarehouseBLL warehouseBll = new WarehouseBLL();
                DataTable dt = warehouseBll.getAvailableProductListbyWarehouseIdforStock(drpdwnWarehoseName.SelectedValue);
                gridviewwarehouseStock.DataSource = dt;
                gridviewwarehouseStock.DataBind();

                if (dt.Rows.Count < 0)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Product List Not Found for this Warehouse!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }

                if (gridviewwarehouseStock.Rows.Count > 0)
                {
                    gridviewwarehouseStock.UseAccessibleHeader = true;
                    gridviewwarehouseStock.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }

        }
Пример #25
0
 internal DataTable UpdateWareHouseNotificationLimit(WarehouseBLL warehouseBLL, LumexDBPlayer db)
 {
     try
     {
         db.AddParameters("@Value", warehouseBLL.StockLimit);
         db.AddParameters("@Key", "WSL");
         DataTable dt = db.ExecuteDataTable("UPDATE_APP_SETTING_BY_KEY", true);
         return dt;
     }
     catch (Exception)
     {
         throw;
     }
 }