예제 #1
0
 protected void GetPackPlateData(string ItemNo, string Loc)
 {
     // get the package and plating data.
     ds = SqlHelper.ExecuteDataset(connectionString, "pSOEGetPackPlate",
                                   new SqlParameter("@SearchItemNo", ItemNo),
                                   new SqlParameter("@PrimaryBranch", Loc));
     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)
             {
                 ItemNoTextBox.Text = "Error ";
             }
         }
         else
         {
             dt = ds.Tables[1];
             PackPlateGridView.DataSource = dt;
             PackPlateGridView.DataBind();
             DataView dv = new DataView(dt, "SubItem = '" + ItemNo + "'", "", DataViewRowState.CurrentRows);
             AltAvailLabel.Text = String.Format("{0:#,##0}", dv[0]["AltQOH"]);
         }
     }
 }
예제 #2
0
 protected void GetPackPlateData(string ItemNo, string Loc)
 {
     Loc = Loc.PadLeft(2, '0');
     // set the z-item on the location
     CheckZItemBranch(Loc);
     // get the package and plating data.
     ds = SqlHelper.ExecuteDataset(connectionString, "pSOEGetPackPlate",
                                   new SqlParameter("@SearchItemNo", ItemNo),
                                   new SqlParameter("@PrimaryBranch", Loc));
     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)
             {
                 lblErrorMessage.Text = "Package/Plating problem " + ItemNo.ToString() + Loc.ToString();
                 MessageUpdatePanel.Update();
             }
         }
         else
         {
             dt = ds.Tables[1];
             if (dt.Rows.Count > 0)
             {
                 if (WebEnabledHidden.Value == "1")
                 {
                     DataView dvWE = new DataView(dt, "WebEnabled = '" + WebEnabledHidden.Value + "'", "", DataViewRowState.CurrentRows);
                     PackPlateGridView.DataSource = dvWE;
                 }
                 else
                 {
                     PackPlateGridView.DataSource = dt;
                 }
                 PackPlateGridView.DataBind();
                 PackPlateUpdatePanel.Update();
                 DataView dv = new DataView(dt, "SubItem = '" + ItemNo + "'", "", DataViewRowState.CurrentRows);
                 if (dv.Count > 0)
                 {
                     AltAvailLabel.Text = String.Format("{0:#,##0}", dv[0]["AltQOH"]);
                 }
                 else
                 {
                     AltAvailLabel.Text = "0";
                 }
                 BindPrintDialog();
             }
             else
             {
                 AltAvailLabel.Text = "";
                 PackPlateGridView.DataBind();
                 PackPlateUpdatePanel.Update();
                 lblErrorMessage.Text = "Nothing on file.";
                 MessageUpdatePanel.Update();
             }
         }
     }
 }