コード例 #1
0
 protected void GetLPNData()
 {
     try
     {
         Session[SessionTableName] = null;
         // get the data.
         dt = CheckError(ReceiptData.GetItems(LPNLabel.Text.ToString().Trim(), Session["UserName"].ToString()));
         if ((dt != null) && (dt.Rows.Count > 0))
         {
             LPNGridView.DataSource = dt;
             LPNGridView.DataBind();
             Session[SessionTableName] = dt;
             lblSuccessMessage.Text    = "Cross Dock Orders have been submitted for Printing.";
         }
         else
         {
             lblErrorMessage.Text = "No data for LPN " + LPNLabel.Text;
             MessageUpdatePanel.Update();
         }
     }
     catch (Exception e3)
     {
         lblErrorMessage.Text = "GetLPNData Error " + e3.Message + ", " + e3.ToString();
         MessageUpdatePanel.Update();
     }
 }
コード例 #2
0
ファイル: RBReceiptsSumm.aspx.cs プロジェクト: 2Nifty/PFC
 protected void GetLPNData(string Loc)
 {
     try
     {
         // get the data.
         ds = SqlHelper.ExecuteDataset(RBConnectionString, "pWHSLPNSummary",
                                       new SqlParameter("@Branch", LocationDropDownList.SelectedItem.Value.ToString()),
                                       new SqlParameter("@ShipMeth", ""));
         if (ds.Tables.Count == 1)
         {
             dt = ds.Tables[0];
             if (dt.Rows.Count > 0)
             {
                 LPNGridView.DataSource = dt;
                 LPNGridView.DataBind();
                 DetailUpdatePanel.Update();
                 Session["LPNData"] = dt;
             }
             else
             {
                 //lblErrorMessage.Text = "Error " + ItemNoTextBox.Text + ":" + QuoteFilterValueHidden.Value + ":" + QOHCommandHidden.Value;
                 lblErrorMessage.Text = "No Recipt Bins in Branch " + Loc;
                 MessageUpdatePanel.Update();
             }
         }
     }
     catch (Exception e3)
     {
         lblErrorMessage.Text = "pWHSLPNSummary Error " + e3.Message + ", " + e3.ToString();
         MessageUpdatePanel.Update();
     }
 }
コード例 #3
0
 public void DetailGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     //DataView dv = new DataView((DataTable)Session[DetailTableName.Value]);
     LPNGridView.DataSource = (DataTable)Session[SessionTableName];
     LPNGridView.PageIndex  = e.NewPageIndex;
     LPNGridView.DataBind();
     DetailGridPanel.Height = new Unit(double.Parse(DetailGridHeightHidden.Value), UnitType.Pixel);
     DetailGridPanel.Width  = new Unit(double.Parse(DetailGridWidthHidden.Value), UnitType.Pixel);
 }
コード例 #4
0
 protected void GetLPNData()
 {
     try
     {
         // get the data.
         ds = SqlHelper.ExecuteDataset(ERPConnectionString, "pWHSLPNDetail",
                                       new SqlParameter("@Branch", LocLabel.Text.Substring(0, 2)),
                                       new SqlParameter("@LPN", LPNLabel.Text.Trim()));
         if (ds.Tables.Count == 1)
         {
             dt = ds.Tables[0];
             if (dt.Rows.Count > 0)
             {
                 DataColumn column = new DataColumn();
                 column.DataType     = Type.GetType("System.Boolean");
                 column.ColumnName   = "Adjust";
                 column.Caption      = "Select";
                 column.ReadOnly     = false;
                 column.Unique       = false;
                 column.DefaultValue = false;
                 dt.Columns.Add(column);
                 DataColumn column2 = new DataColumn();
                 column2.DataType   = Type.GetType("System.String");
                 column2.ColumnName = "AdjustDesc";
                 //column.Caption = "Select";
                 column2.ReadOnly     = false;
                 column2.Unique       = false;
                 column2.DefaultValue = "None";
                 dt.Columns.Add(column2);
                 DataColumn column3 = new DataColumn();
                 column3.DataType     = Type.GetType("System.Int16");
                 column3.ColumnName   = "AdjustQty";
                 column3.Caption      = "AdjustQty";
                 column3.ReadOnly     = false;
                 column3.Unique       = false;
                 column3.DefaultValue = 0;
                 dt.Columns.Add(column3);
                 LPNGridView.DataSource = dt;
                 LPNGridView.DataBind();
                 Session[SessionTableName] = dt;
             }
             else
             {
                 lblErrorMessage.Text = "No data for LPN " + LPNLabel.Text;
                 MessageUpdatePanel.Update();
             }
         }
     }
     catch (Exception e3)
     {
         lblErrorMessage.Text = "pWHSLPNDetail Error " + e3.Message + ", " + e3.ToString();
         MessageUpdatePanel.Update();
     }
 }
