protected void Page_Load(object sender, EventArgs e) { if (RequisitionControl.getRequisition(int.Parse((string)Request.QueryString["requisitionNo"])) != null) { id = Convert.ToInt32(Request.QueryString["requisitionNo"]); //int id = 24; Requisition r = RequisitionControl.getRequisition(id); int empid = Convert.ToInt32(r.RequestedBy); lblDate.Text = r.RequestDate.ToString(); lblStatus.Text = r.Status.ToString(); 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 (!IsPostBack) { showAllItems(); if (r.Status != "Pending") { btnCancel.Visible = false; btnAdd.Visible = false; btnUpdate.Visible = false; if (!String.IsNullOrWhiteSpace(r.Remarks)) { lblRemarks.Text = r.Remarks.ToString(); } } ddlItem.DataSource = RequisitionControl.getItem(); ddlItem.DataTextField = "Description"; ddlItem.DataValueField = "ItemCode"; ddlItem.DataBind(); } code = ddlItem.SelectedValue.ToString(); lblUom.Text = RequisitionControl.getUOM(code); } else { Response.Redirect(LoginController.RequisitionListDepEmpURI); } }
protected void Page_Load(object sender, EventArgs e) { lblDate.Text = DateTime.Now.ToLongDateString(); emp = (Employee)Session["emp"]; if (!IsPostBack) { int id = Convert.ToInt32(RequisitionControl.getLastReq()) + 1; //Label3.Text = "Form: "+emp.DeptCode+"/" + id; lblFormTitle.Text = "Form: " + emp.DeptCode + "/ " + id; ViewState["list"] = rItem; ddlItem.DataSource = RequisitionControl.getItem(); ddlItem.DataTextField = "Description"; ddlItem.DataValueField = "ItemCode"; ddlItem.DataBind(); } rItem = (List <RequestedItem>)ViewState["list"]; des = ddlItem.SelectedItem.ToString(); code = ddlItem.SelectedValue.ToString(); lblUom.Text = RequisitionControl.getUOM(code); }