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 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(); } }
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); }