Beispiel #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (reportNameTextBox.Text == "" || chargesTextBox.Text == "" || ddlDepartment.SelectedValue.ToInt32() == 0)
     {
         MessageBox.Show("Please Provide Department, Report Name and Charges", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         labReportsBindingSource.EndEdit();
         LabReports obj = (LabReports)labReportsBindingSource.Current;
         obj.labDeptID   = ddlDepartment.SelectedValue.ToInt32();
         obj.catID       = cmbxCat.SelectedValue.ToInt32();
         obj.labDeptName = ((LabDepartment)ddlDepartment.SelectedItem).labDeptName;
         obj.reportName  = reportNameTextBox.Text.Trim();
         obj.charges     = chargesTextBox.Text.ToDecimal();
         obj.ETA         = eTATextBox.Text.ToInt32();
         obj.crtBy       = lblUserName.Text;
         obj.crtDate     = DateTime.Now;
         obj.modBy       = lblUserName.Text;
         obj.modDate     = DateTime.Now;
         /*if (ddlDepartment.Text == "Chemistry"){*/
         obj.orderNo           = orderNoTextBox.Text.ToInt32();//}
         obj.isPrintOnNextPage = chkIsprintNext.Checked;
         obj.isHidden          = chkIsHidden.Checked;
         obj.Save();
         pnlMain.Hide();
         fillGrid();
     }
 }
Beispiel #2
0
        private void lblEdit_Click(object sender, EventArgs e)
        {
            LabReports obj = (LabReports)labReportsBindingSource.Current;

            pnlMain.Show();
            ddlDepartment.Focus();
        }
Beispiel #3
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            pnlMain.Hide();
            LabReports us = (LabReports)labReportsBindingSource.Current;

            if (us.reportID == 0)
            {
                labReportsBindingSource.RemoveCurrent();
            }
        }