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); } }
private void btnSave_Click(object sender, EventArgs e) { using (OfficialBusiness ob = new OfficialBusiness()) { ob.OBCode = _strOBCode; ob.Fill(); ob.DateFile = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value); ob.Reason = txtReason.Text; if (_strOBType == "1") { ob.RADate = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value); ob.RARemarks = txtRRemarks.Text; ob.RAStatus = cmbRStatus.SelectedValue.ToString(); } ob.HADate = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value); ob.HARemarks = txtHRemarks.Text; ob.HAStatus = cmbHStatus.SelectedValue.ToString(); ob.Status = cmbStatus.SelectedValue.ToString(); if (ob.UpdateAdmin() > 0) { _frmOBList.BindOBList(); this.Close(); MessageBox.Show("Official Business Leave has been filed successfully", "OB Leave", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void btnSave_Click(object sender, EventArgs e) { using (OfficialBusiness ob = new OfficialBusiness()) { ob.OBCode = _strOBCode; ob.Fill(); ob.DateFile = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value); ob.Reason = txtReason.Text; if (_strOBType == "1") { ob.RADate = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value); ob.RARemarks = txtRRemarks.Text; ob.RAStatus = cmbRStatus.SelectedValue.ToString(); } ob.HADate = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value); ob.HARemarks = txtHRemarks.Text; ob.HAStatus = cmbHStatus.SelectedValue.ToString(); ob.Status = cmbStatus.SelectedValue.ToString(); if (ob.UpdateAdmin() > 0) { _frmOBList.BindOBList(); this.Close(); } } }
private void BindDetails() { cmbStatus.DataSource = OfficialBusiness.DdlDsStatus(); cmbStatus.ValueMember = "pvalue"; cmbStatus.DisplayMember = "ptext"; cmbRStatus.DataSource = OfficialBusiness.DdlDsStatusApprover(); cmbRStatus.ValueMember = "pvalue"; cmbRStatus.DisplayMember = "ptext"; cmbHStatus.DataSource = OfficialBusiness.DdlDsStatusApprover(); cmbHStatus.ValueMember = "pvalue"; cmbHStatus.DisplayMember = "ptext"; txtOBCode.Text = _strOBCode; using (OfficialBusiness objOfficialBusiness = new OfficialBusiness()) { objOfficialBusiness.OBCode = _strOBCode; objOfficialBusiness.Fill(); txtRequestor.Text = Employee.GetName(objOfficialBusiness.UserName); _strOBType = objOfficialBusiness.OBType; txtOBtype.Text = OfficialBusiness.GetOBTypeDesc(objOfficialBusiness.OBType); txtRenderTo.Text = Department.GetName(objOfficialBusiness.DepartmentCode); dtpFileDate.Value = objOfficialBusiness.DateFile; dtpFileTime.Value = objOfficialBusiness.DateFile; txtReason.Text = objOfficialBusiness.Reason; if (objOfficialBusiness.OBType == "1") { txtRApprover.Text = Employee.GetName(objOfficialBusiness.RAName); dtpRDate.Value = objOfficialBusiness.RADate; dtpRTime.Value = objOfficialBusiness.RADate; cmbRStatus.SelectedValue = objOfficialBusiness.RAStatus; txtRRemarks.Text = objOfficialBusiness.RARemarks; } else { txtRApprover.Visible = false; dtpRDate.Visible = false; dtpRTime.Visible = false; cmbRStatus.Visible = false; txtRRemarks.Visible = false; lblRApprover.Visible = false; lblRStatus.Visible = false; lblRRemarks.Visible = false; } txtHApprover.Text = Employee.GetName(objOfficialBusiness.HAName); dtpHDate.Value = objOfficialBusiness.HADate; dtpHTime.Value = objOfficialBusiness.HADate; cmbHStatus.SelectedValue = objOfficialBusiness.HAStatus; txtHRemarks.Text = objOfficialBusiness.HARemarks; cmbStatus.SelectedValue = objOfficialBusiness.Status; } LoadOBDetails(); }