示例#1
0
 public ActionResult MyRequests()
 {
     if (!CSessionManager.IsLoggedIn())
     {
         return(RedirectToAction("Index"));
     }
     else
     {
         var usr      = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID);
         var employee = new CEmployeeInfo();
         foreach (DataRow rw in usr.Rows)
         {
             employee.EmpID       = rw["EmpID"].ToString();
             employee.Name        = rw["Name"].ToString();
             employee.Email       = rw["Email1"].ToString();
             employee.City        = rw["City"].ToString();
             employee.Country     = rw["Country"].ToString();
             employee.Birthday    = rw["Birthday"].ToString();
             employee.Gender      = rw["Gender"].ToString();
             employee.Nationality = rw["Nationality"].ToString();
             employee.Title       = rw["Title"].ToString();
             employee.Phone       = rw["Phone1"].ToString();
             employee.State       = rw["State"].ToString();
         }
         var EmpID = employee.EmpID;
         ViewData["AnnualLeave"] = _data.AnnualLeaveTaken(GetCommandDataParam("ESS_004", CSessionManager.IWSessionID, EmpID));
         ViewData["Type"]        = _data.TimeOffType(GetCommandData("ESS_002", CSessionManager.IWSessionID));
         return(View());
     }
 }
示例#2
0
        public ActionResult CancelRequest(string RID, string Type, DateTime StartDate, DateTime EndDate, string Comments)
        {
            //_logged = Logged();
            //if (_logged == 0)
            //{
            //    return RedirectToAction("Index");
            //}
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }

            if (string.IsNullOrEmpty(RID) || string.IsNullOrEmpty(Type) || string.IsNullOrEmpty(StartDate.ToString()))
            {
                return(RedirectToAction("History"));
            }

            //var param = IWServices.CreateParameters(RID, (string)Session["UserID"], "",
            //                                        Common.FormatEx.FormatDT(StartDate),
            //                                        Common.FormatEx.FormatDT(EndDate), "", "", "",
            //                                        "Pending", Comments, "", "1");
            var param = IWServices.CreateParameters(RID, CSessionManager.IWSessionID, "",
                                                    Common.FormatEx.FormatDT(StartDate),
                                                    Common.FormatEx.FormatDT(EndDate), "", "", "",
                                                    "Pending", Url.Encode(Comments), "", "1");
            var done = GetCommandDataParam("ESS_003", CSessionManager.IWSessionID, param);

            return(RedirectToAction("History"));
        }
示例#3
0
 //private int _logged;
 // GET: Operation
 public ActionResult Index()
 {
     if (!CSessionManager.IsIWSessionExists())
     {
         ViewBag.Status = CSessionManager.LastError;
     }
     return(View());
 }
示例#4
0
        public ActionResult PerfAppraisal()
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }

            return(View());
        }
示例#5
0
        public ActionResult MyRequests(VMRequestTO request)
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }
            try
            {
                ViewData["Type"] = _data.TimeOffType(GetCommandData("ESS_002", CSessionManager.IWSessionID));
                if (!ModelState.IsValid)
                {
                    return(View(request));
                }
                if (request.EndDate < request.StartDate)
                {
                    ViewBag.Error = "Start Date is less than Current date or End Date is less than StartDate";
                    return(View(request));
                }
                var usr      = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID);
                var employee = new CEmployeeInfo();
                foreach (DataRow rw in usr.Rows)
                {
                    employee.EmpID       = rw["EmpID"].ToString();
                    employee.Name        = rw["Name"].ToString();
                    employee.Email       = rw["Email1"].ToString();
                    employee.City        = rw["City"].ToString();
                    employee.Country     = rw["Country"].ToString();
                    employee.Birthday    = rw["Birthday"].ToString();
                    employee.Gender      = rw["Gender"].ToString();
                    employee.Nationality = rw["Nationality"].ToString();
                    employee.Title       = rw["Title"].ToString();
                    employee.Phone       = rw["Phone1"].ToString();
                    employee.State       = rw["State"].ToString();
                }
                var EmpID = employee.EmpID;

                //var param = IWServices.CreateParameters("-1", CSessionManager.IWSessionID, EmpID, request.Type, Common.FormatEx.FormatDT(request.StartDate), Common.FormatEx.FormatDT(request.EndDate), "", "", "", "Pending", request.Comment, "", "0");
                var param = IWServices.CreateParameters("-1", EmpID, request.Type, Common.FormatEx.FormatDT(request.StartDate), Common.FormatEx.FormatDT(request.EndDate), DateTime.Now.Year.ToString(), "", "", "Pending", request.Comment, "", "0");

                var done = GetCommandDataParam("ESS_003", CSessionManager.IWSessionID, param);
                //if (!string.IsNullOrEmpty(done.ToString()))
                //{
                //    ViewBag.ErrorMessage = "Sorry your request cannot be processed at this time, please contact HR";
                //    return View("MyRequests");
                //}
                return(RedirectToAction("History"));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
        }
