private void btnUpdateBillImport_Click(object sender, EventArgs e) { try { if (txtIDBillImport.Text == "") { XtraMessageBox.Show("You have to choose at least one invoice to update", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } PostInvoice_DTO invoice = new PostInvoice_DTO(); invoice.TransID = Convert.ToInt32(dtgvInfoListOfBillImport.CurrentRow.Cells["TransID"].Value); invoice.VendorID = Convert.ToInt32(txtVendorId.Text); invoice.CreateDate = Convert.ToDateTime(dtpkDateTimeImport.Text.ToString()); if (PostInvoice_BUS.UpdatePostInvoice(invoice)) { LoadPostInvoice(); uctVendor.uctVendorInfo.LoadVendorList(); XtraMessageBox.Show("Update Post Invoice Successfully", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearDisplay(); return; } }catch { XtraMessageBox.Show("Update Post Invoice Failed!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void btnDeleteBillImport_Click(object sender, EventArgs e) { try { if (txtIDBillImport.Text == "") { XtraMessageBox.Show("You have to choose at least one invoice to delete", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } PostInvoice_DTO invoice = new PostInvoice_DTO(); invoice.TransID = Convert.ToInt32(dtgvInfoListOfBillImport.CurrentRow.Cells["TransID"].Value); if (PostInvoice_BUS.DeletePostInvoice(invoice)) { LoadPostInvoice(); uctVendor.uctVendorInfo.LoadVendorList(); XtraMessageBox.Show("Delete Post Invoice Successfully", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearDisplay(); return; } } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void btnAddImportBill_Click(object sender, EventArgs e) { try { if (txtIDBillImport.Text == "" || txtVendorId.Text == "" || cmbIDAgency.Text == "") { XtraMessageBox.Show("Missing Information!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } PostInvoice_DTO postInvoice = new PostInvoice_DTO(); postInvoice.TransID = Convert.ToInt32(txtIDBillImport.Text); postInvoice.VendorID = Convert.ToInt32(txtVendorId.Text.ToString()); postInvoice.CreateDate = Convert.ToDateTime(dtpkDateTimeImport.Text.ToString()); postInvoice.VendorName = cmbIDAgency.Text.ToString(); postInvoice.TotalPrice = 0; if (PostInvoice_BUS.InsertPostInvoice(postInvoice)) { XtraMessageBox.Show("Insert Post Invoice Successfully!", "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information); cmbIDBillImportDetail.Text = txtIDBillImport.Text; ClearDisplay(); uctVendor.uctVendorInfo.LoadVendorList(); LoadPostInvoice(); return; } } catch { XtraMessageBox.Show("Insert Post Invoice Failed!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void LoadPostInvoice() { List <PostInvoice_DTO> listInvoice = PostInvoice_BUS.PostInvoiceLoad(); dtgvInfoListOfBillImport.DataSource = listInvoice; }