public string RejecteGeneralRequestbyRequestNumber(string leaverequest, 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.SDSGeneralRequestServiceClient sdleavereq = new ESSWebService.SDSGeneralRequestServiceClient();
                sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                ESSWebService.GeneralRequest _crleavereq = new ESSWebService.GeneralRequest();
                _crleavereq = sdleavereq.getPendingWorkflowList(callcont, username).parmGeneralRequestList.Where(x => x.TransactionId == leaverequest).FirstOrDefault();

                //sdleavereq.Approve(callcont, _crleavereq.WorkflowItem, username, Comment);
                return(sdleavereq.Reject(callcont, _crleavereq.WorkflowItem, username, Comment));
            }
            else
            {
                RedirectToAction("Login", "Account");
                return("");
                // return _perinfo;
            }
        }
        public ActionResult SubmittedGeneralRequest()
        {
            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.SDSGeneralRequestServiceClient sd = new ESSWebService.SDSGeneralRequestServiceClient();
                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).parmGeneralRequestList
                          select new DTOGeneralRequests
                {
                    TransactionId = a.TransactionId,
                    RequestId = a.RequestId,
                    RequestgroupId = "",
                    Transactiondate = a.Transactiondate.ToShortDateString(),
                    PersonalNumber = a.NameEn.Split('-')[0],
                    ReasonCode = a.ReasonCode,
                    Name = a.NameEn.Split('-')[1],
                    State = a.Status.ToString(),
                    URL = "/GeneralRequest/ViewGeneralRequestbyId?genreqid=" + a.TransactionId,
                }).ToList();

                return(View(ss.OrderByDescending(x => x.RequestId).ToList()));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
                // return _perinfo;
            }
        }