示例#6
0
        public ActionResult ViewComment(int id)
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }
            var assignee = Session["MyEmpID"];

            //var MyEmpID = GetID.ID;
            ViewBag.details = _functionCall.GetCommitmentResponseDetails(assignee.ToString(), id);

            return(View());
        }
示例#7
0
 public ActionResult Qualify()
 {
     if (!CSessionManager.IsLoggedIn())
     {
         return(RedirectToAction("Index"));
     }
     try
     {
         ViewData["Info"] = _data.Qualification(GetData("HRESSGetQualifications", CSessionManager.IWSessionID, (string)Session["UserID"]));
         return(View());
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return(View("Error"));
     }
 }
示例#8
0
 public ActionResult EmployeeInfo()
 {
     if (!CSessionManager.IsLoggedIn())
     {
         return(RedirectToAction("Index"));
     }
     try
     {
         ViewData["Info"] = _data.EmployeeInfo(GetData("HRESSGetEmpInfo", CSessionManager.IWSessionID, CSessionManager.LoggedInUser.UserID));
         return(View());
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return(View("Error"));
     }
 }
示例#9
0
        public ActionResult Dashboard(VMLogin model)
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }
            var data = GetData("HRESSGetEmpInfo", CSessionManager.IWSessionID, CSessionManager.LoggedInUser.UserID);
            var info = new CEmployeeInfo();

            foreach (DataRow row in data.Rows)
            {
                info.EmpID       = Common.ConvertEx.ToString(row["EmpID"]);
                info.Name        = Common.ConvertEx.ToString(row["Name"]);
                info.Title       = Common.ConvertEx.ToString(row["Title"]);
                info.Gender      = Common.ConvertEx.ToString(row["Gender"]);
                info.City        = Common.ConvertEx.ToString(row["City"]);
                info.State       = Common.ConvertEx.ToString(row["State"]);
                info.Country     = Common.ConvertEx.ToString(row["Country"]);
                info.Email       = Common.ConvertEx.ToString(row["Email1"]);
                info.Phone       = Common.ConvertEx.ToString(row["Phone1"]);
                info.Birthday    = Common.ConvertEx.ToDateTime(row["Birthday"]).ToString(Common.DateHelper.FMT_DT);
                info.Nationality = Common.ConvertEx.ToString(row["Nationality"]);
            }
            ;

            var    lastLogonDate = GetCommandDataParam("ESS_006", CSessionManager.IWSessionID, info.EmpID);
            string LogDate       = null;

            foreach (DataRow row in lastLogonDate.Rows)
            {
                LogDate = Common.ConvertEx.ToDateTime(row["LastLogonDate"]).ToString(Common.DateHelper.FMT_DT);
            }

            string TodayDate = Common.ConvertEx.ToDateTime(DateTime.Today.ToShortDateString()).ToString(Common.DateHelper.FMT_DT);

            if (LogDate == TodayDate)
            {
                ViewBag.Message = true;
            }
            else
            {
                ViewBag.Message = false;
            }
            return(View());
        }
