Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            tblMSRReceiptsTableAdapter dAdapter = new tblMSRReceiptsTableAdapter();

            if (!IsEditMode)
            {
                if (IsValidEntry())
                {
                    dAdapter.InsertMSRReceipt(txtMSRNo.Text, dtpMSRDate.Value, dtpReceivedDate.Value, dtpRequiredDate.Value, Convert.ToInt16(txtNosofItems.Text), txtRequestor.Text, txtDepartment.Text, txtApprovedBy.Text, txtProject.Text, cboBuyer.Text, txtDescription.Text, 10);
                    MessageBox.Show("New MSR Receipt Entered Succesfully", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    this.tblMSRReceiptsTableAdapter.Fill(this.pOCS.tblMSRReceipts);
                }
                else
                {
                    MessageBox.Show("Please Check the Entries for Validity", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                if (IsValidEntry())
                {
                    dAdapter.UpdateMSRReceipt(txtMSRNo.Text, dtpMSRDate.Value, dtpReceivedDate.Value, dtpRequiredDate.Value, Convert.ToInt16(txtNosofItems.Text), txtRequestor.Text, txtDepartment.Text, txtApprovedBy.Text, txtProject.Text, cboBuyer.Text, txtDescription.Text, decMSRId);
                    MessageBox.Show("MSR Receipt Information Updated Succesfully", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    this.tblMSRReceiptsTableAdapter.Fill(this.pOCS.tblMSRReceipts);
                    IsEditMode = false;
                }
                else
                {
                    MessageBox.Show("Please Check the Entries for Validity", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }
Ejemplo n.º 2
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         tblMSRReceiptsTableAdapter adpStatusAdapter = new tblMSRReceiptsTableAdapter();
         adpStatusAdapter.UpdateMSRStatusbyMSRNo(Convert.ToInt16(cboStatus.SelectedValue), cboMsrNo.Text);
         MessageBox.Show("Status Updated Successfully", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     catch
     { }
 }