コード例 #1
0
 public string CreateLoanRequest(string reason,
                                 string loantype, string comment,
                                 string loanamount, string noofinstallment,
                                 string deductionistartdate)
 {
     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.SDSLoanRequestServicesClient sdsloanreq = new ESSWebService.SDSLoanRequestServicesClient();
         sdsloanreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         ESSWebService.LoanRequest _creloanreq = new ESSWebService.LoanRequest();
         sdsloanreq.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123");
         _creloanreq.Comments           = comment;
         _creloanreq.RequestDate        = DateTime.Now;
         _creloanreq.WorkerRecid        = username;
         _creloanreq.Loantype           = loantype == "-1" ? null : loantype;
         _creloanreq.Loanvalue          = Convert.ToDecimal(loanamount);
         _creloanreq.NoOfInsatllment    = Convert.ToInt32(noofinstallment);
         _creloanreq.MonthlyInstallment = Convert.ToDecimal(loanamount) / Convert.ToInt32(noofinstallment);
         _creloanreq.DeductionStartDate = new DateTime(Convert.ToInt32(deductionistartdate.Split('/')[2]), Convert.ToInt32(deductionistartdate.Split('/')[1]), Convert.ToInt32(deductionistartdate.Split('/')[0]));
         _creloanreq.ReasonCode         = reason == "-1" ? null : reason;
         string g = sdsloanreq.createLoanRequest(callcont, _creloanreq, compid);
         return(g);
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
     }
 }
コード例 #2
0
 public ActionResult LetterRequests()
 {
     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 sdgenreq = new ESSWebService.SDSGeneralRequestServiceClient();
         sdgenreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdgenreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = (from a in sdgenreq.getAllGeneralRequestListByNature(callcont, username, ESSWebService.SDSGeneralNature.Letter, compid).parmGeneralRequestList
                   select new DTOGeneralRequests
         {
             TransactionId = a.TransactionId,
             RequestId = a.RequestId,
             RequestgroupId = "",
             Transactiondate = a.Transactiondate.ToShortDateString(),
             PersonalNumber = a.NameEn.Split('-')[0],
             ReqNature = a.Generalnature.ToString(),
             ReasonCode = a.ReasonCode,
             Name = a.NameEn.Split('-')[1],
             State = a.Status.ToString(),
             URL = "/GeneralRequest/ViewGeneralRequestbyId?genreqid=" + a.TransactionId,
         }).ToList();
         return(View(ss));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #3
0
        public ActionResult ExcuseRequests()
        {
            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 sdexcusereq = new ESSWebService.SDSExcuseRequestServicesClient();
                sdexcusereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sdexcusereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                var ss = (from a in sdexcusereq.getAllExcuseReqeustByNature(callcont, username, ESSWebService.SDSExcuseNature.Excuse, compid).parmExcuseRequestList
                          select new DTOExcuseRequest
                {
                    RequestId = a.RequestId,
                    ExcuseType = ESSWebService.SDSExcuseNature.Excuse.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));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
        }
コード例 #4
0
 public string CreateLetterRequest(string reason, string requestid, string comment, string reportlang, string sendto)
 {
     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 sdsgenreq = new ESSWebService.SDSGeneralRequestServiceClient();
         sdsgenreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         ESSWebService.GeneralRequest _cregenreq = new ESSWebService.GeneralRequest();
         sdsgenreq.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123");
         _cregenreq.Comments        = comment;
         _cregenreq.Transactiondate = DateTime.Now;
         _cregenreq.Workerrecid     = username;
         _cregenreq.RequestId       = requestid;
         _cregenreq.ReasonCode      = reason;
         _cregenreq.Sendto          = sendto;
         _cregenreq.Reportlanguage  = (ESSPortal.ESSWebService.SDSReportLang)Convert.ToInt32(reportlang);
         _cregenreq.Generalnature   = ESSWebService.SDSGeneralNature.Letter;
         //_cregenreq.ge
         string g = sdsgenreq.createGeneralRequestByNature(callcont, _cregenreq, ESSWebService.SDSGeneralNature.Letter, compid);
         return(g);
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
     }
 }