示例#10
0
        public ActionResult ViewCommittments(CEmployeePoints model)
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }

            try
            {
                var usr      = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID);
                var employee = new CEmployeeInfo();
                foreach (DataRow rw in usr.Rows)
                {
                    employee.EmpID = rw["EmpID"].ToString();
                }
                var EmpID = employee.EmpID;
                ViewBag.EmpID = EmpID;
                //ViewData["EmpID"] = EmpID;
                var GetUsr = GetCommandDataParam("P_00050", CSessionManager.IWSessionID, model.EmpID);
                var GetID  = new CEmployeeID();
                foreach (DataRow rw in GetUsr.Rows)
                {
                    GetID.ID = rw["ID#"].ToString();
                }

                var MyEmpID = GetID.ID;
                ViewBag.MyEmpID    = MyEmpID;
                Session["MyEmpID"] = MyEmpID;
                //var Committments = GetCommandDataParam("P_00041", CSessionManager.IWSessionID, MyEmpID);
                ViewData["Committments"] = _data.Committment(GetCommandDataParam("P_00041", CSessionManager.IWSessionID, MyEmpID));
                ViewBag.Commitments      = GetCommandDataParam("P_00041", CSessionManager.IWSessionID, MyEmpID);

                ViewBag.EmployeeGP   = _functionCall.GetEmployeeGP(CSessionManager.IWSessionID, MyEmpID, model.StartDate, model.EndDate);
                ViewBag.EmployeeCGPA = _functionCall.GetEmployeeCGPA(CSessionManager.IWSessionID, MyEmpID);
                //var param = IWServices.CreateParameters(EmpID);
                ViewData["Surbodinates"] = _data.GetSurbordinates(GetCommandDataParam("ESS_005", CSessionManager.IWSessionID, EmpID));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
            return(View(model));
        }
示例#11
0
        public ActionResult ViewCommittments()
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }
            CEmployeePoints model = new CEmployeePoints();

            try
            {
                var usr      = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID);
                var employee = new CEmployeeInfo();
                foreach (DataRow rw in usr.Rows)
                {
                    employee.EmpID = rw["EmpID"].ToString();
                }
                var EmpID  = employee.EmpID;
                var GetUsr = GetCommandDataParam("P_00050", CSessionManager.IWSessionID, EmpID);
                var GetID  = new CEmployeeID();
                foreach (DataRow rw in GetUsr.Rows)
                {
                    GetID.ID = rw["ID#"].ToString();
                }

                var MyEmpID = GetID.ID;
                ViewBag.MyEmpID    = MyEmpID;
                Session["MyEmpID"] = MyEmpID;
                string AppraisalPeriodStartDate = "";
                string AppraisalPeriodEndDate   = "";
                ViewBag.Commitments      = GetCommandDataParam("P_00041", CSessionManager.IWSessionID, MyEmpID);
                ViewBag.EmployeeGP       = _functionCall.GetEmployeeGP(CSessionManager.IWSessionID, MyEmpID, AppraisalPeriodStartDate, AppraisalPeriodEndDate);
                ViewBag.EmployeeCGPA     = _functionCall.GetEmployeeCGPA(CSessionManager.IWSessionID, MyEmpID);
                ViewData["Surbodinates"] = _data.GetSurbordinates(GetCommandDataParam("ESS_005", CSessionManager.IWSessionID, EmpID));
                model.StartDate          = string.Format("{0}-01-01", DateTime.Today.Year);
                model.EndDate            = string.Format("{0}-12-31", DateTime.Today.Year);
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
            return(View(model));
        }
示例#12
0
        public ActionResult Addition()
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }

            try
            {
                ViewData["ESSLNKS"] = _data.Addition(GetCommandData("ESS_0012", CSessionManager.IWSessionID));

                return(View());
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
        }
示例#13
0
 public ActionResult PayStubDetails(string EmpDate, string empID)
 {
     if (!CSessionManager.IsLoggedIn())
     {
         return(RedirectToAction("Index"));
     }
     try
     {
         ViewBag.PayDate = EmpDate;
         var param = IWServices.CreateParameters(EmpDate, empID);
         ViewData["NetPay"]          = _data.NetPayWord(GetCommandDataParam("P_00062", CSessionManager.IWSessionID, param));
         ViewData["GrossDeductions"] = _data.GrossEarnings(GetCommandDataParam("P_00064", CSessionManager.IWSessionID, param));
         ViewData["GrossEarnings"]   = _data.GrossEarnings(GetCommandDataParam("P_00063", CSessionManager.IWSessionID, param));
         ViewData["EmpPay"]          = _data.EmployeePay(GetCommandDataParam("P_00065", CSessionManager.IWSessionID, param));
         return(View());
     }
     catch (Exception ex)
     {
         ViewBag.Error = ex.Message;
         return(View("Error"));
     }
 }