コード例 #5
0
 public void SortDetailGrid(Object sender, GridViewSortEventArgs e)
 {
     try
     {
         // Create a DataView
         string   LineFilter;
         DataView dv = new DataView((DataTable)Session[SessionTableName]);
         dv.Sort = e.SortExpression;
         LPNGridView.DataSource = dv;
         LPNGridView.DataBind();
         DetailGridPanel.Height = new Unit(double.Parse(DetailGridHeightHidden.Value), UnitType.Pixel);
         DetailGridPanel.Width  = new Unit(double.Parse(DetailGridWidthHidden.Value), UnitType.Pixel);
     }
     catch (Exception e2)
     {
         lblErrorMessage.Text = "Sort Error " + e2.Message + ", " + e2.ToString();
         MessageUpdatePanel.Update();
     }
 }
コード例 #6
0
    protected void AdjustSubmit_Click(object sender, EventArgs e)
    {
        DataTable tempDt = (DataTable)Session[SessionTableName];

        DataRow[] LPNRows =
            tempDt.Select("Adjust");
        int AdjustmentCount = 0;

        if (LPNRows.Length == 0)
        {
            lblErrorMessage.Text = "Check the check box to the left of the Item number to make that adjustment. ";
            MessageUpdatePanel.Update();
        }
        else
        {
            try
            {
                foreach (DataRow LPNRow in LPNRows)
                {
                    if ((bool)LPNRow["Adjust"])
                    {
                        //lblErrorMessage.Text = LPNRow["ToRcvQty"].ToString() + ":" + LPNRow["AdjustQty"].ToString() + ":" + LPNRow["AdjustDesc"].ToString();
                        if (int.Parse(LPNRow["ToRcvQty"].ToString(), NumberStyles.Number) != 0)
                        {
                            try
                            {
                                // move the qty in RB.
                                ds = SqlHelper.ExecuteDataset(RBConnectionString, "pWHSLPNAccept",
                                                              new SqlParameter("@Branch", LocLabel.Text.Substring(0, 2)),
                                                              new SqlParameter("@Bin", LPNRow["Bin"].ToString()),
                                                              new SqlParameter("@LPN", LPNLabel.Text.Trim()),
                                                              new SqlParameter("@Item", LPNRow["ItemNo"].ToString()),
                                                              new SqlParameter("@Action", "Move"),
                                                              new SqlParameter("@Qty", LPNRow["ToRcvQty"].ToString()),
                                                              new SqlParameter("@AdjustDesc", "ERPReceipt"));
                                AdjustmentCount++;
                            }
                            catch (SqlException ex1)
                            {
                                LineError            = true;
                                lblErrorMessage.Text = "Error pWHSLPNAccept for receiving " + ex1.Message + ", " + ex1.Number.ToString() + ", " + ex1.LineNumber.ToString();
                                MessageUpdatePanel.Update();
                            }
                        }
                        if ((int.Parse(LPNRow["AdjustQty"].ToString(), NumberStyles.Number) != 0) && (LPNRow["AdjustDesc"].ToString().Trim() != "None"))
                        {
                            // adjust the qty in RB.
                            try
                            {
                                ds = SqlHelper.ExecuteDataset(RBConnectionString, "pWHSLPNAccept",
                                                              new SqlParameter("@Branch", LocLabel.Text.Substring(0, 2)),
                                                              new SqlParameter("@Bin", LPNRow["Bin"].ToString()),
                                                              new SqlParameter("@LPN", LPNLabel.Text.Trim()),
                                                              new SqlParameter("@Item", LPNRow["ItemNo"].ToString()),
                                                              new SqlParameter("@Action", "Adjust"),
                                                              new SqlParameter("@Qty", LPNRow["AdjustQty"].ToString()),
                                                              new SqlParameter("@AdjustDesc", LPNRow["AdjustDesc"].ToString()));
                                AdjustmentCount++;
                            }
                            catch (SqlException ex1)
                            {
                                LineError            = true;
                                lblErrorMessage.Text = "Error pWHSLPNAccept for adjusment " + ex1.Message + ", " + ex1.Number.ToString() + ", " + ex1.LineNumber.ToString();
                                MessageUpdatePanel.Update();
                            }

                            // now add the InventoryAdjustment record
                            string colValues = FormatLineColumn(1, 1, LPNRow["ItemNo"].ToString());                                                                  //ItemNo
                            colValues += FormatLineColumn(2, 1, LocLabel.Text.Substring(0, 2));                                                                      //Location
                            colValues += FormatLineColumn(3, 1, LPNRow["Bin"].ToString());                                                                           //BinLocation
                            colValues += FormatLineColumn(4, 2, LPNRow["AdjustQty"].ToString());                                                                     //AdjustedQty
                            colValues += FormatLineColumn(5, 1, LPNRow["ContainerNo"].ToString());                                                                   //ContainerNo
                            colValues += FormatLineColumn(6, 1, LPNRow["BOLNo"].ToString());                                                                         //BOLNo
                            colValues += FormatLineColumn(7, 1, LPNRow["AdjustDesc"].ToString().Substring(0, Math.Min(LPNRow["AdjustDesc"].ToString().Length, 30))); //ReasonName
                            colValues += FormatLineColumn(8, 4, DateTime.Now.ToShortDateString());                                                                   //EntryDt
                            colValues += FormatLineColumn(9, 1, Session["UserName"].ToString()).Replace(",", "");                                                    //EntryID
                            // add all the values into a new line
                            try
                            {
                                ds = SqlHelper.ExecuteDataset(ERPConnectionString, "UGEN_SP_Insert",
                                                              new SqlParameter("@tableName", "InventoryAdjustment"),
                                                              new SqlParameter("@columnNames", DetailColumnNames),
                                                              new SqlParameter("@columnValues", colValues));
                            }
                            catch (SqlException ex1)
                            {
                                LineError = true;
                                lblSuccessMessage.Text = colValues;
                                lblErrorMessage.Text   = "Error adding line to InventoryAdjustment. " + ex1.Message + ", " + ex1.Number.ToString() + ", " + ex1.LineNumber.ToString();
                                MessageUpdatePanel.Update();
                            }

                            /*
                             * SELECT pInventoryAdjustmentID
                             *    ,ItemNo
                             *    ,TransactionType
                             *    ,Location
                             *    ,TransactionDocument
                             *    ,DocumentLineNo
                             *    ,BinLocation
                             *    ,ReferenceNo
                             *    ,ReferenceDt
                             *    ,TransactionDt
                             *    ,ReceievedQty
                             *    ,ReceievedUM
                             *    ,ReceivedUnitCost
                             *    ,AdjustedQty
                             *    ,AdjustedUM
                             *    ,AdjustedUnitCost
                             *    ,ASN
                             *    ,POOrderNo
                             *    ,ContainerNo
                             *    ,BOLNo
                             *    ,OldLPN
                             *    ,NewLPN
                             *    ,ReasonCd
                             *    ,ApplicationSource
                             *    ,EntryID
                             *    ,EntryDt
                             *    ,ChangeID
                             *    ,ChangeDt
                             *    ,StatusCd
                             *    ,ReasonName
                             *    ,ReferenceNoLineNo
                             *    ,ReferenceNoType
                             *    ,ReferenceNo2
                             *    ,ReferenceNo2LineNo
                             *    ,ReferenceNo2Type
                             *    ,ReferenceNo3
                             *    ,ReferenceNo3LineNo
                             *    ,ReferenceNo3Type
                             *    ,ParentDocumentNo
                             *    ,ParentDocumentLineNo
                             *    ,ParentDocumentType
                             *    ,VendorCustReferenceNo
                             *    ,NetUnitWght
                             *    ,GrossUnitWght
                             *    ,ExtReceviedUnitCost
                             *    ,ExtAdjustedUnitCost
                             *    ,ExtNetWght
                             *    ,ExtGrossWght
                             *    ,FromLocation
                             *    ,FromLocationName
                             *    ,fDocumentID
                             *    ,TransactionUM
                             *    ,ToLocation
                             *    ,ToLocationName
                             *    ,IntransitLocation
                             *    ,IntransitLocationName
                             * FROM InventoryAdjustment*/
                        }
                    }
                }
                lblSuccessMessage.Text = AdjustmentCount.ToString() + " adjustment(s) made.";
                MessageUpdatePanel.Update();
                LPNGridView.DataBind();
                DetailGridUpdatePanel.Update();
            }
            catch (Exception e3)
            {
                lblErrorMessage.Text = "pWHSLPNAccept Error " + e3.Message + ", " + e3.ToString();
                MessageUpdatePanel.Update();
            }
        }
    }