예제 #1
0
        private void BindOBDetails(string pObCode)
        {
            using (OfficialBusiness ob = new OfficialBusiness(pObCode))
            {
                ob.Fill();
                lblOBCode.Text       = pObCode;
                lblOBType.Text       = OfficialBusiness.GetOBTypeDesc(ob.OBType);
                lblOBDepartment.Text = Department.GetName(ob.DepartmentCode);
                lblOBRequestor.Text  = Employee.GetName(ob.UserName);
                lblOBDateFile.Text   = ob.DateFile.ToString("MMM dd, yyyy hh:mm tt");
                lblOBReason.Text     = ob.Reason;
                lblOBRApprover.Text  = (ob.OBType == "1" ? Employee.GetName(ob.RAName) : "NA");
                lblOBRDate.Text      = (ob.OBType == "1" ? ob.RADate.ToString("MM-dd-yyyy") : "NA");
                lblOBRRemarks.Text   = (ob.OBType == "1" ? ob.RARemarks : "NA");
                lblOBHApprover.Text  = Employee.GetName(ob.HAName);
                lblOBHDate.Text      = ob.HADate.ToString("MM-dd-yyyy");
                lblOBHRemarks.Text   = ob.HARemarks;
                lblOBStatus.Text     = LeaveApplication.ToLeaveStatusDesc(ob.Status);
            }

            lvOBDetails.Items.Clear();
            DataTable tblOBDetails = OfficialBusinessDetails.DataTableByOBCode(pObCode);

            foreach (DataRow drw in tblOBDetails.Rows)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Text = clsValidator.CheckDate(drw["focsdate"].ToString()).ToString("MMM dd, yyyy");
                lvi.SubItems.Add(clsValidator.CheckDate(drw["keyin"].ToString()).ToString("MMM dd, yyyy hh:mm tt"));
                lvi.SubItems.Add(clsValidator.CheckDate(drw["keyout"].ToString()).ToString("MMM dd, yyyy hh:mm tt"));

                lvOBDetails.Items.Add(lvi);
            }
        }
예제 #2
0
        public void LoadOBDetails()
        {
            lvOBDetails.Items.Clear();
            DataTable tblOBDetails = OfficialBusinessDetails.DataTableByOBCode(_strOBCode);

            foreach (DataRow drw in tblOBDetails.Rows)
            {
                ListViewItem lvi = new ListViewItem();
                lvi.Text = clsValidator.CheckDate(drw["focsdate"].ToString()).ToString("MMM dd, yyyy");
                lvi.Tag  = drw["focsdate"].ToString();
                lvi.SubItems.Add(clsValidator.CheckDate(drw["keyin"].ToString()).ToString("MMM dd, yyyy hh:mm tt"));
                lvi.SubItems.Add(clsValidator.CheckDate(drw["keyout"].ToString()).ToString("MMM dd, yyyy hh:mm tt"));
                lvOBDetails.Items.Add(lvi);
            }

            if (lvOBDetails.Items.Count > 0)
            {
                lvOBDetails.Items[0].Selected = true;
            }
        }