示例#14
0
        //protected void Application_Error()
        //{
        //    var ex = Server.GetLastError();
        //    //log the error!
        //    IWEBIZ.Logging.Logger.LogError(ex.ToString());
        //    Response.Redirect("~/Operation/Index");
        //}


        protected void Application_Error(Object sender, EventArgs e)
        {
            Exception TheError = Server.GetLastError();

            //Logger.LogError(TheError.ToString()); // Make sure to use this in every code that you write

            if (!CSessionManager.IsWWWSessionExists())
            {
                Response.Redirect("~/Operation/Index");
                return;
            }

            if (TheError is HttpException)
            {
                Response.Redirect("~/Error/Index");
                return;
            }
            else
            {
                Response.Redirect("~/Error/Index");
                return;
            }
        }
示例#15
0
        public ActionResult PayStubList()
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }
            try
            {
                var data = GetData("HRESSGetEmpInfo", CSessionManager.IWSessionID, CSessionManager.LoggedInUser.UserID);
                //var empID = _data.EmployeeInfo(GetData("HRESSGetEmpInfo", CSessionManager.IWSessionID, CSessionManager.LoggedInUser.UserID))
                var info = new CEmployeeInfo();
                foreach (DataRow row in data.Rows)
                {
                    info.EmpID       = Common.ConvertEx.ToString(row["EmpID"]);
                    info.Name        = Common.ConvertEx.ToString(row["Name"]);
                    info.Title       = Common.ConvertEx.ToString(row["Title"]);
                    info.Gender      = Common.ConvertEx.ToString(row["Gender"]);
                    info.City        = Common.ConvertEx.ToString(row["City"]);
                    info.State       = Common.ConvertEx.ToString(row["State"]);
                    info.Country     = Common.ConvertEx.ToString(row["Country"]);
                    info.Email       = Common.ConvertEx.ToString(row["Email1"]);
                    info.Phone       = Common.ConvertEx.ToString(row["Phone1"]);
                    info.Birthday    = Common.ConvertEx.ToDateTime(row["Birthday"]).ToString(Common.DateHelper.FMT_DT);
                    info.Nationality = Common.ConvertEx.ToString(row["Nationality"]);
                }
                ;

                ViewBag.EmpID    = info.EmpID;
                ViewData["Info"] = _data.SalaryDetails(GetData("HRESSGetPayStubList", CSessionManager.IWSessionID, (string)Session["EmpID"]));
                return(View());
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }
        }
示例#16
0
        public ActionResult ViewAppraisals(string empID)
        {
            if (!CSessionManager.IsLoggedIn())
            {
                return(RedirectToAction("Index"));
            }

            try
            {
                var usr      = _functionCall.GetEmployeeInfo(CSessionManager.IWSessionID);
                var employee = new CEmployeeInfo();
                foreach (DataRow rw in usr.Rows)
                {
                    employee.EmpID = rw["EmpID"].ToString();
                }
                var EmpID  = employee.EmpID;
                var GetUsr = GetCommandDataParam("P_00050", CSessionManager.IWSessionID, empID);
                var GetID  = new CEmployeeID();
                foreach (DataRow rw in GetUsr.Rows)
                {
                    GetID.ID = rw["ID#"].ToString();
                }

                var MyEmpID = GetID.ID;

                ViewData["Appraisals"]   = _data.Appraisals(GetCommandDataParam("P_00055", CSessionManager.IWSessionID, MyEmpID));
                ViewData["Surbodinates"] = _data.GetSurbordinates(GetCommandDataParam("ESS_005", CSessionManager.IWSessionID, EmpID));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("Error"));
            }

            return(View());
        }