public static List <ReqisitionListItem> PopulateGridViewForDepartment(List <Requisition> rlist) { itemList = new List <ReqisitionListItem>(); foreach (Requisition r in rlist) { date = r.RequestDate.Value.ToLongDateString(); requisitionNo = Convert.ToInt32(r.RequisitionID.ToString()); status = r.Status.ToString(); int empCode = Convert.ToInt32(r.RequestedBy); employeeName = EFBroker_DeptEmployee.GetEmployeebyEmpID(empCode).EmpName; item = new ReqisitionListItem(date, requisitionNo, department, status, employeeName); itemList.Add(item); } return(itemList); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null && Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; id = Convert.ToInt32(Request.QueryString["id"]); ReqisitionListItem r = RequisitionControl.getRequisitionForApprove(id); lblReqname.Text = r.EmployeeName; lblReqDate.Text = r.Date; lblStatus.Text = r.Status; if (lblStatus.Text.Equals("Approved") || lblStatus.Text.Equals("approved") || lblStatus.Text.Equals("InProgress")) { lblStatus.ForeColor = System.Drawing.Color.Green; } else if (lblStatus.Text.Equals("Pending")) { lblStatus.ForeColor = System.Drawing.Color.Blue; } else if (lblStatus.Text.Equals("Priority")) { lblStatus.ForeColor = System.Drawing.Color.Red; } else { lblStatus.ForeColor = System.Drawing.Color.Black; } if (r.Status.ToString() != "Pending" || EmployeeController.isDeptHaveTempHead(emp.DeptCode)) { ReasonLabel.Visible = false; txtReason.Visible = false; btnApprove.Visible = false; btnReject.Visible = false; } } else { Utility.logout(); } if (!IsPostBack) { showAllItems(); } }
public static List <ReqisitionListItem> PopulateGridView(List <Requisition> rlist) { itemList = new List <ReqisitionListItem>(); foreach (Requisition r in rlist) { date = r.RequestDate.Value.ToLongDateString(); requisitionNo = Convert.ToInt32(r.RequisitionID.ToString()); status = r.Status.ToString(); requestedBy = Convert.ToInt32(r.RequestedBy.ToString()); Department dep = EFBroker_DeptEmployee.GetDepartByEmpID(requestedBy); depCode = dep.DeptCode; department = dep.DeptName; item = new ReqisitionListItem(date, requisitionNo, department, status, requestedBy.ToString()); itemList.Add(item); } return(itemList); }
protected void Page_Load(object sender, EventArgs e) { if (Session["RequisitionNo"] != null) { id = Convert.ToInt32(Session["RequisitionNo"]); ReqisitionListItem r = RequisitionControl.getRequisitionForApprove(id); lblRequestedBy.Text = r.EmployeeName; lblDate.Text = r.Date; lblStatus.Text = r.Status; } else { Utility.logout(); } if (!IsPostBack) { showAllItems(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { id = Convert.ToInt32(Request.QueryString["id"]); ReqisitionListItem r = RequisitionControl.getRequisitionForApprove(id); lblRequestBy.Text = r.EmployeeName; lblDate.Text = r.Date; lblStatus.Text = r.Status; if (lblStatus.Text.Equals("Approved") || lblStatus.Text.Equals("approved") || lblStatus.Text.Equals("InProgress")) { lblStatus.ForeColor = System.Drawing.Color.Green; } else if (lblStatus.Text.Equals("Pending")) { lblStatus.ForeColor = System.Drawing.Color.Blue; } else if (lblStatus.Text.Equals("Priority")) { lblStatus.ForeColor = System.Drawing.Color.Red; } else { lblStatus.ForeColor = System.Drawing.Color.Black; } } else { Utility.logout(); } if (!IsPostBack) { showAllItems(); } }