protected void DdlStatus_SelectedIndexChanged(object sender, EventArgs e) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; string selectedStatus = ddlStatus.SelectedValue; if (ddlStatus.SelectedItem.Text == "Select Status") { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByID(emp.EmpID); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByEmpIDAndStatus(emp.EmpID, selectedStatus); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayStatusSearch"; showEmptyLabel(); } } else { Utility.logout(); } }
protected void DdlStatus_SelectedIndexChanged(object sender, EventArgs e) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; if (ddlStatus.SelectedItem.ToString() == "Select Status") { gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { string selectedStatus = ddlStatus.SelectedItem.ToString(); gvRequisitionForm.DataSource = RequisitionControl.getRequisitionListByStatusAndDepCode(ddlStatus.SelectedItem.ToString(), emp.DeptCode); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displayStatusSearch"; showEmptyLabel(); } } else { Utility.logout(); } }
protected void BtnSearch_Click(object sender, EventArgs e) { Employee emp = (Employee)Session["emp"]; searchWord = txtSearch.Text; if (String.IsNullOrWhiteSpace(searchWord)) { ClientScript.RegisterStartupScript(Page.GetType(), "MessageBox", "<script language='javascript'>alert('" + "Please enter value to search!" + "');</script>"); } else { if (ddlStatus.SelectedItem.ToString() == "Select Status") { gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithoutStatus(searchWord.Trim(), emp.DeptCode); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displaySearch"; ViewState["searchString"] = searchWord; showEmptyLabel(); } else { gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithStatus(searchWord.Trim(), emp.DeptCode, ddlStatus.SelectedItem.ToString()); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displaySearchStatus"; ViewState["searchString"] = searchWord; showEmptyLabel(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; //Dep Head gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); //Dep Representative int count = RequisitionControl.CountPending(emp.DeptCode); lblPendingCount.Text = "Total Pendings: " + count.ToString(); } else { Utility.logout(); } } }
protected void BtnSearch_Click(object sender, EventArgs e) { string searchWord = txtSearchBox.Text; gvReq.DataSource = RequisitionControl.DisplaySearch(searchWord); gvReq.DataBind(); }
protected void BtnSearch_Click(object sender, EventArgs e) { Employee emp = (Employee)Session["emp"]; if (Session["emp"] != null) { searchWord = txtSearch.Text; if (txtSearch.Text == String.Empty) { ClientScript.RegisterStartupScript(Page.GetType(), "MessageBox", "<script language='javascript'>alert('" + "Please enter value to search!" + "');</script>"); } else { gvCollectionList.DataSource = RequisitionControl.DisplayCollectionListSearch(emp.DeptCode, searchWord.Trim()); gvCollectionList.DataBind(); ViewState["DataSource"] = "displaySearch"; ViewState["searchWord"] = searchWord; showEmptyLabel(); } } else { Utility.logout(); } }
protected void btnReGenReq_Click(object sender, EventArgs e) { DateTime date = (DateTime)Session["RegenerateDate"]; string depName = (string)Session["RegenerateDep"];; string requestedBy = (string)Session["RequestedBy"]; int empID = EFBroker_DeptEmployee.GetDeptRepEmpIDByDeptCode(depName); string depCode = EFBroker_DeptEmployee.GetDepartByEmpID(empID).DeptCode; List <RequestedItem> shortfallItem = (List <RequestedItem>)Session["RegenerateItems"]; List <RequestedItem> regenerateItem = new List <RequestedItem>(); foreach (GridViewRow r in gvRegenerate.Rows) { if (((CheckBox)r.FindControl("CheckBox")).Checked) { int i = r.RowIndex; regenerateItem.Add(shortfallItem[i]); } } RequisitionControl.addNewRequisitionItem(regenerateItem, date, status, empID, depCode); RedirectCheck(); }
protected void BtnDisplayAll_Click(object sender, EventArgs e) { Employee emp = (Employee)Session["emp"]; gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode); gvRequisitionForm.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); }
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 showAllItems() { gvItemList.DataSource = RequisitionControl.getList(id); //GridView1.DataSource = q.ToList(); gvItemList.DataBind(); gvItemListView.DataSource = RequisitionControl.getList(id); //GridView2.DataSource = q.ToList(); gvItemListView.DataBind(); }
public void Reject(WCFRequisition requisition) { Requisition r = new Requisition() { RequisitionID = Convert.ToInt32(requisition.RequisitionNo), ApprovedBy = Convert.ToInt32(requisition.ApprovedBy), Remarks = requisition.Remarks, }; RequisitionControl.rejectRequisition(Convert.ToInt32(requisition.RequisitionNo), requisition.Remarks, Convert.ToInt32(r.ApprovedBy)); }
public List <WCFRequisition_ItemList> getList(string id) { List <WCFRequisition_ItemList> iList = new List <WCFRequisition_ItemList>(); List <Requisition_ItemList> item = RequisitionControl.getList(Int32.Parse(id)); foreach (Requisition_ItemList i in item) { iList.Add(WCFRequisition_ItemList.Make(i.Description, i.RequestedQty, i.UnitOfMeasure, i.Status)); } return(iList); }
public void Approve(WCFRequisition requisition) { Requisition r = new Requisition() { RequisitionID = Convert.ToInt32(requisition.RequisitionNo), ApprovedBy = Convert.ToInt32(requisition.ApprovedBy), Remarks = requisition.Remarks, }; RequisitionControl.approveRequisition(Convert.ToInt32(requisition.RequisitionNo), requisition.Remarks, r.ApprovedBy); }
List <WCFRequisitionListItem> IRequisitionListService.getRequisitionListByStatusAndDept(string deptCode) { List <WCFRequisitionListItem> wlist = new List <WCFRequisitionListItem>(); List <ReqisitionListItem> rlist = RequisitionControl.getRequisitionListByStatusAndDepCode("Pending", deptCode); foreach (ReqisitionListItem r in rlist) { wlist.Add(WCFRequisitionListItem.Make(r.Date, r.RequisitionNo.ToString(), r.Department, r.Status, r.EmployeeName)); //wlist.Add(WCFRequisitionListItem.Make(r.RequisitionNo.ToString(), r.Department, r.Status, r.EmployeeName, r.Date )); } return(wlist); }
protected void GVCollectionList_PageIndexChanging(object sender, GridViewPageEventArgs e) { Employee emp = (Employee)Session["emp"]; gvCollectionList.PageIndex = e.NewPageIndex; if (((string)ViewState["DataSource"]).Equals("displayAll")) { gvCollectionList.DataSource = RequisitionControl.getCollectionList(emp.DeptCode); } else { gvCollectionList.DataSource = RequisitionControl.DisplayCollectionListSearch(emp.DeptCode, ((string)ViewState["searchWord"]).Trim()); } gvCollectionList.DataBind(); }
protected void BtnCancel_Click(object sender, EventArgs e) { try { id = Convert.ToInt32(Request.QueryString["requisitionNo"]); RequisitionControl.cancelRejectRequisition(id); Response.Redirect(LoginController.RequisitionListDepRepURI); //Response.Write("<script language='javascript'>alert('Requisition has been cancelled');</script>"); } catch (Exception) { Utility.DisplayAlertMessage("Error! Retry."); } }
protected void BtnDisplayAll_Click(object sender, EventArgs e) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; gvCollectionList.DataSource = RequisitionControl.getCollectionList(emp.DeptCode); gvCollectionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { Utility.logout(); } }
protected void BtnDelete_Click(object sender, EventArgs e) { //LoadData(); GridViewRow row = ((System.Web.UI.WebControls.Button)sender).Parent.Parent as GridViewRow; string itemDes = gvItemList.DataKeys[row.RowIndex].Value.ToString(); Requisition_Item rItem = RequisitionControl.findByReqIDItemCode(id, itemDes); string iCode = rItem.ItemCode; int rId = rItem.RequisitionID; RequisitionControl.removeRequisitionItem(rId, iCode); showAllItems(); }
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(); } }
protected void BtnApprove_Click(object sender, EventArgs e) { if (Request.QueryString["id"] != null && Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; id = Convert.ToInt32(Request.QueryString["id"]); string reason = txtReason.Value; RequisitionControl.approveRequisition(id, reason, emp.EmpID); Page.Response.Redirect(Page.Request.Url.ToString(), true); approveSuccess.Text = "You apporved the requisition requested by " + lblReqname.Text + " Successfully"; } else { approveSuccess.Text = "Process Failed , Please contact server admininstration"; } }
protected void BtnNew_Click(object sender, EventArgs e) { id = Convert.ToInt32(Request.QueryString["requisitionNo"]); //string des = RequisitionControl.getDescription(code); int qty = Convert.ToInt32(txtQty.Text); if (gvItemList.Rows.Count <= 0) { RequisitionControl.addItemToRequisition(code, qty, id); } else { bool isEqual = false; string truCode = ""; foreach (GridViewRow row in gvItemList.Rows) { System.Web.UI.WebControls.Label labelDes = (System.Web.UI.WebControls.Label)row.FindControl("lblItemDes"); string item = labelDes.Text; System.Web.UI.WebControls.Label labelCode = (System.Web.UI.WebControls.Label)row.FindControl("lblCode"); string iCode = labelCode.Text; if (code.Equals(iCode)) { isEqual = true; truCode = iCode; } } if (isEqual) { rfvQty.Enabled = true; rvQty.Enabled = true; RequisitionControl.editRequisitionItemQty(id, truCode, qty); } else { rfvQty.Enabled = true; rvQty.Enabled = true; RequisitionControl.addItemToRequisition(code, qty, id); } } showAllItems(); }
protected void BtnSubmit_Click(object sender, EventArgs e) { if (Session["emp"] != null) { emp = (Employee)Session["emp"]; int RequestedBy = emp.EmpID; string DeptCode = emp.DeptCode; if (gvItemList.Rows.Count <= 0) { Response.Write("<script>alert('You have not requested any item yet!');</script>"); } else { RequisitionControl.addNewRequisitionItem(rItem, DateTime.Now, "Pending", RequestedBy, DeptCode); DeptController dc = new DeptController(); Employee tempHead = EmployeeController.GetDeptHeadTempHeadEmail(emp); Employee deptHead = dc.GetDHeadByDeptCode(emp.DeptCode); if (tempHead != null) { string mail = tempHead.Email; string receiver = mail; Thread emailThreadWithParam = new Thread(() => TempMailNotification(receiver)); emailThreadWithParam.Start(); } if (deptHead != null) { string mail1 = deptHead.Email; string receiver1 = mail1; Thread emailThreadWithParam1 = new Thread(() => HeadMailNotification(receiver1)); emailThreadWithParam1.Start(); } Response.Redirect(LoginController.RequisitionListDepEmpURI); } //Response.Write("<script language='javascript'>alert('Requisition Submitted');</script>"); //Server.Transfer("RequisitionListDepartment.aspx", true); } else { Utility.logout(); } }
protected void ReqRow_Updating(object sender, GridViewUpdateEventArgs e) { vsQty.Enabled = true; System.Web.UI.WebControls.TextBox qtyText = (System.Web.UI.WebControls.TextBox)gvItemList.Rows[e.RowIndex].FindControl("txtQuantity"); int newQty = Convert.ToInt32(qtyText.Text); System.Web.UI.WebControls.Label codeLabel = (System.Web.UI.WebControls.Label)gvItemList.Rows[e.RowIndex].FindControl("lblCode"); string itemDesc = codeLabel.Text; Requisition_Item item = RequisitionControl.findByReqIDItemCode(id, itemDesc); string iCode = item.ItemCode; int rId = item.RequisitionID; RequisitionControl.updateRequisitionItem(rId, iCode, newQty); gvItemList.EditIndex = -1; showAllItems(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["emp"] != null) { Employee emp = (Employee)Session["emp"]; //Dep Emp gvRequisitionList.DataSource = RequisitionControl.getRequisitionListByID(emp.EmpID); gvRequisitionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { Utility.logout(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["emp"] != null) { emp = (Employee)Session["emp"]; //Approved requisition gvCollectionList.DataSource = RequisitionControl.getCollectionList(emp.DeptCode); gvCollectionList.DataBind(); ViewState["DataSource"] = "displayAll"; showEmptyLabel(); } else { Utility.logout(); } } }
protected void Page_Load(object sender, EventArgs e) { // lblCheckBoxValidation.Text = ""; // if (RequisitionControl.DisplayAll().Count == 0) { btnGenerate.Visible = false; btnSearch.Visible = false; btnDisplay.Visible = false; ddlStatus.Visible = false; txtSearchBox.Visible = false; lblCheckBoxValidation.Text = "There is no pending requisition!"; } else { if (!IsPostBack) { gvReq.DataSource = RequisitionControl.DisplayAll(); gvReq.DataBind(); } if (ddlStatus.Text == "Priority") { ddlStatus.Text = "Select Status"; gvReq.DataSource = null; gvReq.DataSource = RequisitionControl.DisplayPriority(); gvReq.DataBind(); } if (ddlStatus.Text == "Approved") { ddlStatus.Text = "Select Status"; gvReq.DataSource = null; gvReq.DataSource = RequisitionControl.DisplayApproved(); gvReq.DataBind(); } } }
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) { 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); }
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); }
protected void GvRequisitionForm_PageIndexChanging(object sender, GridViewPageEventArgs e) { Employee emp = (Employee)Session["emp"]; gvRequisitionForm.PageIndex = e.NewPageIndex; if (((string)ViewState["DataSource"]).Equals("displayAll")) { gvRequisitionForm.DataSource = RequisitionControl.DisplayAllByDeptCode(emp.DeptCode); } else if (((string)ViewState["DataSource"]).Equals("displayStatusSearch")) { gvRequisitionForm.DataSource = RequisitionControl.getRequisitionListByStatusAndDepCode(ddlStatus.SelectedItem.ToString(), emp.DeptCode); } else if (((string)ViewState["DataSource"]).Equals("displaySearch")) { gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithoutStatus(((string)ViewState["searchString"]).Trim(), emp.DeptCode); } else if (((string)ViewState["DataSource"]).Equals("displaySearchStatus")) { gvRequisitionForm.DataSource = RequisitionControl.HeadSearchWithStatus(((string)ViewState["searchString"]).Trim(), emp.DeptCode, ddlStatus.SelectedItem.ToString()); } gvRequisitionForm.DataBind(); }