コード例 #5
0
        public ActionResult GetLoanedItemsbyEmployee(string status)
        {
            if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
            {
                var username = Convert.ToInt64(Request.Cookies["user"].Value);
                var compid   = Request.Cookies["compid"].Value;
                ESSWebService.SDSPersonalInfoServicesClient sdperinfo = new ESSWebService.SDSPersonalInfoServicesClient();
                ESSWebService.CallContext callcont = new ESSWebService.CallContext();

                sdperinfo.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sdperinfo.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                var loanequip = sdperinfo.getAllLoanedEquipList(callcont, username, true).parmAddressList;
                var toreturn  = (from a in loanequip
                                 select new DTOModels.DTOLoanedItems
                {
                    LoanItem = a.LoanItemId,
                    LoanDate = a.LoanedDate.ToShortDateString(),
                    Description = a.Description,
                    ReturnDate = a.ActualReturnDate.ToShortDateString()
                });
                return(View("LoanedItem", toreturn));
            }
            else
            {
                return(RedirectToAction("Home", "Account"));
                // return _perinfo;
            }
        }
コード例 #6
0
 public ActionResult LoanRequests()
 {
     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.SDSLoanRequestServicesClient sdgenreq = new ESSWebService.SDSLoanRequestServicesClient();
         sdgenreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdgenreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = (from a in sdgenreq.getAllLoanReqeust(callcont, username, compid).parmLoanRequestList
                   select new DTOLoans
         {
             LoanRequestId = a.LoanRequestId,
             LoanType = a.Loantype.ToString(),
             LoanRequested = a.Loanvalue.ToString(),
             MonthlyInstallment = a.MonthlyInstallment.ToString(),
             NoofInstallment = a.NoOfInsatllment.ToString(),
             Date = a.RequestDate.ToShortDateString(),
             PersonalNumber = a.NameEn.Split('-')[0],
             ReasonCode = a.ReasonCode,
             Name = a.NameEn.Split('-')[1],
             State = a.Workflowstatus.ToString(),
             URL = "/Loan/ViewLoanbyRequestId?loanreqid=" + a.LoanRequestId,
         }).ToList();
         return(View(ss));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #7
0
 public string CreateEosRequest(string reason, string eostype, string comment, string lastworkingday, string noticestartdate)
 {
     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.SDSEosRequestServicesClient sdseosreq = new ESSWebService.SDSEosRequestServicesClient();
         sdseosreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         ESSWebService.EosRequest _creeosreq = new ESSWebService.EosRequest();
         sdseosreq.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123");
         _creeosreq.Comments        = comment;
         _creeosreq.RequestDate     = DateTime.Now;
         _creeosreq.WorkerRecid     = username;
         _creeosreq.EOSRequestType  = eostype;
         _creeosreq.ReasonCode      = reason;
         _creeosreq.LastWorkingDate = new DateTime(Convert.ToInt32(lastworkingday.Split('/')[2]), Convert.ToInt32(lastworkingday.Split('/')[1]), Convert.ToInt32(lastworkingday.Split('/')[0]));
         _creeosreq.NoticeStartDate = new DateTime(Convert.ToInt32(noticestartdate.Split('/')[2]), Convert.ToInt32(noticestartdate.Split('/')[1]), Convert.ToInt32(noticestartdate.Split('/')[0]));
         string g = sdseosreq.createEosRequest(callcont, _creeosreq, compid);
         return(g);
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
     }
 }
