Exemple #1
0
 private void ProcessVendorFile(string VendorFileName)
 {
     //
     //send the file trough the parsing engine and get back a dataset
     //
     ClearPageMessages();
     if (VendorDDL.SelectedItem.Text.Substring(0, 2) != "--")
     {
         FileProcessed.Text            = VendorFileName;
         ValidationPanelTop.Visible    = true;
         ValidationPanelBottom.Visible = true;
         ValidationButtonPanel.Visible = true;
         FilePanel.Visible             = false;
         string UserName = Session["UserName"].ToString();
         BadLinesGridView.DataSource = gerrts.ParseEngine(VendorFileName, VendorDDL.SelectedItem.Text, PalletPartnerCheckBox.Checked, UserName);
         BadLinesGridView.DataBind();
         //GERRTSSqlData.SelectCommand = "SELECT * FROM GERRTS WHERE (StatusCd >= '01' and VendNo = '" + VendorDDL.SelectedItem.Text + "') ORDER BY pGERRTSID";
         GERRTSSqlData.Select(DataSourceSelectArguments.Empty);
         ValidationGridView.DataBind();
         //MainUpdatePanel.Update();
         //VendorFilesGridUpdatePanel.Visible = false;
         //VendorFilesGridUpdatePanel.Update();
         //ValidationUpdatePanel.Update();
         //lblSuccessMessage.Text = "Processed " + VendorFileName;
     }
     else
     {
         lblErrorMessage.Text = "You must select the Vendor for the file you a processing.";
         VendorDDL.Focus();
         //VendorFilesGridUpdatePanel.Update();
     }
 }
Exemple #2
0
 public void SaveButt_Click(object sender, EventArgs e)
 {
     if (UpdFunction.Value == "Add")
     {
         string columnValues = "'" + VendorUpd.SelectedValue.ToString() + "'";
         columnValues += ",'" + ItemUpd.Text + "'";
         columnValues += ",'" + POUpd.Text.Replace(",", "") + "'";
         columnValues += ",'" + PortUpd.Text.Replace(",", "") + "'";
         columnValues += ", " + QtyUpd.Text.Replace(",", "") + " ";
         columnValues += ", " + PalletsUpd.Text.Replace(",", "") + " ";
         columnValues += ", " + WeightUpd.Text.Replace(",", "") + " ";
         columnValues += ", '" + gerrts.RTSPalPtnrValue + "'";
         columnValues += ", '" + LocUpd.SelectedValue + "'";
         columnValues += ", '" + MfgPlantUpd.Text + "'";
         columnValues += ", '" + HttpContext.Current.User.Identity.Name + "'";
         columnValues += ", '" + DateTime.Now.ToString() + "'";
         columnValues += ", '01'";
         SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "pVMI_Insert",
                                  new SqlParameter("@tableName", "GERRTS"),
                                  new SqlParameter("@columnNames", "VendNo, ItemNo, PONo, PortofLading, Qty, PalletCnt, GrossWght, GERRTSStatCd, LocCd, MfgPlant, EntryID, EntryDt, StatusCd"),
                                  new SqlParameter("@columnValues", columnValues));
     }
     else
     {
         string[] Cols = new string[] { VendorUpd.SelectedValue.ToString(), POUpd.Text, ItemUpd.Text, PalletsUpd.Text.Replace(",", ""),
                                        QtyUpd.Text.Replace(",", ""), WeightUpd.Text.Replace(",", ""), PortUpd.Text.Replace(",", ""), MfgPlantUpd.Text };
         gerrts.RTSVendorNo = VendorDDL.SelectedItem.Text;
         string[] LineResults  = gerrts.ValidateInputColumns(Cols, PalletPartnerCheckBox.Checked);
         string   columnValues = "VendNo = '" + VendorUpd.SelectedValue + "'";
         columnValues += ", ItemNo = '" + ItemUpd.Text + "'";
         columnValues += ", PONo = '" + POUpd.Text.Replace(",", "") + "' ";
         columnValues += ", PortofLading = '" + PortUpd.Text.Replace(",", "") + "' ";
         columnValues += ", Qty = " + QtyUpd.Text.Replace(",", "") + " ";
         columnValues += ", PalletCnt = " + PalletsUpd.Text.Replace(",", "") + " ";
         columnValues += ", GrossWght = " + WeightUpd.Text.Replace(",", "") + " ";
         columnValues += ", GERRTSStatCd = '" + gerrts.RTSPalPtnrValue + "' ";
         columnValues += ", LocCd = '" + LocUpd.SelectedValue + "'";
         columnValues += ", MfgPlant = '" + MfgPlantUpd.Text + "'";
         columnValues += ", StatusCd = '" + LineResults[0] + "'";
         CodeUpd.Text  = gerrts.RTSPalPtnrValue;
         if (LineResults[0] == "01")
         {
             EditErrorLabel.Text   = "";
             EditSuccessLabel.Text = "Verified OK and Record Saved.";
         }
         else
         {
             EditErrorLabel.Text   = LineResults[1];
             EditSuccessLabel.Text = "Record Saved.";
         }
         SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "pVMI_Update",
                                  new SqlParameter("@tableName", "GERRTS"),
                                  new SqlParameter("@columnNames", columnValues),
                                  new SqlParameter("@whereClause", "pGERRTSID=" + HiddenGERID.Value + ""));
     }
     GERRTSSqlData.FilterExpression = " pGERRTSID >= " + HiddenGERID.Value + "-3 and pGERRTSID <= " + HiddenGERID.Value + "+3";
     ValidationGridView.DataBind();
 }
Exemple #3
0
 public void FilterValidationRecords()
 {
     if (OrigRadioButton1.Checked)
     {
         GERRTSSqlData.FilterExpression = " StatusCd >= '01'";
         ValidationAcceptButton.Visible = true;
     }
     if (OrigRadioButton2.Checked)
     {
         GERRTSSqlData.FilterExpression = " StatusCd <= '09'";
         ValidationAcceptButton.Visible = true;
     }
     if (OrigRadioButton3.Checked)
     {
         GERRTSSqlData.FilterExpression = " StatusCd > '09' and StatusCd < '20'";
         ValidationAcceptButton.Visible = true;
     }
     if (OrigRadioButton4.Checked)
     {
         GERRTSSqlData.FilterExpression = " StatusCd >= '20'";
         ValidationAcceptButton.Visible = false;
     }
     ValidationGridView.DataBind();
 }