Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <TBL_LOGSHEET_INQUIRY>      list  = new List <TBL_LOGSHEET_INQUIRY>();
            List <AddInquiryCetificateClass> listo = new List <AddInquiryCetificateClass>();

            using (var db = new PETC_LogsheetEntities())
            {
                list = db.TBL_LOGSHEET_INQUIRY.ToList();
                foreach (var item in list)
                {
                    AddInquiryCetificateClass tbl = new AddInquiryCetificateClass();
                    tbl.LOG_DATE        = Convert.ToDateTime(item.LOG_DATE);
                    tbl.LOG_PETCNAME    = item.LOG_PETCNAME;
                    tbl.LOG_RECEIVEDVIA = item.LOG_RECEIVEDVIA;
                    tbl.LOG_RECEIVEDBY  = item.LOG_DTLINQUIRY;
                    tbl.LOG_DATE        = Convert.ToDateTime(item.LOG_DATE);
                    tbl.LOG_DTLINQUIRY  = item.LOG_DTLINQUIRY;
                    tbl.LOG_ACTTAKEN    = item.LOG_ACTTAKEN;
                    tbl.LOG_TMECMPLTED  = Convert.ToDateTime(item.LOG_TMECMPLTED);
                    tbl.LOG_REMARKS     = item.LOG_REMARKS;
                    var resp = item.LOG_DATE.Value - item.LOG_TMECMPLTED.Value;
                    tbl.LOG_RESPONSE = Convert.ToString(resp.Duration());
                    listo.Add(tbl);
                }
            }
            CrystalReport1 rpt = new CrystalReport1();

            rpt.SetDataSource(listo);
            crystalReportViewer1.ReportSource = rpt;
        }
        public void refreshList()
        {
            db_LogsheetUtil          = new PETC_LogsheetEntities();
            dataGridView1.DataSource = db_LogsheetUtil.TBL_LOGSHEET_INQUIRY.ToList();
            //dtaGridMenu.Columns["ID"].DisplayIndex = 0;
            dataGridView1.Columns["LOG_DATE"].DefaultCellStyle.Format = "yy/MM/dd";
            dataGridView1.Columns["LOG_PETCCODE"].Visible             = false;
            //dtaGridMenu.Columns["LOG_PETCNAME"].DisplayIndex = 2;
            //dtaGridMenu.Columns["LOG_RECEIVEDVIA"].DisplayIndex = 3;
            //dtaGridMenu.Columns["LOG_RECEIVEDBY"].DisplayIndex = 4;
            dataGridView1.Columns["LOG_TMERECEIVE"].DefaultCellStyle.Format = "HH:mm";
            //dtaGridMenu.Columns["LOG_DTLINQUIRY"].DisplayIndex = 6;
            dataGridView1.Columns["LOG_TMECMPLTED"].DefaultCellStyle.Format = "HH:mm";
            //dtaGridMenu.Columns["LOG_ACTTAKEN"].DisplayIndex = 8;
            //dtaGridMenu.Columns["LOG_REMARKS"].DisplayIndex = 9;
            dataGridView1.Columns["LOG_RESPONSE"].DefaultCellStyle.Format = "HH:mm";
            dataGridView1.Columns["LOG_ENCODED"].Visible      = false;
            dataGridView1.Columns["LOG_DATELOG"].Visible      = false;
            dataGridView1.Columns["LOG_REGISTRYCODE"].Visible = false;
            dataGridView1.Columns["LOG_CERTIFICATE"].Visible  = false;



            dataGridView1.Columns["LOG_DATE"].HeaderText = "DATE";
            //dtaGridMenu.Columns["LOG_PETCCODE"].HeaderText = "PETC CODE";
            dataGridView1.Columns["LOG_PETCNAME"].HeaderText    = "PETC NAME";
            dataGridView1.Columns["LOG_RECEIVEDVIA"].HeaderText = "RECEIVE VIA";
            dataGridView1.Columns["LOG_RECEIVEDBY"].HeaderText  = "RECEIVE BY";
            dataGridView1.Columns["LOG_DATE"].HeaderText        = "TIME RECEIVE";
            dataGridView1.Columns["LOG_DTLINQUIRY"].HeaderText  = "DETAIL INQUIRY";
            dataGridView1.Columns["LOG_TMECMPLTED"].HeaderText  = "TIME COMPLETED";
            dataGridView1.Columns["LOG_ACTTAKEN"].HeaderText    = "ACTION TAKEN";
            dataGridView1.Columns["LOG_REMARKS"].HeaderText     = "REMARKS";
            dataGridView1.Columns["LOG_RESPONSE"].HeaderText    = "RESPONSE TIME";
        }
        private void AddInquiryCertificate_Load(object sender, EventArgs e)
        {
            //VIEWING DATA IN DATAGRID

            db_LogsheetUtil          = new PETC_LogsheetEntities();
            dataGridView1.DataSource = db_LogsheetUtil.TBL_LOGSHEET_INQUIRY.ToList();
            dataGridView1.Columns["LOG_DATE"].DefaultCellStyle.Format       = "yy/MM/dd";
            dataGridView1.Columns["LOG_PETCCODE"].Visible                   = false;
            dataGridView1.Columns["LOG_TMERECEIVE"].DefaultCellStyle.Format = "HH:mm";
            dataGridView1.Columns["LOG_TMECMPLTED"].DefaultCellStyle.Format = "HH:mm";
            dataGridView1.Columns["LOG_RESPONSE"].DefaultCellStyle.Format   = "HH:mm";
            dataGridView1.Columns["LOG_ENCODED"].Visible      = false;
            dataGridView1.Columns["LOG_DATELOG"].Visible      = false;
            dataGridView1.Columns["LOG_REGISTRYCODE"].Visible = false;
            dataGridView1.Columns["LOG_CERTIFICATE"].Visible  = false;



            dataGridView1.Columns["LOG_DATE"].HeaderText        = "DATE";
            dataGridView1.Columns["LOG_PETCNAME"].HeaderText    = "PETC NAME";
            dataGridView1.Columns["LOG_RECEIVEDVIA"].HeaderText = "RECEIVE VIA";
            dataGridView1.Columns["LOG_RECEIVEDBY"].HeaderText  = "RECEIVE BY";
            dataGridView1.Columns["LOG_DATE"].HeaderText        = "TIME RECEIVE";
            dataGridView1.Columns["LOG_DTLINQUIRY"].HeaderText  = "DETAIL INQUIRY";
            dataGridView1.Columns["LOG_TMECMPLTED"].HeaderText  = "TIME COMPLETED";
            dataGridView1.Columns["LOG_ACTTAKEN"].HeaderText    = "ACTION TAKEN";
            dataGridView1.Columns["LOG_REMARKS"].HeaderText     = "REMARKS";
            dataGridView1.Columns["LOG_RESPONSE"].HeaderText    = "RESPONSE TIME";

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

            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;
            btnSave.Enabled             = false;
            btnUpdate.Enabled           = false;
        }