Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            CPRFactor.Text       = "1";
            Session["StockData"] = null;
            //CPRFactor.ForeColor = Color.Gray; if (this.value == 'Factor') {this.style.color = 'black'; this.style.fontWeight = 'bold'; this.value='';} else
            CalledBy.Value           = "";
            ParentCall.Value         = "0";
            tblPager.Visible         = false;
            RunCPRButt.Visible       = false;
            CPRFactor.Visible        = false;
            PrintUpdatePanel.Visible = false;
            LocSortHidden.Value      = "SortKey";

            if (Request.QueryString["UserName"] != null)
            {
                Session["UserName"] = Request.QueryString["UserName"].ToString();
            }

            NameValueCollection coll = Request.QueryString;
            // Load NameValueCollection object.
            if (coll["ItemNo"] != null && coll["ItemNo"].ToString().Length > 0)
            {
                ItemNoTextBox.Text = coll["ItemNo"].ToString();
                GetItem(coll["ItemNo"].ToString());
            }
            else
            {
                ShowPageMessage("Enter an Item", 0);
                StockStatusScriptManager.FindControl("ItemNoTextBox").Focus();
            }
            if (coll["ListCall"] != null)
            {
                CalledBy.Value = "SSList";
            }
            if (coll["ParentCall"] != null)
            {
                ParentCall.Value = "1";
                CalledBy.Value   = "SSParent";
            }
            else
            {
                ParentLabel.Font.Underline = true;
            }
        }
        else
        {
        }
    }
Example #2
0
 protected void GetItem(string ItemNo)
 {
     RunCPRButt.Visible       = false;
     CPRFactor.Visible        = false;
     PrintUpdatePanel.Visible = false;
     // get the package and plating data.
     ds = SqlHelper.ExecuteDataset(connectionString, "pSSGetItem",
                                   new SqlParameter("@SearchItemNo", ItemNo),
                                   new SqlParameter("@UserName", Session["UserName"].ToString()));
     if (ds.Tables.Count >= 1)
     {
         if (ds.Tables.Count == 1)
         {
             // We only go one table back, something is wrong
             dt = ds.Tables[0];
             if (dt.Rows.Count > 0)
             {
                 ShowPageMessage("Item not found.", 2);
             }
         }
         else
         {
             dt = ds.Tables[1];
             ItemDescLabel.Text     = dt.Rows[0]["ItemDesc"].ToString();
             Wgt100Label.Text       = FormatScreenData(Num2Format, dt.Rows[0]["HundredWght"]);
             QtyUOMLabel.Text       = dt.Rows[0]["SellGlued"].ToString();
             StdCostLabel.Text      = dt.Rows[0]["CostGlued"].ToString();
             UPCLabel.Text          = dt.Rows[0]["UPC"].ToString();
             WebLabel.Text          = dt.Rows[0]["WebEnabled"].ToString();
             CategoryLabel.Text     = dt.Rows[0]["CatDesc"].ToString();
             NetWghtLabel.Text      = FormatScreenData(Num2Format, dt.Rows[0]["NetWght"]);
             SuperEqLabel.Text      = dt.Rows[0]["SuperGlued"].ToString();
             LowProfileLabel.Text   = FormatScreenData(Num0Format, dt.Rows[0]["LowProfileQty"]);
             ListLabel.Text         = FormatScreenData(Num2Format, dt.Rows[0]["ListPrice"]);
             HarmCodeLabel.Text     = dt.Rows[0]["Tariff"].ToString();
             PackGroupLabel.Text    = dt.Rows[0]["PackageGroup"].ToString();
             PlatingLabel.Text      = dt.Rows[0]["Finish"].ToString();
             GrossWghtLabel.Text    = FormatScreenData(Num2Format, dt.Rows[0]["GrossWght"]);
             PriceUMLabel.Text      = dt.Rows[0]["PriceUM"].ToString();
             CFVLabel.Text          = dt.Rows[0]["CorpFixedVelocity"].ToString();
             PPILabel.Text          = dt.Rows[0]["PPI"].ToString();
             ParentLabel.Text       = dt.Rows[0]["ParentProdNo"].ToString();
             ParentItemHidden.Value = dt.Rows[0]["ParentProdNo"].ToString();
             StockLabel.Text        = dt.Rows[0]["StockInd"].ToString();
             CostUMLabel.Text       = dt.Rows[0]["CostUM"].ToString();
             CatVelLabel.Text       = dt.Rows[0]["CatVelocityCd"].ToString();
             CreatedLabel.Text      = FormatScreenData(DateFormat, dt.Rows[0]["Created"]);
             PkgVelLabel.Text       = dt.Rows[0]["PackageVelocity"].ToString();
             SmoothOK.Value         = dt.Rows[0]["SmoothOk"].ToString();
             if (dt.Rows[0]["SmoothOk"].ToString() == "1")
             {
                 SSHeadingTable.Rows[1].Cells[14].Text = "Avg.";
             }
             if (int.Parse(dt.Rows[0]["CPROk"].ToString()) == 1)
             {
                 RunCPRButt.Visible = true;
                 CPRFactor.Visible  = true;
             }
             Session["StockData"] = ds.Tables[2];
             BindSSGrid(ds.Tables[2]);
             GetImages(dt.Rows[0]["ItemCategory"].ToString());
             BindPrintDialog();
         }
     }
     StockStatusScriptManager.SetFocus("ItemNoTextBox");
 }