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);
        }
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    public void RegenerateRequisition(List <WCFRequestedItem> regenList)
    {
        int disbId = 0;

        List <RequestedItem> requItemList = new List <RequestedItem>();

        foreach (WCFRequestedItem r in regenList)
        {
            RequestedItem rItem = new RequestedItem(r.Code, r.Description, Convert.ToInt32(r.ShortfallQty), RequisitionControl.getUOM(r.Code));
            disbId = r.DisbId;
            requItemList.Add(rItem);
        }

        DateTime date    = (disbCon.GetRegenrateDate(disbId));
        string   depName = EFBroker_Disbursement.GetDisbursmentbyDisbID(Convert.ToInt32(disbId)).Department.DeptName;
        string   reqBy   = EFBroker_DeptEmployee.GetDeptRepByDeptCode(depName);
        int      empID   = EFBroker_DeptEmployee.GetDeptRepEmpIDByDeptCode(depName);
        string   depCode = EFBroker_DeptEmployee.GetDepartByEmpID(empID).DeptCode;
        string   status  = "Priority";

        RequisitionControl.addNewRequisitionItem(requItemList, date, status, empID, depCode);
    }