Ejemplo n.º 1
0
 protected void ClearItemData(bool NewItem)
 {
     // if NewItem is true, we are clearing after an item is entered
     BOMGridView.DataBind();
     DetailUpdatePanel.Update();
     ItemDescLabel.Text  = "";
     Wgt100Label.Text    = "";
     QtyUOMLabel.Text    = "";
     StdCostLabel.Text   = "";
     UPCLabel.Text       = "";
     WebLabel.Text       = "";
     CategoryLabel.Text  = "";
     NetWghtLabel.Text   = "";
     SuperEqLabel.Text   = "";
     ListLabel.Text      = "";
     HarmCodeLabel.Text  = "";
     PackGroupLabel.Text = "";
     PlatingLabel.Text   = "";
     GrossWghtLabel.Text = "";
     PriceUMLabel.Text   = "";
     CFVLabel.Text       = "";
     PPILabel.Text       = "";
     ParentLabel.Text    = "";
     StockLabel.Text     = "";
     CostUMLabel.Text    = "";
     CatVelLabel.Text    = "";
     PkgVelLabel.Text    = "";
     CreatedLabel.Text   = "";
     SelectorUpdatePanel.Update();
     HeaderUpdatePanel.Update();
     //CategorySpecLabel.Text = "";
     MessageUpdatePanel.Update();
     // HeadImageUpdatePanel.Visible = false;
     // BodyImageUpdatePanel.Visible = false;
 }
Ejemplo n.º 2
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        //tPager.Visible = true;
        //BSSGridView.CurrentPageIndex = 0;
        //Pager1.GotoPageNumber = 0;
        //pnlPager.Update();

        lblErrorMessage.Text   = "";
        lblSuccessMessage.Text = "";
        MessageUpdatePanel.Update();

        if (txtBranchNo.Text.Trim().Length == 0)
        {
            lblErrorMessage.Text = "You must enter a Branch Number.";
            MessageUpdatePanel.Update();
        }
        else
        {
            lblErrorMessage.Text = "";
            ClearDisplay();

            //Validate Item Params
            if (string.IsNullOrEmpty(txtStrCat.Text))
            {
                txtStrCat.Text = "00000";
                if (string.IsNullOrEmpty(txtEndCat.Text))
                {
                    txtEndCat.Text = "99999";
                }
            }
            else
            {
                if (string.IsNullOrEmpty(txtEndCat.Text))
                {
                    txtEndCat.Text = txtStrCat.Text;
                }
            }

            if (string.IsNullOrEmpty(txtStrSize.Text))
            {
                txtStrSize.Text = "0000";
                if (string.IsNullOrEmpty(txtEndSize.Text))
                {
                    txtEndSize.Text = "9999";
                }
            }
            else
            {
                if (string.IsNullOrEmpty(txtEndSize.Text))
                {
                    txtEndSize.Text = txtStrSize.Text;
                }
            }

            if (string.IsNullOrEmpty(txtStrVar.Text))
            {
                txtStrVar.Text = "000";
                if (string.IsNullOrEmpty(txtEndVar.Text))
                {
                    txtEndVar.Text = "999";
                }
            }
            else
            {
                if (string.IsNullOrEmpty(txtEndVar.Text))
                {
                    txtEndVar.Text = txtStrVar.Text;
                }
            }

            //Get the data using pSSLocExcelDump
            ds = SqlHelper.ExecuteDataset(cnERP, "pSSLocExcelDump",
                                          new SqlParameter("@LocID", txtBranchNo.Text.Trim()),
                                          new SqlParameter("@StrCat", txtStrCat.Text.Trim()),
                                          new SqlParameter("@StrSize", txtStrSize.Text.Trim()),
                                          new SqlParameter("@StrVar", txtStrVar.Text.Trim()),
                                          new SqlParameter("@EndCat", txtEndCat.Text.Trim()),
                                          new SqlParameter("@EndSize", txtEndSize.Text.Trim()),
                                          new SqlParameter("@EndVar", txtEndVar.Text.Trim()));

            if (ds.Tables.Count >= 1)
            {
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    DataView dv = new DataView(dt, hidRowFilter.Value.ToString(), hidSort.Value.ToString(), DataViewRowState.CurrentRows);
                    // BSSGridView.DataSource = dv;
                    lblSuccessMessage.Text = dt.Rows.Count.ToString().Trim() + " record(s) found. Click Excel button to Export";

                    Session["BSSData"] = dt;

                    BSSGridView.DataBind();

                    ExcelUpdatePanel.Visible = true;
                    SelectorUpdatePanel.Update();
                    DetailUpdatePanel.Update();
                }
                else
                {
                    lblErrorMessage.Text = "No Branch Status for Branch Location " + txtBranchNo.Text.Trim();
                    MessageUpdatePanel.Update();
                    Session["BSSData"] = null;
                    BSSGridView.DataBind();
                }
                MessageUpdatePanel.Update();
            }
        }
    }
