private void buttoneRBill_Click(object sender, EventArgs e) { dataGridViewCurrentShipment.Focus(); if (!Main.CheckUserPermission(Properties.Settings.Default.WsirConnectionString, Properties.Settings.Default.UsuarioNombre, "SolViewShipment", true)) { return; } if (dataGridViewCurrentShipment.SelectedRows.Count < 1) { MessageBox.Show("Please select a Shipment to tramsmit", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } RBillNumber = dataGridViewCurrentShipment.SelectedRows[0].Cells[0].Value.ToString(); string status = dataGridViewCurrentShipment.SelectedRows[0].Cells[3].Value.ToString(); if (status.ToLower() != "s") { MessageBox.Show("Only Shipments marked as Shipped please", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (sol_Shipment_Sp == null) { sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_Shipment = sol_Shipment_Sp.SelectByRBillNumber(RBillNumber); if (sol_Shipment == null) { MessageBox.Show(String.Format("Invalid RBill Number: {0}, please verify it!", RBillNumber), "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (sol_Shipment.ERBillTransmitted) { //MessageBox.Show("Shipment already transmitted!"); //return; DialogResult result = MessageBox.Show("This R-Bill has already been submitted. Are you sure you want to send it again?", "", MessageBoxButtons.YesNoCancel); //.YesNo); if (result != System.Windows.Forms.DialogResult.Yes) { return; } } if (sol_Agencie_Sp == null) { sol_Agencie_Sp = new Sol_Agencie_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_Agencie = sol_Agencie_Sp.Select(sol_Shipment.AgencyID); if (sol_Agencie.Name.ToLower().Trim() != "abcrc") { MessageBox.Show("Shipment's agency is not ABCRC!"); return; } ShippingShipments.eRBill(sol_Shipment, sol_Shipment_Sp); }
private void Shipping_Load(object sender, EventArgs e) { //classes of tables sol_Shipment = new Sol_Shipment(); sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_ShipmentList = new List <Sol_Shipment>(); sol_Stage = new Sol_Stage(); sol_Stage_Sp = new Sol_Stage_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_StageList = new List <Sol_Stage>(); toolStrip1.Renderer = new App_Code.NewToolStripRenderer(); if (Properties.Settings.Default.TouchOriented) { toolStripButtonVirtualKb.Visible = true; } //clock object obj1 = toolStripStatusLabelToday; object obj2 = toolStripStatusLabelTimer; Main.rc.CambiarControlFecha(ref obj1); Main.rc.CambiarControlHora(ref obj2); //disable form resizing //this.FormBorderStyle = FormBorderStyle.FixedSingle; //listview with headers listViewCurrentStagedContainers.View = View.Details; //listViewCurrentStagedContainers.Columns.Add("Tag #", 190, HorizontalAlignment.Right); //70 //listViewCurrentStagedContainers.Columns.Add("Product", 165, HorizontalAlignment.Left); //listViewCurrentStagedContainers.Columns.Add("Dozen", 80, HorizontalAlignment.Left); //listViewCurrentStagedContainers.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewCurrentStagedContainers.Columns.Add("Tag #", 190, HorizontalAlignment.Left); //70 listViewCurrentStagedContainers.Columns.Add("Product", 165, HorizontalAlignment.Left); listViewCurrentStagedContainers.Columns.Add("Quantity", 80, HorizontalAlignment.Right); listViewCurrentStagedContainers.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewCurrentStagedContainers.Columns.Add("Dozen", 80, HorizontalAlignment.Right); listViewCurrentStagedContainers.FullRowSelect = true; //listViewCurrentStagedContainers.CheckBoxes = true; listViewCurrentStagedContainers.GridLines = true; //listView1.Activation = ItemActivation.OneClick; //manual sorting of items by columns listViewCurrentStagedContainers.Sorting = System.Windows.Forms.SortOrder.Ascending; // Make owner-drawn to be able to give different alignments to single subitems //listViewCurrentStagedContainers.OwnerDraw = true; //listViewCurrentStagedContainers.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.listView1_DrawColumnHeader); //listViewCurrentStagedContainers.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.listView1_DrawSubItem); //listViewCurrentStagedContainers.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.listView2_DrawSubItem); //listview with headers listViewCurrentShipment.View = View.Details; //listViewCurrentShipment.Columns.Add("ShipmentID", 100, HorizontalAlignment.Left); listViewCurrentShipment.Columns.Add("BOL #", 160, HorizontalAlignment.Left); listViewCurrentShipment.Columns.Add("Agency", 300, HorizontalAlignment.Left); listViewCurrentShipment.FullRowSelect = true; //listViewCurrentShipment.CheckBoxes = true; listViewCurrentShipment.GridLines = true; //listview with headers listViewContainersOnShipment.View = View.Details; //listViewContainersOnShipment.Columns.Add("Tag #", 190, HorizontalAlignment.Right); //listViewContainersOnShipment.Columns.Add("Product", 165, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Tag #", 190, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Product", 165, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Quantity", 80, HorizontalAlignment.Right); listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Right); //listViewContainersOnShipment.FullRowSelect = true; //listViewContainersOnShipment.CheckBoxes = true; listViewContainersOnShipment.GridLines = true; //read outstandig orders (unpaid) ReadCurrentStagedContainers(); //read shipments ready to be shippped ReadCurrentShipments(); //training warning if (Properties.Settings.Default.SQLBaseDeDatos == "Solum_Training") { toolStripStatusLabelTrainingMode.Visible = true; Main.tslCntr = toolStripStatusLabelTrainingMode; Main.timerBlink.Enabled = true; } CheckUserPermissions(); if (Properties.Settings.Default.StagingType == 0) //!Properties.Settings.Default.MultiProductStagingEnabled) { toolStripSeparatorMultiProductStaging.Visible = false; toolStripButtonMultiProductStaging.Visible = false; } }
private void ShippingAdjustments_Load(object sender, EventArgs e) { //classes of tables sol_Shipment = new Sol_Shipment(); sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_ShipmentList = new List <Sol_Shipment>(); sol_Stage = new Sol_Stage(); sol_Stage_Sp = new Sol_Stage_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_StageList = new List <Sol_Stage>(); if (Properties.Settings.Default.TouchOriented) { toolStripButtonVirtualKb.Visible = true; } toolStrip1.Renderer = new App_Code.NewToolStripRenderer(); //clock object obj1 = toolStripStatusLabelToday; object obj2 = toolStripStatusLabelTimer; Main.rc.CambiarControlFecha(ref obj1); Main.rc.CambiarControlHora(ref obj2); //disable form resizing // this.FormBorderStyle = FormBorderStyle.FixedSingle; //listview with headers listViewContainersOnShipment.View = View.Details; //listViewContainersOnShipment.Columns.Add("Tag #", 200, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Product", 190, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("StageID", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Tag #", 200, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Product", 190, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Quantity", 80, HorizontalAlignment.Right); listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("StageID", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Right); //listViewContainersOnShipment.Columns["StageID"] listViewContainersOnShipment.FullRowSelect = true; listViewContainersOnShipment.CheckBoxes = true; listViewContainersOnShipment.GridLines = true; //listViewContainersOnShipment.Activation = ItemActivation.OneClick; listViewContainersOnShipment.MultiSelect = true; sol_Shipment_SelectAllByStatusTableAdapter.Fill(this.dataSetShipmentByStatusLookup.sol_Shipment_SelectAllByStatus, "S", true); //sol_Orders_SelectAllLookupTableAdapter.Fill(this.dataSetOrdersLookup.sol_Orders_SelectAllLookup, userName, strOrderType, "A", ""); //r = returns, = normal unpaid this.sol_ProductsTableAdapter.Fill(this.dataSetProductsLookup.sol_Products, 0); //0 = return products ChangeView(AdjustmentViewTypes.Overview); //read shipments ready to be shippped ReadCurrentShipments(); if (ShippingLookup.ShipmentButtonAdjustment) { comboBoxRbill.SelectedIndex = comboBoxRbill.FindStringExact(ShippingLookup.RBillNumber); buttonCreate.PerformClick(); ////textBoxRBillNumber.Text = ShippingHome.RBillNumber; ////ShippingHome.RBillNumber = ""; ////ShippingHome.ShipmentButtonView = false; ////buttonSearch.Enabled = true; ////buttonSearch.PerformClick(); ////if (dataGridViewCurrentShipment.SelectedRows.Count < 1) ////{ //// MessageBox.Show("Please select a Shipment to view", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); //// return; ////} //RBillNumber = ShippingLookup.RBillNumber; // dataGridViewCurrentShipment.SelectedRows[0].Cells[0].Value.ToString(); //ChangeView(AdjustmentViewTypes.Details); //textBoxRBill.Text = RBillNumber; // RemoveShipmentPostFix(RBillNumber); //sol_Shipment = sol_Shipment_Sp.SelectByRBillNumber(RemoveShipmentPostFix(RBillNumber)); //sol_Stage_SelectAllByAgencyTableAdapter.Fill( // this.dataSetStageLookup.sol_Stage_SelectAllByAgency, // "I", sol_Shipment.AgencyID); //buttonOriginalRbill.PerformClick(); //buttonOriginalRbill.Select(); } //training warning if (Properties.Settings.Default.SQLBaseDeDatos == "Solum_Training") { toolStripStatusLabelTrainingMode.Visible = true; Main.tslCntr = toolStripStatusLabelTrainingMode; Main.timerBlink.Enabled = true; } //initialFlag = false; CheckUserPermissions(); if (Properties.Settings.Default.StagingType == 0) //!Properties.Settings.Default.MultiProductStagingEnabled) { toolStripSeparatorMultiProductStaging.Visible = false; toolStripButtonMultiProductStaging.Visible = false; } }
//SOAP v1.2, and binding is wsHttpBindin private bool Test_validate(Sol_Shipment sol_Shipment, Sol_Shipment_Sp sol_Shipment_Sp) { if (String.IsNullOrEmpty(Main.Sol_ControlInfo.ABCRCUserName)) { MessageBox.Show("Please go to Settings -> ABCRC and add User Name and Password", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } if (checkBoxViewERBill.Checked) { f1 = new eRBill_CheckList_ListView(); } //https://abcrcerbill.com/WcfAbcrcService/ //former: https://abcrcerbill.com/WsHttpsAbcrcService.svc WsHttpsAbcrcServiceClient client = new WsHttpsAbcrcServiceClient(); //"configName", "https://abcrcerbill.com/WsHttpsAbcrcService.svc"); client.ClientCredentials.UserName.UserName = Main.Sol_ControlInfo.ABCRCUserName; client.ClientCredentials.UserName.Password = Main.Sol_ControlInfo.ABCRCPassword; int intNumber = 0; string strValue = String.Empty; string vendorId = String.Empty; string tagNumber = String.Empty; string productCode = String.Empty; int iProductCode = 0; string quantity = String.Empty; try { AbcrcERBill eRBill = new AbcrcERBill(); strValue = sol_Shipment.RBillNumber; vendorId = string.Format("{0:d4}", Main.Sol_ControlInfo.VendorID); //parse it if (sol_Shipment.RBillNumber.Length < 7) { Int32.TryParse(sol_Shipment.RBillNumber, out intNumber); strValue = vendorId + string.Format("{0:d6}", intNumber); } eRBill.RBillNumber = strValue; ////temporaly change for testing //vendorId = "0000"; eRBill.CarrierCrisID = sol_Shipment.CarrierID; eRBill.PlantCrisID = sol_Shipment.PlantID; eRBill.TrailerNumber = sol_Shipment.TrailerNumber; eRBill.ProBillNumber = sol_Shipment.ProBillNumber; eRBill.ShippedDate = sol_Shipment.ShippedDate; eRBill.SealNumber = sol_Shipment.SealNumber; eRBill.LoadReference = sol_Shipment.LoadReference; //add used and empty bags AbcrcERBillBag bag; int nBags = 0, nMaxBags = 0; AbcrcOtherShippingContainer aosc; int nAosc = 0, nMaxAosc = 0; //open product table Sol_Product_Sp sol_Product_Sp = new Sol_Product_Sp(Properties.Settings.Default.WsirDbConnectionString); Sol_Product sol_Product; //open Container table Sol_Container_Sp sol_Container_Sp = new Sol_Container_Sp(Properties.Settings.Default.WsirDbConnectionString); Sol_Container sol_Container; //read containers in shipment and get number of bags Sol_Stage_Sp sol_Stage_Sp = new Sol_Stage_Sp(Properties.Settings.Default.WsirDbConnectionString); List <Sol_Stage> sol_StageList = sol_Stage_Sp._SelectAllByShipmentID(sol_Shipment.ShipmentID); if (sol_StageList.Count < 1) { MessageBox.Show("", "No containers found in shipment, cannot continue!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } nMaxBags = sol_StageList.Count; //read eRBill empty containers and get number of bags Sol_SupplyInventory_Sp sol_SupplyInventory_Sp = new Sol_SupplyInventory_Sp(Properties.Settings.Default.WsirDbConnectionString); List <Sol_SupplyInventory> sol_SupplyInventoryList = sol_SupplyInventory_Sp._SelectAllByShipmentID(sol_Shipment.ShipmentID); foreach (Sol_SupplyInventory ssi in sol_SupplyInventoryList) { if (ssi.ProductID < 1) { //Empty Bags - EmptyContainer nMaxAosc++; } } //set max bags if (nMaxBags > 0) { eRBill.Bags = new AbcrcERBillBag[nMaxBags]; } if (nMaxAosc > 0) { eRBill.AdditionalShippingContainers = new AbcrcOtherShippingContainer[nMaxAosc]; } //process shipment containers foreach (Sol_Stage ssi in sol_StageList) { //get ShippingContainerID for ItemTypeCrisID sol_Container = sol_Container_Sp.Select(ssi.ContainerID); //begin loop //get productCode for ShippingContainerTypeCrisID sol_Product = sol_Product_Sp.Select(ssi.ProductID); Int32.TryParse(sol_Product.ProductCode, out iProductCode); productCode = string.Format("{0:d4}", iProductCode); bag = new AbcrcERBillBag(); quantity = string.Format("{0:d5}", ssi.Quantity); if (ssi.TagNumber.Length < 8) { Int32.TryParse(ssi.TagNumber, out intNumber); tagNumber = string.Format("{0:d7}", intNumber); strValue = vendorId + productCode + quantity + tagNumber; } else if (ssi.TagNumber.Length == 20) { strValue = ssi.TagNumber; } else { string m = String.Format("Tag Number {0} has the wrong number of digits. eR-Bill can't be processed. Please correct the Tag Number and submit the eR-Bill again.", ssi.TagNumber); MessageBox.Show("", m, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } bag.BagTag = strValue; //sol_Stage.TagNumber bag.ItemTypeCrisID = iProductCode; bag.ShippingContainerTypeCrisID = sol_Container.ShippingContainerTypeID; bag.UnitsShipped = ssi.Quantity; //ssi.Dozen * 12; //KEV - this was fixed in 5.0.4. Dozens are not used. if (checkBoxViewERBill.Checked) { addItem(bag.BagTag, bag.ItemTypeCrisID, bag.ShippingContainerTypeCrisID, bag.UnitsShipped, ref eRBill_CheckList_ListView.listView1); } eRBill.Bags[nBags++] = bag; //end loop } //process empty containers foreach (Sol_SupplyInventory ssi in sol_SupplyInventoryList) { //bag tag ? //Item Type ID //Shipping Container Type ID //Units Shipped //get ShippingContainerID for ItemTypeCrisID sol_Container = sol_Container_Sp.Select(ssi.ContainerID); //} if (ssi.ProductID < 1) { //Empty Bags - EmptyContainer //empty bags aosc = new AbcrcOtherShippingContainer(); //eRBill.AdditionalShippingContainers = new AbcrcOtherShippingContainer[1]; aosc.ShippingContainerTypeCrisID = sol_Container.ShippingContainerTypeID; aosc.ContainersShipped = ssi.Quantity; if (checkBoxViewERBill.Checked) { addItem("", 0, aosc.ShippingContainerTypeCrisID, aosc.ContainersShipped, ref eRBill_CheckList_ListView.listView2); } eRBill.AdditionalShippingContainers[nAosc++] = aosc; } } AbcrcValidationResponse response = client.ValidateErBill(eRBill); string c = String.Empty; foreach (AbcrcValidationMessage m in response.ValidationMessages) { c = c + "\r\n" + m.ValidationMessage; } c = c + "\r\n" + response.ErrorMessage; if (response.Error == false && response.IsValid == true) { //MessageBox.Show("Validation passed successful!"); c = String.Empty; //submit AbcrcSubmitResponse submitResponse = client.SubmitErBill(eRBill); foreach (AbcrcValidationMessage m in submitResponse.ValidationMessages) { c = c + "\r\n" + m.ValidationMessage; } c = c + "\r\n" + submitResponse.ErrorMessage; if (!(submitResponse.Error == false && submitResponse.IsValid == true)) { //CajaDeMensaje.Show("", "Validation not passed successful, debug it!", c, CajaDeMensajeImagen.Error); MessageBox.Show(c, "Even thought the erBill validation was succesfull, it was not received by the agency!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } } else { //CajaDeMensaje.Show("", "Validation not passed successful, debug it!", c, CajaDeMensajeImagen.Error); MessageBox.Show(c, "Validation not passed successful, debug it!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } } catch (Exception exception) { //MessageBox.Show(exception.Message); //CajaDeMensaje.Show("", exception.Message, exception.InnerException.Message, CajaDeMensajeImagen.Error); string m1 = String.Empty; try { m1 = exception.InnerException.Message; } catch { m1 = "Error when trying to create and validate eRBill's object. "; } //string m2 = exception.Message; MessageBox.Show(exception.Message, m1, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(true); }
private void Inventory_Load(object sender, EventArgs e) { if (Properties.Settings.Default.TouchOriented) { toolStripButtonVirtualKb.Visible = true; } //FullScreenMode if (Properties.Settings.Default.SettingsAdFullScreenMode) { this.WindowState = FormWindowState.Maximized; } else { this.WindowState = FormWindowState.Normal; } //años //ejemplo: int aa = Main.rc.FechaActual.Year; // System.DateTime.Now.Year; // 2010 año actual computadora byte ah = Main.Sol_ControlInfo.HistoryYears; // -5 años de historia //----- int uah = aa - ah; // 2005 ultimo año de historia string c = Main.rc.FechaActual.ToString(); // DateTime.Now.ToString(); flagInicio = true; dateTimePickerTo.MaxDate = Main.rc.FechaActual; dateTimePickerTo.Value = dateTimePickerTo.MaxDate; flagInicio = false; dateFrom = null; dateTo = null; UpdateDataSets(); //classes of tables sol_Shipment = new Sol_Shipment(); sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_ShipmentList = new List <Sol_Shipment>(); sol_Stage = new Sol_Stage(); sol_Stage_Sp = new Sol_Stage_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_StageList = new List <Sol_Stage>(); //disable form resizing this.FormBorderStyle = FormBorderStyle.FixedSingle; //listview with headers listViewUnstagedProducts.View = View.Details; listViewUnstagedProducts.Columns.Add("Category", 160, HorizontalAlignment.Left); listViewUnstagedProducts.Columns.Add("Quantity", 100, HorizontalAlignment.Right); listViewUnstagedProducts.Columns.Add("Dozen", 90, HorizontalAlignment.Right); listViewUnstagedProducts.Columns.Add("Amount", 120, HorizontalAlignment.Right); listViewUnstagedProducts.FullRowSelect = true; //listViewCurrentStagedContainers.CheckBoxes = true; listViewUnstagedProducts.GridLines = true; //listView1.Activation = ItemActivation.OneClick; //listViewUnstagedProducts.FullRowSelect = true; //listViewUnstagedProducts.GridLines = true; listViewUnstagedProducts.LabelEdit = false; // true; listViewUnstagedProducts.columnEditable = 1; //-1 = all //listview with headers listViewStagedProducts.View = View.Details; listViewStagedProducts.Columns.Add("Product Category", 175, HorizontalAlignment.Left); listViewStagedProducts.Columns.Add("Quantity", 100, HorizontalAlignment.Right); listViewStagedProducts.Columns.Add("Dozen", 90, HorizontalAlignment.Right); listViewStagedProducts.Columns.Add("Amount", 120, HorizontalAlignment.Right); listViewStagedProducts.GridLines = true; //array to store categoryid this.arrayListViewCategoryId = new ArrayList(); this.arrayListViewQuantity = new ArrayList(); this.arrayListViewRefundAmount = new ArrayList(); ReadProducts(dataSetProductsUnstaged.Tables[0], listViewUnstagedProducts, labelUnstagedTotalQuantity, labelUnstagedTotalAmount, false, "Unstaged"); ReadProducts(dataSetProductsStaged.Tables[0], listViewStagedProducts, labelStagedTotalQuantity, labelStagedTotalAmount, false, "Staged"); //training warning if (Properties.Settings.Default.SQLBaseDeDatos == "Solum_Training") { toolStripStatusLabelTrainingMode.Visible = true; Main.tslCntr = toolStripStatusLabelTrainingMode; Main.timerBlink.Enabled = true; } }
private void ShippingLookup_Load(object sender, EventArgs e) { ShipmentButtonAdjustment = false; //classes of tables sol_Shipment = new Sol_Shipment(); sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_ShipmentList = new List <Sol_Shipment>(); sol_Stage = new Sol_Stage(); sol_Stage_Sp = new Sol_Stage_Sp(Properties.Settings.Default.WsirDbConnectionString); sol_StageList = new List <Sol_Stage>(); toolStrip1.Renderer = new App_Code.NewToolStripRenderer(); //años int aa = Main.rc.FechaActual.Year; byte ah = Main.Sol_ControlInfo.HistoryYears; int uah = aa - ah; dateTimePickerFrom.MinDate = DateTime.Parse(String.Format("{0}-1-1", uah)); dateTimePickerFrom.MaxDate = Main.rc.FechaActual; dateTimePickerFrom.Value = dateTimePickerFrom.MaxDate; dateTimePickerTo.MinDate = dateTimePickerFrom.MaxDate; dateTimePickerTo.MaxDate = dateTimePickerFrom.MaxDate; dateTimePickerTo.Value = dateTimePickerFrom.MaxDate; if (Properties.Settings.Default.TouchOriented) { toolStripButtonVirtualKb.Visible = true; } //clock object obj1 = toolStripStatusLabelToday; object obj2 = toolStripStatusLabelTimer; Main.rc.CambiarControlFecha(ref obj1); Main.rc.CambiarControlHora(ref obj2); //disable form resizing //this.FormBorderStyle = FormBorderStyle.FixedSingle; //dataGridViewCurrentShipment //this.dataGridViewCurrentShipment.CellBorderStyle = DataGridViewCellBorderStyle.None; //this.dataGridViewCurrentShipment.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; //this.dataGridViewCurrentShipment.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; //this.dataGridViewCurrentShipment.GridColor = Color.Black; //this.dataGridViewCurrentShipment.BorderStyle = BorderStyle.Fixed3D; //this.dataGridViewCurrentShipment.CellBorderStyle = DataGridViewCellBorderStyle.None; //this.dataGridViewCurrentShipment.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; //this.dataGridViewCurrentShipment.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; //listview with headers listViewContainersOnShipment.View = View.Details; //listViewContainersOnShipment.Columns.Add("Tag #", 190, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Product", 170, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Left); //listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Tag #", 190, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Product", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Quantity", 80, HorizontalAlignment.Right); listViewContainersOnShipment.Columns.Add("Container", 170, HorizontalAlignment.Left); listViewContainersOnShipment.Columns.Add("Dozen", 80, HorizontalAlignment.Right); //listViewContainersOnShipment.FullRowSelect = true; //listViewContainersOnShipment.CheckBoxes = true; listViewContainersOnShipment.GridLines = true; //listViewContainersOnShipment.Activation = ItemActivation.OneClick; //read shipments ready to be shippped ReadCurrentShipments(); //training warning if (Properties.Settings.Default.SQLBaseDeDatos == "Solum_Training") { toolStripStatusLabelTrainingMode.Visible = true; Main.tslCntr = toolStripStatusLabelTrainingMode; Main.timerBlink.Enabled = true; } //initialFlag = false; CheckUserPermissions(); if (Properties.Settings.Default.StagingType == 0) //!Properties.Settings.Default.MultiProductStagingEnabled) { toolStripSeparatorMultiProductStaging.Visible = false; toolStripButtonMultiProductStaging.Visible = false; } //originally in Solum //if (!(Main.Sol_ControlInfo.State == "AB" // && Main.QuickDrop_DepotID != null && Main.QuickDrop_DepotID.Length == 6) // ) //{ // buttoneRBill.Visible = false; // //buttonPrintRBill // //buttonUnNow // //this.buttoneRBill.Location = new System.Drawing.Point(604, 5); // this.buttonPrintRBill.Location = new System.Drawing.Point(604, 5); //new System.Drawing.Point(721, 5); // this.buttonUnNow.Location = new System.Drawing.Point(721, 5); //new System.Drawing.Point(838, 5); //} }
private void buttonPrintRBill_Click(object sender, EventArgs e) { dataGridViewCurrentShipment.Focus(); if (dataGridViewCurrentShipment.SelectedRows.Count < 1) { MessageBox.Show("Please select a Shipment to print", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } RBillNumber = dataGridViewCurrentShipment.SelectedRows[0].Cells[0].Value.ToString(); string status = dataGridViewCurrentShipment.SelectedRows[0].Cells[3].Value.ToString(); string strShipmentId = dataGridViewCurrentShipment.SelectedRows[0].Cells[5].Value.ToString(); string agencyName = dataGridViewCurrentShipment.SelectedRows[0].Cells[1].Value.ToString(); string rBillDate = dataGridViewCurrentShipment.SelectedRows[0].Cells[2].Value.ToString(); if (status != "S") { MessageBox.Show("Only shipped Shipments can be printed.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } this.Cursor = Cursors.WaitCursor; if (agencyName.Trim().ToLower() == "abcrc") { int shipmentId = 0; Int32.TryParse(strShipmentId, out shipmentId); if (sol_Shipment_Sp == null) { sol_Shipment_Sp = new Sol_Shipment_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_Shipment = sol_Shipment_Sp.Select(shipmentId); if (sol_WS_Carrier_Sp == null) { sol_WS_Carrier_Sp = new Sol_WS_Carrier_Sp(Properties.Settings.Default.WsirDbConnectionString); } sol_WS_Carrier = sol_WS_Carrier_Sp.Select(sol_Shipment.CarrierID); if (sol_WS_Carrier == null) { sol_WS_Carrier = new Sol_WS_Carrier(); sol_WS_Carrier.CarrierID = 0; sol_WS_Carrier.Carrier = String.Empty; } ShippingShipments.UpdateDataSetBol2(shipmentId, RBillNumber); ShippingShipments.PrintBol2( shipmentId, RBillNumber, sol_Shipment.ShippedDate.ToString(), sol_WS_Carrier.Carrier, sol_Shipment.TrailerNumber, sol_Shipment.ProBillNumber ); } else { ShippingShipments.PrintRBill(strShipmentId); } this.Cursor = Cursors.Default; }