private void btnSave_Click(object sender, EventArgs e)
        {
            //ADDING DATA IN TABLE

            TBL_LOGSHEET_INQUIRY tbl_Inquiry = new TBL_LOGSHEET_INQUIRY();

            tbl_Inquiry.LOG_DATE        = Convert.ToDateTime(dtepckerDATE.Text);
            tbl_Inquiry.LOG_PETCNAME    = cmboxPETC.Text;
            tbl_Inquiry.LOG_RECEIVEDVIA = txtReceivedvia.Text;
            tbl_Inquiry.LOG_RECEIVEDBY  = txtReceivedby.Text;
            tbl_Inquiry.LOG_DTLINQUIRY  = txtDetailsofInquiry.Text;
            tbl_Inquiry.LOG_TMERECEIVE  = dtetimeReceived.Value;
            tbl_Inquiry.LOG_ACTTAKEN    = txtActionTaken.Text;
            tbl_Inquiry.LOG_TMECMPLTED  = dtetmeCompleted.Value;
            tbl_Inquiry.LOG_REMARKS     = richtxtRemarks.Text;
            tbl_Inquiry.LOG_CERTIFICATE = "CERTIFICATE";
            var minus = dtetimeReceived.Value - dtetmeCompleted.Value;

            //tbl_Inquiry.LOG_RESPONSE = minus.Duration().ToString(@"hh\:mm\:ss");

            db_LogsheetUtil.TBL_LOGSHEET_INQUIRY.Add(tbl_Inquiry);
            dataGridView1.Update();
            dataGridView1.Refresh();

            db_LogsheetUtil.SaveChanges();
            MessageBox.Show("Successfully Save");

            cmboxPETC.Text           = string.Empty;
            txtReceivedvia.Text      = string.Empty;
            txtReceivedby.Text       = string.Empty;
            txtDetailsofInquiry.Text = string.Empty;
            txtActionTaken.Text      = string.Empty;
            richtxtRemarks.Text      = string.Empty;

            refreshList();

            cmboxPETC.Enabled           = false;
            txtReceivedby.Enabled       = false;
            txtReceivedvia.Enabled      = false;
            txtDetailsofInquiry.Enabled = false;
            txtActionTaken.Enabled      = false;
            dtepckerDATE.Enabled        = false;
            dtetimeReceived.Enabled     = false;
            dtepckerDATE.Enabled        = false;
            dtetmeCompleted.Enabled     = false;
            richtxtRemarks.Enabled      = false;

            btnNew.Enabled    = true;
            btnSave.Enabled   = false;
            btnUpdate.Enabled = false;
        }
        private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.SelectedRows)
            {
                record_id                = (Int32)row.Cells["Id"].Value;
                dtepckerDATE.Value       = Convert.ToDateTime(row.Cells["LOG_DATE"].Value.ToString());
                cmboxPETC.Text           = row.Cells["LOG_PETCNAME"].Value.ToString();
                txtReceivedby.Text       = row.Cells["LOG_RECEIVEDBY"].Value.ToString();
                txtReceivedvia.Text      = row.Cells["LOG_RECEIVEDVIA"].Value.ToString();
                txtDetailsofInquiry.Text = row.Cells["LOG_DTLINQUIRY"].Value.ToString();
                dtetimeReceived.Value    = Convert.ToDateTime(row.Cells["LOG_TMERECEIVE"].Value.ToString());
                txtActionTaken.Text      = row.Cells["LOG_ACTTAKEN"].Value.ToString();
                dtetmeCompleted.Value    = Convert.ToDateTime(row.Cells["LOG_TMECMPLTED"].Value.ToString());
                richtxtRemarks.Text      = row.Cells["LOG_REMARKS"].Value.ToString();



                TBL_LOGSHEET_INQUIRY tbl = new TBL_LOGSHEET_INQUIRY();
                tbl.LOG_PETCNAME    = cmboxPETC.Text;
                tbl.LOG_RECEIVEDVIA = txtReceivedvia.Text;
                tbl.LOG_RECEIVEDBY  = txtReceivedby.Text;
                tbl.LOG_DTLINQUIRY  = txtDetailsofInquiry.Text;
                tbl.LOG_TMERECEIVE  = dtetimeReceived.Value;
                tbl.LOG_ACTTAKEN    = txtActionTaken.Text;
                tbl.LOG_TMECMPLTED  = dtetmeCompleted.Value;
                tbl.LOG_REMARKS     = richtxtRemarks.Text;

                cmboxPETC.Enabled           = true;
                txtReceivedby.Enabled       = true;
                txtReceivedvia.Enabled      = true;
                txtDetailsofInquiry.Enabled = true;
                txtActionTaken.Enabled      = true;
                dtepckerDATE.Enabled        = true;
                dtetimeReceived.Enabled     = true;
                dtepckerDATE.Enabled        = true;
                dtetmeCompleted.Enabled     = true;
                richtxtRemarks.Enabled      = true;

                btnNew.Enabled    = true;
                btnSave.Enabled   = false;
                btnUpdate.Enabled = true;
            }
        }
Ejemplo n.º 3
0
        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
            TBL_LOGSHEET_INQUIRY tbl_Inquiry = new TBL_LOGSHEET_INQUIRY();

            tbl_Inquiry.LOG_DATE = Convert.ToDateTime(tbl_Inquiry.LOG_DATE);
        }
 public AddInquiryCertificate(TBL_LOGSHEET_INQUIRY tBL_LOGSHEET_INQUIRY)
 {
     // TODO: Complete member initialization
     //this.tBL_LOGSHEET_INQUIRY = tBL_LOGSHEET_INQUIRY;
 }