예제 #1
0
        protected void GetProductGroupById(string productGroupId)
        {
            ProductGroupBLL productGroup = new ProductGroupBLL();

            try
            {
                DataTable dt = productGroup.GetProductGroupById(productGroupId);

                if (dt.Rows.Count > 0)
                {
                    productGroupNameLabel.Text = dt.Rows[0]["ProductGroupName"].ToString();
                    descriptionLabel.Text = dt.Rows[0]["Description"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Product Group 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
            {
                productGroup = null;
            }
        }
예제 #2
0
        //protected void LoadSalesCenter()
        //{
        //    SalesCenterBLL warehouse = new SalesCenterBLL();

        //    try
        //    {
        //        DataTable dt = warehouse.GetActiveSalesCenterListByUser();

        //        salescenterDropDownList.DataSource = dt;
        //        salescenterDropDownList.DataValueField = "SalesCenterId";
        //        salescenterDropDownList.DataTextField = "SalesCenterName";
        //        salescenterDropDownList.DataBind();
        //        salescenterDropDownList.Items.Insert(0, "For all Sales Center");
        //        salescenterDropDownList.SelectedIndex = 0;

        //          salescenterDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();

        //        salescenterDropDownList.Items[0].Value = "A";

        //    }
        //    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 GetProductGroupById(string productGroupId)
        {
            ProductGroupBLL productGroup = new ProductGroupBLL();

            try
            {
                DataTable dt = productGroup.GetProductGroupById(productGroupId);

                if (dt.Rows.Count > 0)
                {
                    productGroupNameForUpdateHiddenField.Value = productGroupNameTextBox.Text = dt.Rows[0]["ProductGroupName"].ToString();
                    descriptionTextBox.Text = dt.Rows[0]["Description"].ToString();
                    ListItem listItem = new ListItem();
                    listItem = warehouseDropDownList.Items.FindByValue(dt.Rows[0]["WareHouse"].ToString());

                    if (listItem != null)
                    {
                        warehouseDropDownList.SelectedValue = dt.Rows[0]["WareHouse"].ToString();
                    }
                    else
                    {
                        warehouseDropDownList.Items.Insert(0, "Not Parmitted");
                        warehouseDropDownList.Items[0].Value = dt.Rows[0]["WareHouse"].ToString();
                        warehouseDropDownList.SelectedIndex = 0;
                        warehouseDropDownList.Enabled = false;
                        updateButton.Enabled = false;
                    }
                    //listItem = salescenterDropDownList.Items.FindByValue(dt.Rows[0]["SalesCenter"].ToString());
                    //if (listItem != null)
                    //{
                    //    salescenterDropDownList.SelectedValue = dt.Rows[0]["SalesCenter"].ToString();
                    //}
                    //else
                    //{
                    //    salescenterDropDownList.Items.Insert(0, "Not Parmitted");
                    //    salescenterDropDownList.Items[0].Value = dt.Rows[0]["SalesCenter"].ToString();
                    //    salescenterDropDownList.SelectedIndex = 0;
                    //    salescenterDropDownList.Enabled = false;
                    //    updateButton.Enabled = false;
                    //}
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Product Group 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
            {
                productGroup = null;
            }
        }