Ejemplo n.º 3
0
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        lblErrorMessage.Text   = "";
        lblSuccessMessage.Text = "";
        MessageUpdatePanel.Update();
        string Track = "Timer" + DateTime.Now.ToString("mm:ss");

        if (txtCustNo.Text.Trim().Length == 0)
        {
            lblErrorMessage.Text = "You must enter a Customer Number.";
            MessageUpdatePanel.Update();
        }
        else
        {
            try
            {
                lblErrorMessage.Text = "";
                ClearDisplay();

                //Get the data using pCustPriceGetHist
                Track += "|DataBeg" + DateTime.Now.ToString("mm:ss");
                ds     = SqlHelper.ExecuteDataset(ConnectionString, "pCustPriceGetHist",
                                                  new SqlParameter("@CustNo", txtCustNo.Text.Trim()),
                                                  new SqlParameter("@itemType", (rdoBulk.Checked ? "Bulk" : "Package")));
                Track += "|DataEnd" + DateTime.Now.ToString("mm:ss");
                if (ds.Tables.Count == 2)
                {
                    dt = ds.Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        lblCustName.Text        = dt.Rows[0]["CustomerName"].ToString();
                        lblBranch.Text          = dt.Rows[0]["Branch"].ToString();
                        lblRecType.Text         = "";
                        CPSMRecTypeHidden.Value = dt.Rows[0]["RecType"].ToString();

                        if (CPSMRecTypeHidden.Value.ToString() == "0")
                        {
                            lblRecType.Text = "These are New records wating for Targets.";
                        }
                        if (CPSMRecTypeHidden.Value.ToString() == "1")
                        {
                            lblRecType.Text = "These are Unprocessed waiting for Appproval.";
                        }

                        hidSort.Value = "";
                        hidSort.Attributes["sortType"] = "DESC";
                        hidRowFilter.Value             = "GroupType = 'C'";

                        // Change Target column header based on item type
                        CPSMGridView.Columns[7].HeaderText = (rdoBulk.Checked ? "Target" : "Bulk +");

                        DataView dv = new DataView(dt, hidRowFilter.Value.ToString(), hidSort.Value.ToString(), DataViewRowState.CurrentRows);
                        CPSMGridView.DataSource = dv;
                        Session["CPSMData"]     = dt;
                        Track += "|Session" + DateTime.Now.ToString("mm:ss");
                        CPSMGridView.DataBind();
                        Track += "|DataBind" + DateTime.Now.ToString("mm:ss");

                        if (ApprovalOKHidden.Value.ToUpper() == "TRUE")
                        {
                            ApproveUpdatePanel.Visible = true;
                            SubmitUpdatePanel.Visible  = false;
                        }
                        else
                        {
                            ApproveUpdatePanel.Visible = false;
                            SubmitUpdatePanel.Visible  = true;
                        }

                        if (hidShowCostBasis.Value == "TRUE")
                        {
                            ibtnSetBasis.Visible = true;
                        }
                        else
                        {
                            ibtnSetBasis.Visible = false;
                        }

                        if (hidPriceAnalysis.Value == "TRUE")
                        {
                            btnPriceAnalysis.Visible = true;
                        }
                        else
                        {
                            btnPriceAnalysis.Visible = false
                            ;
                        }
                        ExcelUpdatePanel.Visible = true;
                        SelectorUpdatePanel.Update();
                        DetailUpdatePanel.Update();
                    }
                    else
                    {
                        lblErrorMessage.Text = "No Price Schedule Data For Customer " + txtCustNo.Text.Trim();
                        MessageUpdatePanel.Update();
                        Session["CPSMData"] = null;
                        CPSMGridView.DataBind();
                    }
                    Track += "|HdrBeg" + DateTime.Now.ToString("mm:ss");

                    dtSched = ds.Tables[1];
                    if (dtSched.Rows.Count > 0)
                    {
                        if (string.IsNullOrEmpty(lblCustName.Text.ToString()))
                        {
                            lblCustName.Text = dtSched.Rows[0]["CustomerName"].ToString();
                        }
                        if (string.IsNullOrEmpty(lblBranch.Text.ToString()))
                        {
                            lblBranch.Text = dtSched.Rows[0]["Branch"].ToString();
                        }
                        lblSched1.Text         = dtSched.Rows[0]["ContractSchd1"].ToString();
                        lblSched2.Text         = dtSched.Rows[0]["ContractSchd2"].ToString();
                        lblSched3.Text         = dtSched.Rows[0]["ContractSchd3"].ToString();
                        lblSched4.Text         = dtSched.Rows[0]["ContractSchedule4"].ToString();
                        lblSched5.Text         = dtSched.Rows[0]["ContractSchedule5"].ToString();
                        lblSched6.Text         = dtSched.Rows[0]["ContractSchedule6"].ToString();
                        lblSched7.Text         = dtSched.Rows[0]["ContractSchedule7"].ToString();
                        lblTargetGross.Text    = String.Format("{0:0.0}", dtSched.Rows[0]["TargetGrossMarginPct"]);
                        lblWebDiscPct.Text     = String.Format("{0:0.00}", dtSched.Rows[0]["WebDiscountPct"]);
                        chkWebDiscInd.Checked  = (dtSched.Rows[0]["WebDiscountInd"].ToString().ToUpper().Trim() == "1");
                        lblCustDefPrice.Text   = dtSched.Rows[0]["CustomerDefaultPrice"].ToString();
                        lblCustPriceInd.Text   = dtSched.Rows[0]["CustomerPriceInd"].ToString();
                        lblCreditInd.Text      = dtSched.Rows[0]["CreditInd"].ToString();
                        lblActGrossMgnPct.Text = dtSched.Rows[0]["ActGrossMgnPct"].ToString();
                        lblDefaultCostPct.Text = dtSched.Rows[0]["TargetCostPlusPct"].ToString();
                    }
                    else
                    {
                        lblErrorMessage.Text = "Customer " + txtCustNo.Text.Trim() + " Not On File";
                        MessageUpdatePanel.Update();
                    }

                    Track += "|HdrEnd" + DateTime.Now.ToString("mm:ss");
                    lblSuccessMessage.Text = Track;
                    MessageUpdatePanel.Update();
                }
            }
            catch (Exception e3)
            {
                lblErrorMessage.Text = "pCustPriceGetHist Error " + e3.Message + ", " + e3.ToString();
                MessageUpdatePanel.Update();
            }
        }
    }