private void btnApprove_Click_1(object sender, EventArgs e) { try { MaterialDeliveryDetailDB MDDB = new MaterialDeliveryDetailDB(); DialogResult dialog = MessageBox.Show("Are you sure to Finalize the document ?", "Yes", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { if (status == 1) { if (MDDB.FinalizeDetails(MatDel)) { MessageBox.Show(" Document Finalized"); //if (!updateDashBoard(prevpopi, 2)) //{ // MessageBox.Show("DashBoard Fail to update"); //} closeAllPanels(); listOption = 1; ListFilteredMaterialDeliveryDetail(listOption); setButtonVisibility("btnEditPanel"); } } else { MessageBox.Show("DeliveryStatus is null"); } } } catch (Exception) { } }
private void ListDocument(int opt) { try { grdList.Rows.Clear(); MaterialDeliveryDetailDB dbrecord = new MaterialDeliveryDetailDB(); ////List<materialdelivery> Documents = dbrecord.getFilteredMaterialdetail(opt); ////foreach (materialdelivery doc in Documents) ////{ //// grdList.Rows.Add(); //// grdList.Rows[grdList.RowCount - 1].Cells["gDeliveryDocumentType"].Value = doc.DocumentType; //// grdList.Rows[grdList.RowCount - 1].Cells["gDocumentNo"].Value = doc.DocumentNo; //// grdList.Rows[grdList.RowCount - 1].Cells["gDocumentDate"].Value = doc.DocumentDate; //// grdList.Rows[grdList.RowCount - 1].Cells["gConsignee"].Value = doc.consignee; //// grdList.Rows[grdList.RowCount - 1].Cells["gCourierID"].Value = doc.courierID; //// grdList.Rows[grdList.RowCount - 1].Cells["gTransportationMode"].Value = doc.transportationMode; //// grdList.Rows[grdList.RowCount - 1].Cells["gLRNo"].Value = doc.LRNo; //// grdList.Rows[grdList.RowCount - 1].Cells["gLRDate"].Value = doc.LRDate; //// grdList.Rows[grdList.RowCount - 1].Cells["gDeliveryDate"].Value = doc.DeliveryDate; //// grdList.Rows[grdList.RowCount - 1].Cells["gRemarks"].Value = doc.Remarks; //// grdList.Rows[grdList.RowCount - 1].Cells["gStatus"].Value = doc.status; //// grdList.Rows[grdList.RowCount - 1].Cells["gCreateTime"].Value = doc.CreateTime; //// grdList.Rows[grdList.RowCount - 1].Cells["gCreateUser"].Value = doc.CreateUser; //// grdList.Rows[grdList.RowCount - 1].Cells["gDeliveryStatus"].Value = setStatus(doc.DeliveryStatus); ////} } catch (Exception ex) { MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error"); } enableBottomButtons(); pnlDocumentList.Visible = true; }
private void button1_Click(object sender, EventArgs e) { /// btnInvoiceSelect.Enabled = false; //removeControlsFromLVPanel(); //pnlAddEdit.Controls.Remove(pnlv); //pnlv = new Panel(); //pnlv.BorderStyle = BorderStyle.FixedSingle; //pnlv.Bounds = new Rectangle(new Point(311, 46), new Size(566, 281)); frmPopup = new Form(); frmPopup.StartPosition = FormStartPosition.CenterScreen; frmPopup.BackColor = Color.CadetBlue; frmPopup.MaximizeBox = false; frmPopup.MinimizeBox = false; frmPopup.ControlBox = false; frmPopup.FormBorderStyle = FormBorderStyle.FixedSingle; frmPopup.Size = new Size(450, 300); lv = MaterialDeliveryDetailDB.getInvoiceOutListView(); lv.ColumnClick += new ColumnClickEventHandler(LvColumnClick); //this.lv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listView1_ItemChecked2); lv.Bounds = new Rectangle(new Point(0, 0), new Size(450, 250)); frmPopup.Controls.Add(lv); Button lvOK = new Button(); lvOK.BackColor = Color.Tan; lvOK.Text = "OK"; lvOK.Location = new Point(40, 265); lvOK.Click += new System.EventHandler(this.lvOK_Click4); frmPopup.Controls.Add(lvOK); Button lvCancel = new Button(); lvCancel.BackColor = Color.Tan; lvCancel.Text = "CANCEL"; lvCancel.Location = new Point(130, 265); lvCancel.Click += new System.EventHandler(this.lvCancel_Click4); frmPopup.Controls.Add(lvCancel); frmPopup.ShowDialog(); //pnlAddEdit.Controls.Add(pnlv); //pnlv.BringToFront(); //pnlv.Visible = true; }
private void ListFilteredMaterialDeliveryDetail(int option) { try { grdList.Rows.Clear(); MaterialDeliveryDetailDB MaterialDetDB = new MaterialDeliveryDetailDB(); List <materialdelivery> materialdel = MaterialDetDB.getFilteredMaterialdetail(option); if (option == 1) { lblActionHeader.Text = "List of Action Pending Documents"; } else if (option == 2) { lblActionHeader.Text = "Finalized"; } foreach (materialdelivery mdd in materialdel) { grdList.Rows.Add(); grdList.Rows[grdList.RowCount - 1].Cells["gDocumentType"].Value = mdd.DocumentType; grdList.Rows[grdList.RowCount - 1].Cells["gDocumentNo"].Value = mdd.DocumentNo; grdList.Rows[grdList.RowCount - 1].Cells["gDocumentDate"].Value = mdd.DocumentDate; grdList.Rows[grdList.RowCount - 1].Cells["gConsignee"].Value = mdd.consignee; grdList.Rows[grdList.RowCount - 1].Cells["gCourierID"].Value = mdd.courierID; grdList.Rows[grdList.RowCount - 1].Cells["gTransportaionMode"].Value = mdd.transportationMode; grdList.Rows[grdList.RowCount - 1].Cells["gLRNo"].Value = mdd.LRNo; grdList.Rows[grdList.RowCount - 1].Cells["gLRDate"].Value = mdd.LRDate; grdList.Rows[grdList.RowCount - 1].Cells["gRemarks"].Value = mdd.Remarks; grdList.Rows[grdList.RowCount - 1].Cells["gStatus"].Value = mdd.status; grdList.Rows[grdList.RowCount - 1].Cells["gCreateTime"].Value = mdd.CreateTime; grdList.Rows[grdList.RowCount - 1].Cells["gCreateUser"].Value = mdd.CreateUser; grdList.Rows[grdList.RowCount - 1].Cells["gDeliveryStatus"].Value = setStatus(mdd.DeliveryStatus); } } catch (Exception ex) { MessageBox.Show("Error in Maerial Delivery Listing"); } setButtonVisibility("init"); pnlList.Visible = true; }
private void FillDetailDelivery() { MaterialDeliveryDetailDB MaterialDetDB = new MaterialDeliveryDetailDB(); List <materialdelivery> materialdel = MaterialDetDB.getInvoiceDetails(txtDocNo.Text, dtDocDate.Value); try { foreach (materialdelivery mdd in materialdel) { ////////cmbConsignee.SelectedIndex = cmbConsignee.FindString(mdd.consignee); cmbConsignee.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbConsignee, mdd.consignee); ////////cmbCourierID.SelectedIndex = cmbCourierID.FindString(mdd.courierID); cmbCourierID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbCourierID, mdd.courierID); cmbTransportationMode.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbTransportationMode, mdd.transportationMode); } } catch (Exception ex) { } }
private void btnSave_Click(object sender, EventArgs e) { try { materialdelivery matdel = new materialdelivery(); MaterialDeliveryDetailDB MATDB = new MaterialDeliveryDetailDB(); matdel.DocumentDate = dtDocumentDate.Value; matdel.DocumentNo = Convert.ToInt32(txtDocno.Text); matdel.DeliveryDate = dtDeliveryDate.Value; matdel.DeliveryStatus = setStatusstring(cmbDeliveryStatus.SelectedItem.ToString().Trim()); matdel.Remarks = txtRemarks.Text; System.Windows.Forms.Button btn = sender as System.Windows.Forms.Button; string btnText = btn.Text; { if (btnText.Equals("Update")) { if (cmbDeliveryStatus.SelectedItem.ToString() == "In Transit") { if (MATDB.updateMaterialDeliveryStatus(matdel)) { MessageBox.Show("Document Remarks updated"); closeAllPanels(); enableBottomButtons(); ListDocument(2); pnlSelection.Visible = true; pnlDocumentList.Visible = true; } else { MessageBox.Show("Failed to update Document Remarks"); } } else if (cmbDeliveryStatus.SelectedItem.ToString() == "Delivered") { if (validatedelivery()) { if (MATDB.updateDelivery(matdel)) { MessageBox.Show("Document Remarks updated"); closeAllPanels(); enableBottomButtons(); ListDocument(2); pnlSelection.Visible = true; pnlDocumentList.Visible = true; } else { MessageBox.Show("Failed to update Document Remarks"); } } else { MessageBox.Show("vALIDATION FAILED"); } } } } } catch (Exception ex) { MessageBox.Show("Failed Adding / Editing User Data"); } }
private void btnSave_Click_1(object sender, EventArgs e) { Boolean status = true; try { MaterialDeliveryDetailDB Materialdeliverydb = new MaterialDeliveryDetailDB(); materialdelivery materialdel = new materialdelivery(); System.Windows.Forms.Button btn = sender as System.Windows.Forms.Button; string btnText = btnSave.Text; try { if (!verifyAndReworkMaterialDetail()) { MessageBox.Show("Fill all the Details"); return; } materialdel.DocumentID = docID; materialdel.DocumentNo = Convert.ToInt32(txtDocNo.Text); materialdel.DocumentDate = dtDocDate.Value; ////////materialdel.consignee = cmbConsignee.SelectedItem.ToString().Trim().Substring(0, cmbConsignee.SelectedItem.ToString().Trim().IndexOf('-')); materialdel.consignee = ((Structures.ComboBoxItem)cmbConsignee.SelectedItem).HiddenValue; materialdel.LRNo = txtLRNo.Text; materialdel.LRDate = dtLRDate.Value; materialdel.DocumentType = cmbDocType.SelectedItem.ToString().Trim(); ////////materialdel.courierID = cmbCourierID.SelectedItem.ToString().Trim().Substring(0, cmbCourierID.SelectedItem.ToString().Trim().IndexOf('-')).Trim(); materialdel.courierID = ((Structures.ComboBoxItem)cmbCourierID.SelectedItem).HiddenValue; materialdel.transportationMode = ((Structures.ComboBoxItem)cmbTransportationMode.SelectedItem).HiddenValue; } catch (Exception ex) { MessageBox.Show("Validation failed"); return; } if (btnText.Equals("Save")) { materialdel.DeliveryStatus = 1; //created } else { materialdel.DeliveryStatus = MatDel.DeliveryStatus; } if (btnText.Equals("Update")) { if (Materialdeliverydb.updateMaterialDelivery(materialdel)) { MessageBox.Show(" Details updated"); closeAllPanels(); listOption = 1; ListFilteredMaterialDeliveryDetail(listOption); } else { status = false; } if (!status) { MessageBox.Show("Failed to update "); } } else if (btnText.Equals("Save")) { if (Materialdeliverydb.insertMaterialDetail(materialdel)) { MessageBox.Show(" Details Added"); closeAllPanels(); listOption = 1; ListFilteredMaterialDeliveryDetail(listOption); } else { status = false; } if (!status) { MessageBox.Show("Failed to Insert "); } } else { MessageBox.Show(" Validation failed"); return; } } catch (Exception ex) { MessageBox.Show("btnSave_Click_1() : Error"); return; } if (status) { setButtonVisibility("btnEditPanel"); //activites are same for cancel, forward,approve, reverse and save } }