コード例 #8
0
 public ActionResult EOSRequests()
 {
     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.SDSEosRequestServicesClient sdgenreq = new ESSWebService.SDSEosRequestServicesClient();
         sdgenreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdgenreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = (from a in sdgenreq.getAllEosReqeust(callcont, username, compid).parmEosRequestList
                   select new DTOEOS
         {
             EOSID = a.EosRequestId,
             Date = a.RequestDate.ToShortDateString(),
             EOSType = a.EOSRequestType.ToString(),
             Worker = a.NameEn.Split('-')[1],
             PersonalNumber = a.NameEn.Split('-')[0],
             Status = a.Workflowstatus.ToString(),
             Reason = a.ReasonCode,
             URL = "/EOS/ViewEOSRequestbyId?EOSid=" + a.EosRequestId,
         }).ToList();
         return(View(ss));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #9
0
 public ActionResult BusinessTripRequests()
 {
     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.SDSBusinessTripRequestServicesClient sdbustripreq = new ESSWebService.SDSBusinessTripRequestServicesClient();
         sdbustripreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdbustripreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = (from a in sdbustripreq.getAllBusinessTripReqeust(callcont, username, compid).parmBusinessTripRequestList
                   select new DTOBusinessTrip
         {
             BusinessTripId = a.RequestId,
             ToDate = a.ToDaTE.ToShortDateString(),
             FromDate = a.FromDate.ToShortDateString(),
             Destination = a.Destination,
             PersonalNumber = a.NameEn.Split('-')[0],
             RequestDate = a.RequestDate.ToShortDateString(),
             Name = a.NameEn.Split('-')[1],
             State = a.WorkflowStatus.ToString(),
             URL = "/BusinessTrip/ViewBusinessTripbyRequestbyId?requestid=" + a.RequestId,
         }).ToList();
         return(View(ss));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #10
0
        public string ApproveBusinessTripbyId(string id, string Comment)
        {
            if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
            {
                try
                {
                    ESSWebService.CallContext callcont = new ESSWebService.CallContext();
                    var compid   = Request.Cookies["compid"].Value;
                    var username = Convert.ToInt64(Request.Cookies["user"].Value);
                    ESSWebService.SDSBusinessTripRequestServicesClient sdbustripreq = new ESSWebService.SDSBusinessTripRequestServicesClient();
                    sdbustripreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                    sdbustripreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                    ESSWebService.BusinessTripRequest _crbustripreq = new ESSWebService.BusinessTripRequest();
                    _crbustripreq = sdbustripreq.getPendingWorkflowList(callcont, username).parmBusinessTripRequestList.Where(x => x.RequestId == id).FirstOrDefault();

                    return(sdbustripreq.Approve(callcont, _crbustripreq.WorkflowItem, username, compid));
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                RedirectToAction("Login", "Account");
                return("");
                // return _perinfo;
            }
        }
コード例 #11
0
        public string Workflowforrequest(string requesid)
        {
            string workcom = "";

            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            var compid   = Request.Cookies["compid"].Value;
            var username = Convert.ToInt64(Request.Cookies["user"].Value);

            ESSWebService.SDSLeaveRequestServicesClient sdsworkcom = new ESSWebService.SDSLeaveRequestServicesClient();
            sdsworkcom.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdsworkcom.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            ESSWebService.SDSWorkflowApprovalWorkItemHistory workflowHistory = sdsworkcom.getWorkflowHistory(callcont, requesid, compid);
            if (workflowHistory != null)
            {
                foreach (ESSWebService.SDSWorkflowApprovalWorkItemComment wfHistory in workflowHistory.Comments)
                {
                    if (wfHistory.IsStep == 0)
                    {
                        workcom = workcom + (wfHistory.Time + " - " + wfHistory.ActionLabel + " - " + "Comments : " + wfHistory.Comment) + " \n";
                    }
                    else
                    {
                        workcom = workcom + (wfHistory.StepName) + " \n";
                    }
                }
            }

            return(workcom);
        }
コード例 #12
0
 public JsonResult GetLeaveRequestsByEmployeeLogIn()
 {
     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.SDSLeaveRequestServicesClient sd = new ESSWebService.SDSLeaveRequestServicesClient();
         sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sd.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = (from a in sd.getAllleaveRequestList(callcont, username, compid).parmGeneralRequestList
                   select new DTOLeaveRequest
         {
             LeaveRequest = a.Leaverequestid,
             LeaveType = a.Leavetypeid,
             RequestDate = a.Transactiondate.ToShortDateString(),
             FromDate = a.Fromdate.ToShortDateString(),
             ToDate = a.ToDate.ToShortDateString(),
             PersonalNumber = a.WorkerRecid.ToString(),
             Worker = a.NameEn,
             State = a.Workflowstatus.ToString(),
             URL = "/LeaveRequest/ViewRequestbyRequestId?LeaveRequestNumber=" + a.Leaverequestid,
             //Attachment = a.
         }).ToList();
         return(Json(ss, JsonRequestBehavior.AllowGet));
     }
     else
     {
         RedirectToAction("Login", "Account");
         // return _perinfo;
         return(Json(""));
     }
 }
コード例 #13
0
        public ActionResult PayslipbyEmployee(string month, string year)
        {
            if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
            {
                int monthval;
                int yearval;
                monthval = month != null && month != "" ? Convert.ToInt32(month) : DateTime.Now.AddMonths(-1).Month;
                yearval  = year != null && year != "" ? Convert.ToInt32(year) : DateTime.Now.AddMonths(-1).Year;

                var username = Convert.ToInt64(Request.Cookies["user"].Value);
                var compid   = Request.Cookies["compid"].Value;
                ESSWebService.SDSPaySlipInfoServiceClient sdspayslip = new ESSWebService.SDSPaySlipInfoServiceClient();
                ESSWebService.CallContext callcont = new ESSWebService.CallContext();
                sdspayslip.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sdspayslip.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                var hdr   = sdspayslip.getPaySlipInfo(callcont, username, yearval, monthval, compid);
                var lines = sdspayslip.getPaySlipLineInfoList(callcont, username, yearval, monthval, compid).parmpaySlipLineInfoList;

                DTOModels.DTOPayslip payslip = new DTOModels.DTOPayslip();
                payslip.FromDate        = hdr.Fromdate.ToShortDateString();
                payslip.ToDate          = hdr.Todate.ToShortDateString();
                payslip.Month           = hdr.Months.ToString();
                payslip.Year            = hdr.Year.ToString();
                payslip.Paycycle        = hdr.PaycycleId;
                payslip.Paygroup        = hdr.PayGroup;
                payslip.TotalDeductions = hdr.TotalDeductions.ToString("#,##0");
                payslip.TotalEarnings   = hdr.TotalEarnings.ToString("#,##0");
                payslip.NetAmount       = hdr.Netsalary.ToString("#,##0");
                payslip.Earnings        = (from a in lines
                                           where (int)a.SourceType == 0
                                           select new DTOModels.DTOEarnings
                {
                    Amount = Convert.ToDecimal(a.Amount).ToString("#,##0"),
                    EarningsType = a.Paymenttype,
                    EarningsTypeID = a.PayCode,
                }).ToList();
                payslip.Deductions = (from a in lines
                                      where (int)a.SourceType == 1
                                      select new DTOModels.DTODeductions
                {
                    Amount = Convert.ToDecimal(a.Amount).ToString("#,##0"),
                    DeductionType = a.Paymenttype,
                    DeductionTypeID = a.PayCode,
                }).ToList();
                return(View("Payslip", payslip));
            }
            else
            {
                return(RedirectToAction("Login"));
                // return _perinfo;
            }
        }
コード例 #14
0
        public JsonResult getleavetypes()
        {
            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            var compid   = Request.Cookies["compid"].Value;
            var username = Convert.ToInt64(Request.Cookies["user"].Value);

            ESSWebService.SDSLeaveRequestServicesClient sdleavereq = new ESSWebService.SDSLeaveRequestServicesClient();
            sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            var leavetypes = sdleavereq.getLeaveTypeId_2(callcont, username, compid).parmleaveTypeIdList;

            return(Json(leavetypes, JsonRequestBehavior.AllowGet));
        }
コード例 #15
0
        public JsonResult getexecustypesforTraining()
        {
            var username = Convert.ToInt64(Request.Cookies["user"].Value);
            var compid   = Request.Cookies["compid"].Value;

            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            ESSWebService.SDSExcuseRequestServicesClient sdexcusereq = new ESSWebService.SDSExcuseRequestServicesClient();
            sdexcusereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdexcusereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            var retreasons = sdexcusereq.getExcuseTypeIdByNature(callcont, ESSWebService.SDSExcuseNature.Training, compid).parmExcuseTypeIdList;

            return(Json(retreasons, JsonRequestBehavior.AllowGet));
        }
コード例 #16
0
        public JsonResult getrequestreasons()
        {
            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            var compid   = Request.Cookies["compid"].Value;
            var username = Convert.ToInt64(Request.Cookies["user"].Value);

            ESSWebService.SDSBusinessTripRequestServicesClient sdbustripreq = new ESSWebService.SDSBusinessTripRequestServicesClient();
            sdbustripreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdbustripreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            var retreasons = sdbustripreq.getReasonCodes(callcont, compid).parmReasonCodeList;

            return(Json(retreasons, JsonRequestBehavior.AllowGet));
        }
コード例 #17
0
        public ActionResult LeaveRequestAng(int pageNumber, int pageSize)
        {
            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.SDSLeaveRequestServicesClient sd = new ESSWebService.SDSLeaveRequestServicesClient();
                sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sd.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                //sd.getPendingWorkflowList()
                // sd.Approve()
                //  sd.getAllleaveRequestList(callcont, username, compid).
                List <DTOLeaveRequest> leavereqList = null; int recordsTotal = 0;
                var ss = (from a in sd.getAllleaveRequestList(callcont, username, compid).parmGeneralRequestList.Where(x => x.Leaverequestnature == ESSWebService.SDSLeaveReqNature.LeaveRequest).ToList()
                          select new DTOLeaveRequest
                {
                    LeaveRequest = a.Leaverequestid,
                    LeaveType = a.Leavetypeid,
                    RequestDate = a.Transactiondate.ToShortDateString(),
                    FromDate = a.Fromdate.ToShortDateString(),
                    ToDate = a.ToDate.ToShortDateString(),
                    PersonalNumber = a.NameEn.Split('-')[0],
                    Worker = a.NameEn.Split('-')[1],
                    State = a.Workflowstatus.ToString(),
                    LeaveReqNature = ((int)a.Leaverequestnature).ToString(),
                    URL = "/LeaveRequest/ViewRequestbyRequestId?LeaveRequestNumber=" + a.Leaverequestid,
                    //Attachment = a.
                }).ToList();


                recordsTotal = ss.Count();
                //leavereqList = ss
                //                     .Skip(pageNumber)
                //                     .Take(pageSize)
                //                     .ToList();

                leavereqList = ss
                               .ToList();
                return(Json(new
                {
                    recordsTotal,
                    leavereqList
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(RedirectToAction("Home", "Account"));
                // return _perinfo;
            }
        }
コード例 #18
0
        public JsonResult getticketbalance(string leavetype, string nooftickets)
        {
            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            var compid   = Request.Cookies["compid"].Value;
            var username = Convert.ToInt64(Request.Cookies["user"].Value);

            ESSWebService.SDSLeaveRequestServicesClient sdleavereq = new ESSWebService.SDSLeaveRequestServicesClient();
            sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            var intnumtckt = nooftickets != "" ? Convert.ToInt32(nooftickets) : 0;
            var tckbalance = sdleavereq.getTicketBalance(callcont, username, intnumtckt, DateTime.Now, leavetype, compid);

            return(Json(tckbalance, JsonRequestBehavior.AllowGet));
        }
コード例 #19
0
        public JsonResult GetAlternativeWorkers()
        {
            //sdleavereq.de
            ESSWebService.CallContext callcont = new ESSWebService.CallContext();
            var compid   = Request.Cookies["compid"].Value;
            var username = Convert.ToInt64(Request.Cookies["user"].Value);

            ESSWebService.SDSBusinessTripRequestServicesClient sdbustripreq = new ESSWebService.SDSBusinessTripRequestServicesClient();
            sdbustripreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
            sdbustripreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
            var alternateworkers = sdbustripreq.getAlternateWorker_Lookup(callcont, username, compid).parmList;

            return(Json(alternateworkers, JsonRequestBehavior.AllowGet));
        }
コード例 #20
0
        public string ValidateLogin(string username, string password)
        {
            try
            {
                //http://172.22.226.148:31564/MicrosoftDynamicsAXAif60/AxTest/xppservice.svc
                //http://dc01:3340/MicrosoftDynamicsAXAif60/AxMobServices/xppservice.svc
                //BasicHttpBinding binding = new BasicHttpBinding();
                //EndpointAddress epAddr = new EndpointAddress("http://172.22.226.148:31564/MicrosoftDynamicsAXAif60/AxTest/xppservice.svc");
                //ESSWebService.SDSPersonalInfoServices servref = ChannelFactory<ESSWebService.SDSPersonalInfoServices>.CreateChannel(binding, epAddr);
                //ESSWebService.SDSPersonalInfoServicesClient sd = new ESSWebService.SDSPersonalInfoServicesClient(binding, epAddr);
                ESSWebService.SDSLoginServicesClient sd = new ESSWebService.SDSLoginServicesClient();
                sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sd.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                //sd.ClientCredentials.Windows.ClientCredential.UserName = "******";
                //sd.ClientCredentials.Windows.ClientCredential.Password = "******" + '"' + "word123";
                ESSWebService.CallContext callcont         = new ESSWebService.CallContext();
                ESSWebService.Permission  _permissionlInfo = sd.ValidateUserEncrypted(callcont, username, password);
                callcont.LogonAsUser = "";
                var userCookie   = new HttpCookie("user", _permissionlInfo.WorkerRecId.ToString());
                var compCookie   = new HttpCookie("compid", _permissionlInfo.CompanyId);
                var useridCookie = new HttpCookie("userlogid", username);
                var language     = new HttpCookie("Language", "En");
                //add Language Cookie
                //language cookie by default English

                //language = new HttpCookie("Language", "En");

                userCookie.Expires.AddDays(365);
                compCookie.Expires.AddDays(365);
                useridCookie.Expires.AddDays(365);
                language.Expires.AddDays(365);
                HttpContext.Response.Cookies.Add(userCookie);
                HttpContext.Response.Cookies.Add(compCookie);
                HttpContext.Response.Cookies.Add(useridCookie);
                //if (Request.Cookies["Language"] == null)
                //{
                HttpContext.Response.Cookies.Add(language);
                //}
                // ESSWebService.SDSPersonPhotoData photo = sd.getPersonPhoto(callcont, Convert.ToInt64("52565425785"));
                return("");
            }
            catch (Exception ex)
            {
                //throw new Exception("Username or password is Incorrect");
                return(ex.Message);
            }
        }
コード例 #21
0
        public ActionResult MenuLayout()
        {
            DTOModels.DTOPersonalInfo _perinfo = new DTOModels.DTOPersonalInfo();
            if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
            {
                DateTime _nulldate = new DateTime(1990, 1, 1);
                var      username  = Convert.ToInt64(Request.Cookies["user"].Value);
                var      compid    = Request.Cookies["compid"].Value;
                ESSWebService.SDSPersonalInfoServicesClient sd = new ESSWebService.SDSPersonalInfoServicesClient();
                sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sd.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                ESSWebService.CallContext            callcont   = new ESSWebService.CallContext();
                ESSPortal.ESSWebService.PersonalInfo perinfoser = sd.getOnePersonalInfo(callcont, username);


                _perinfo.ArabicName    = perinfoser.ArabicName;
                _perinfo.EnglishName   = perinfoser.EnglishName;
                _perinfo.FirstName     = perinfoser.EnglishName.Split(' ')[0];
                _perinfo.NewID         = perinfoser.OldId;
                _perinfo.OldID         = perinfoser.OldId;
                _perinfo.JoiningDate   = perinfoser.Joiningdate == _nulldate ? "-" : perinfoser.Joiningdate.ToShortDateString();
                _perinfo.BirthDate     = perinfoser.Birthdate == _nulldate ?null :  perinfoser.Birthdate.ToShortDateString();
                _perinfo.JobType       = perinfoser.JobId;
                _perinfo.JobDesc       = perinfoser.JobTypeId;
                _perinfo.PositionDesc  = perinfoser.Positiondescription;
                _perinfo.PositionId    = perinfoser.PositionId;
                _perinfo.Companyname   = perinfoser.Companyname;
                _perinfo.Gender        = perinfoser.Gender;
                _perinfo.MaritalStatus = perinfoser.Maritalstatus;
                ESSPortal.ESSWebService.SDSAddressListDC lstadd = perinfoser.AddressList;
                _perinfo.ImageArray = (sd.getPersonPhoto(callcont, Convert.ToInt64(username))).parmPersonPhoto;
                // lstadd.parmAddressList
                _perinfo.Departmentname   = perinfoser.DepartmentName;
                _perinfo.ProbationEndDate = perinfoser.ProbationEndDate == _nulldate ? "-" : perinfoser.ProbationEndDate.ToShortDateString();
                //if ((sd.getPersonPhoto(callcont, Convert.ToInt64(username))).parmPersonPhoto != null)
                //    _perinfo.ImageArray = Encoding.ASCII.GetBytes((sd.getPersonPhoto(callcont, Convert.ToInt64(username))).parmPersonPhoto);

                //   C:\Sabri\SoltechESSPortal\ESSPortal\ESSPortal\Views\.cshtml
                return(PartialView("~/Views/LeftProfile.cshtml", _perinfo));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
                // return _perinfo;
            }
        }
コード例 #22
0
 public string SubmitLeaveReturn(string leaverequestid, string date, string comments)
 {
     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.SDSLeaveRequestServicesClient sd = new ESSWebService.SDSLeaveRequestServicesClient();
         sd.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sd.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         return(sd.ReturnLeaveRequest(callcont, leaverequestid, new DateTime(Convert.ToInt32(date.Split('/')[2]), Convert.ToInt32(date.Split('/')[1]), Convert.ToInt32(date.Split('/')[0])), compid));
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
     }
 }
コード例 #23
0
        public ActionResult SubmittedRequestsbyType(string reqnature)
        {
            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.SDSLeaveRequestServicesClient sd = new ESSWebService.SDSLeaveRequestServicesClient();
                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 DTOLeaveRequest
                {
                    LeaveRequest = a.Leaverequestid,
                    LeaveType = a.Leavetypeid,
                    RequestDate = a.Transactiondate.ToShortDateString(),
                    FromDate = a.Fromdate.ToShortDateString(),
                    ToDate = a.ToDate.ToShortDateString(),
                    PersonalNumber = a.NameEn.Split('-')[0],
                    Worker = a.NameEn.Split('-')[1],
                    State = a.Workflowstatus.ToString(),
                    LeaveReqNature = ((int)a.Leaverequestnature).ToString(),
                    WorkflowRecId = a.WorkflowItem,
                    URL = "/LeaveRequest/ViewRequestbyRequestId?LeaveRequestNumber=" + a.Leaverequestid,
                    //Attachment = a.
                }).ToList();
                if (reqnature != null && reqnature != "")
                {
                    ss = ss.Where(x => x.LeaveReqNature == reqnature).OrderByDescending(x => x.LeaveRequest).ToList();
                }

                return(View(ss));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
                // return _perinfo;
            }
        }
コード例 #24
0
 public ActionResult ViewEOSRequestbyId(string EOSid)
 {
     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.SDSEosRequestServicesClient sdseosreq = new ESSWebService.SDSEosRequestServicesClient();
         sdseosreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdseosreq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         var ss = sdseosreq.getEosReqeust(callcont, EOSid, compid);
         ss.NameAr = Workflowforrequest(EOSid);
         return(View(ss));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #25
0
        public ActionResult AllLoansbyEmployee()
        {
            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.SDSLoanRequestServicesClient sdloan = new ESSWebService.SDSLoanRequestServicesClient();
                sdloan.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                sdloan.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                // sdloan.getAllLoanReqeust(callcont, username, compid).parmLoanRequestList;
                return(RedirectToAction("Home", "Account"));
            }

            else
            {
                return(RedirectToAction("Home", "Account"));
            }
        }
コード例 #26
0
 public ActionResult ViewallLeaveTravelled(string LeaveRequestNumber)
 {
     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.SDSLeaveRequestServicesClient sdleavereq = new ESSWebService.SDSLeaveRequestServicesClient();
         sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         ESSWebService.LeaveRequest _leavereq = new ESSWebService.LeaveRequest();
         _leavereq        = sdleavereq.getleaveRequest(callcont, LeaveRequestNumber, compid);
         _leavereq.NameAr = Workflowforrequest(LeaveRequestNumber);
         return(View(_leavereq));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
コード例 #27
0
 public JsonResult getleavebalance(string leavetype, string fromdate, string todate)
 {
     try
     {
         ESSWebService.CallContext callcont = new ESSWebService.CallContext();
         var compid   = Request.Cookies["compid"].Value;
         var username = Convert.ToInt64(Request.Cookies["user"].Value);
         ESSWebService.SDSLeaveRequestServicesClient sdleavereq = new ESSWebService.SDSLeaveRequestServicesClient();
         sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         DateTime frmdatedt = fromdate != "" ? Convert.ToDateTime(fromdate) : DateTime.Now;
         DateTime todatedt  = todate != "" ? Convert.ToDateTime(todate) : DateTime.Now;
         var      balance   = sdleavereq.getLeaveBalance(callcont, username, leavetype, frmdatedt, todatedt, compid);
         return(Json(balance, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         var ms = ex.Message;
         throw;
     }
 }
コード例 #28
0
 public string ApproveEOSRequestbyRequestNumber(string eosid, 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.SDSEosRequestServicesClient sdleavereq = new ESSWebService.SDSEosRequestServicesClient();
         sdleavereq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         sdleavereq.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
         ESSWebService.EosRequest _crleavereq = new ESSWebService.EosRequest();
         _crleavereq = sdleavereq.getPendingWorkflowList(callcont, username).parmEosRequestList.Where(x => x.EosRequestId == eosid).FirstOrDefault();
         return(sdleavereq.Approve(callcont, _crleavereq.WorkflowItem, username, compid));
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
         // return _perinfo;
     }
 }
コード例 #29
0
        public ActionResult GetAttendancebyDate(string FromDate, string ToDate, string ByTeam)
        {
            try
            {
                if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
                {
                    var username = Convert.ToInt64(Request.Cookies["user"].Value);
                    var compid   = Request.Cookies["compid"].Value;
                    ESSWebService.SDSAttendanceInfoServicesClient sattendance = new ESSWebService.SDSAttendanceInfoServicesClient();
                    ESSWebService.CallContext callcont = new ESSWebService.CallContext();

                    sattendance.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
                    sattendance.ClientCredentials.Windows.ClientCredential        = new NetworkCredential("webapp", "pass" + '"' + "word123");
                    var from     = new DateTime(2017, 10, 11);
                    var to       = new DateTime(2017, 11, 11);
                    var attlist  = sattendance.getAttendanceList(callcont, username, from, to).parmAttendanceList;
                    var toreturn = (from a in attlist
                                    select new DTOModels.DTOMyAttendance
                    {
                        Date = a.Date.ToShortDateString(),
                        Time = a.Time,
                        Event = a.Event,
                        Excused = a.IsExcuse == 0 ? "No" : "Yes"
                    }).ToList();
                    return(View("MyAttendance", toreturn));
                }
                else
                {
                    //return View("Account/Login");
                    return(RedirectToAction("Login", "Account"));
                    // return _perinfo;
                }
            }
            catch (Exception ex)
            {
                // return Redirect("Account/Home");
                //return View("Account/Login");
                return(RedirectToAction("Home", "Account"));
            }
        }
コード例 #30
0
 public string CreateExcuseRequestbyNature(string reason, string execuseid, string comment,
                                           string excusenature, string frmtime, string totime, string requestdate)
 {
     if (Request.Cookies["user"] != null && Request.Cookies["compid"] != null)
     {
         string g = "";
         ESSWebService.CallContext callcont = new ESSWebService.CallContext();
         var compid   = Request.Cookies["compid"].Value;
         var username = Convert.ToInt64(Request.Cookies["user"].Value);
         ESSWebService.SDSExcuseRequestServicesClient sdsexcreq = new ESSWebService.SDSExcuseRequestServicesClient();
         sdsexcreq.ClientCredentials.Windows.ClientCredential.Domain = "Soletechs";
         ESSWebService.ExcuseRequest _creeosreq = new ESSWebService.ExcuseRequest();
         sdsexcreq.ClientCredentials.Windows.ClientCredential = new NetworkCredential("webapp", "pass" + '"' + "word123");
         _creeosreq.Comments = comment;
         //_creeosreq.RequestDate = DateTime.Now;
         _creeosreq.RequestDate = new DateTime(Convert.ToInt32(requestdate.Split('/')[2]), Convert.ToInt32(requestdate.Split('/')[1]), Convert.ToInt32(requestdate.Split('/')[0]));
         _creeosreq.WorkerRecId = username;
         _creeosreq.ExcuseType  = execuseid == "-1" ? null : execuseid;
         _creeosreq.ReasonCode  = reason == "-1" ? null : reason;
         _creeosreq.FromTime    = Helper.Helper.Timetoint(frmtime);
         _creeosreq.ToTime      = Helper.Helper.Timetoint(totime);
         //_creeosreq.FromTime = 2;
         //_creeosreq.ToTime = 2;
         if (_creeosreq.ToTime >= _creeosreq.FromTime)
         {
             g = sdsexcreq.createExcuseRequestByNature(callcont, _creeosreq, (ESSWebService.SDSExcuseNature)Convert.ToInt32(excusenature), compid);
         }
         else
         {
             g = "Totime should be greater than from date";
         }
         return(g);
     }
     else
     {
         RedirectToAction("Login", "Account");
         return("");
     }
 }