protected void GetActiveProducts()
        {
            ProductBLL product = new ProductBLL();

            try
            {
                DataTable dt = new DataTable();

                //if (ddlWHorSC.SelectedValue == "SC")
                //{
                //    dt = product.GetAllProductsBySalesCenter(ddlSelectWareHouseOrSalesCenter.SelectedValue);
                //}
                //else
                //{
                product.WareHouseId = ddlSelectWareHouseOrSalesCenter.SelectedValue;
                dt = product.GetMainProductsByWareHouseForSales();

                //}
                productListGridView.DataSource = dt;
                productListGridView.DataBind();

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = "";
                    productListGridView.DataSource = "";
                    productListGridView.DataBind();
                }
                if (productListGridView.Rows.Count > 0)
                {
                    productListGridView.UseAccessibleHeader = true;
                    productListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");

            }
            finally
            {
                product = null;
            }
        }
Exemplo n.º 2
0
        protected void GetAvailableProductListBySalesCenter()
        {
            ProductBLL product = new ProductBLL();

            try
            {

                DataTable dt = new DataTable();
                product.WareHouseId = ddlSelectWareHouseOrSalesCenter.SelectedValue;
                if (ddlSelectWareHouseOrSalesCenter.SelectedValue == "WH-002")
                {
                    dt = product.GetMainProductsByWareHouseForSales();
                    saveButton.Text = "CREATE NEW SALES";
                }
                else
                {
                    dt = product.GetAllProductsBySalesCenter(ddlSelectWareHouseOrSalesCenter.SelectedValue);
                    saveButton.Text = "CREATE NEW SALES";
                }
                if (dt.Rows.Count > 0)
                {
                    productListGridView.DataSource = dt;
                    productListGridView.DataBind();
                }
                else
                {
                    productListGridView.DataSource = dt;
                    productListGridView.DataBind();

                }
                if (productListGridView.Rows.Count > 0)
                {
                    productListGridView.UseAccessibleHeader = true;
                    productListGridView.HeaderRow.TableSection = TableRowSection.TableHeader;
                }


                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Products are not available for the selected Sales Center!!!"; msgDetailLabel.Text = "";
                }

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