public string RejecteExcuseRequestbyRequestNumber(string requestid, string Comment) { if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null) { ESSWebService.CallContext callcont = new ESSWebService.CallContext(); var compid = Request.Cookies["compid"].Value; var username = Convert.ToInt64(Request.Cookies["user"].Value); ESSWebService.SDSExcuseRequestServicesClient sdleavereq = new ESSWebService.SDSExcuseRequestServicesClient(); sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs"; sdleavereq.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123"); ESSWebService.ExcuseRequest _crleavereq = new ESSWebService.ExcuseRequest(); _crleavereq = sdleavereq.getPendingWorkflowList(callcont, username).parmExcuseRequestList.Where(x => x.RequestId == requestid).FirstOrDefault(); return(sdleavereq.Reject(callcont, _crleavereq.WorkflowItem, username, Comment)); } else { RedirectToAction("Login", "Account"); return(""); // return _perinfo; } }
public ActionResult SubmittedExcuseRequest() { if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null) { var username = Convert.ToInt64(Request.Cookies["user"].Value); var compid = Request.Cookies["compid"].Value; ESSWebService.CallContext callcont = new ESSWebService.CallContext(); ESSWebService.SDSExcuseRequestServicesClient sd = new ESSWebService.SDSExcuseRequestServicesClient(); sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs"; sd.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123"); //sd.getPendingWorkflowList() // sd.Approve() // sd.getAllleaveRequestList(callcont, username, compid). var ss = (from a in sd.getPendingWorkflowList(callcont, username).parmExcuseRequestList select new DTOExcuseRequest { RequestId = a.RequestId, ExcuseType = ESSWebService.SDSExcuseNature.Absence.ToString(), Date = a.RequestDate.ToShortDateString(), ExcuseId = a.ExcuseType, PersonalNumber = a.NameEn.Split('-')[0], Name = a.NameEn.Split('-')[1], State = a.WorkflowStatus.ToString(), URL = "/ExcuseRequest/ViewExcuseRequestbyId?requestid=" + a.RequestId, }).ToList(); return(View(ss.OrderByDescending(x => x.RequestId).ToList())); } else { return(RedirectToAction("Login", "Account")); // return _perinfo; } }