public ActionResult Index()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;

            string       ProgramID  = "Z001";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }


            UserFreeStyleModel UserFreeStyle;

            try
            {
                if (Request["action"] == "BACK" && Session[UserFreeStyle_id] != null)
                {
                    UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());
                }
                else
                {
                    UserFreeStyle = new UserFreeStyleModel()
                    {
                        Name          = UserFreeStyle_id,
                        OrderField    = "YearId",
                        OrderType     = "DESC",
                        PageNum       = "0",
                        SearchCompany = GeneralObj.SearchCompanyDefault(LoginUserInfo, SysProgram),
                        SearchText    = "", //搜尋狀態
                    };
                }
            }
            catch
            {
                UserFreeStyle = new UserFreeStyleModel()
                {
                    Name          = UserFreeStyle_id,
                    OrderField    = "YearId",
                    OrderType     = "DESC",
                    PageNum       = "0",
                    SearchCompany = GeneralObj.SearchCompanyDefault(LoginUserInfo, SysProgram),
                    SearchText    = "", //搜尋狀態
                };
            }


            Session[UserFreeStyle_id] = JsonConvert.SerializeObject(UserFreeStyle);
            ViewData["UserFreeStyle"] = UserFreeStyle;



            return(View());
        }
        public ActionResult EmpGroupForm()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;

            string ProgramID = "G002";

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                ViewData["SysProgram"] = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
            }


            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());



            EmpGroupModel EmpGroup = ModelFactory.GetEmpGroup(UserFreeStyle.SignId);

            ViewData["EmpGroup"] = EmpGroup;

            return(View());
        }
        /// <summary>
        /// RG01 外出異常表
        /// </summary>
        /// <returns></returns>
        public ActionResult RG01()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;


            string       ProgramID  = "RG01";//員工外出異常表
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }



            ReportFormModel ReportForm = new ReportFormModel();

            ReportForm.Company      = LoginUserInfo.Company;
            ReportForm.DepartMentNo = GeneralObj.SearchDepartMentDefault(LoginUserInfo, SysProgram);
            ReportForm.EmpNo        = "";
            ReportForm.StartDate    = DateTime.Now.ToString("yyyy-MM-dd");
            ReportForm.EndDate      = DateTime.Now.ToString("yyyy-MM-dd");

            ViewData["ReportForm"] = ReportForm;

            return(View());
        }
        public ActionResult HolidayForm()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;



            string       ProgramID  = "Z001";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }

            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());


            HolidayModel Holiday = ModelFactory.GetHolidayData(UserFreeStyle.SignId);

            ViewData["Holiday"] = Holiday;

            return(View());
        }
Beispiel #5
0
        public ActionResult GroupForm()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;



            string       ProgramID  = "G001";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }



            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());



            try
            {
                if (UserFreeStyle.SignId == "")
                {
                    GroupModel Group = new GroupModel();
                    Group.Mode      = "ADD"; //新增模式
                    Group.ViewLevel = "C";


                    ProgramModelFactory ProgramModelFactorys = new ProgramModelFactory();
                    Group.GroupProgramList = ProgramModelFactorys.GetGroupProgramList();


                    ViewData["Group"] = Group;
                }
                else
                {
                    GroupModel Group = ModelFactory.GetGroupData(UserFreeStyle.SignId);
                    Group.Mode        = "EDIT"; //修改模式
                    ViewData["Group"] = Group;
                }
            }
            catch (Exception ex)
            {
            }
            catch
            {
            }



            return(View());
        }
        public ActionResult ManageOutMan()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;



            string       ProgramID  = "W004";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }

            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());



            EmpModel Emp = ModelFactory.GetOutMan(UserFreeStyle.SignId);


            ViewData["Emp"] = Emp;


            return(View());
        }
Beispiel #7
0
        public ActionResult EmpForm()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;

            string ProgramID = "E001";
            ProgramModel SysProgram = null;
            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return View("../SysMsg/NoAccess");
            }
            else
            {
                SysProgram = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }

            UserFreeStyleModel UserFreeStyle;
            UserFreeStyle = JsonConvert.DeserializeObject<UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());

            try
            {
                    EmpModel Emp = ModelFactory.GetEmpData(UserFreeStyle.SignId);
                    Emp.Mode = "EDIT"; //修改模式
                    ViewData["Emp"] = Emp;
            }
            catch(Exception ex)
            {

            }
            catch
            {

            }
            return View();
        }
Beispiel #8
0
        public ActionResult Index()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;


            string       ProgramID  = "X001";
            ProgramModel SysProgram = null;

            SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
            ViewData["SysProgram"] = SysProgram;



            return(View());
        }
        public JsonResult TempEmpFormAdd(string EmpJson)
        {
            EmpModel Emp = null;

            try
            {
                Emp = JsonConvert.DeserializeObject <EmpModel>(EmpJson);

                if (Emp.CardNo != null && Emp.CardNo != "")
                {
                    //檢查日期格式 正不正確
                    if (!GeneralObj.CheckDate(Emp.CardEffectiveDate))
                    {
                        throw new Exception("卡號生效日格式有誤!");
                    }


                    if (!GeneralObj.CheckDate(Emp.CardExpiryDate))
                    {
                        throw new Exception("卡號失效日格式有誤!");
                    }



                    Emp.CardEffectiveDate = Emp.CardEffectiveDate.Replace("-", "");
                    Emp.CardExpiryDate    = Emp.CardExpiryDate.Replace("-", "");
                }



                if (ModelFactory.TempEmpAdd(Emp))
                {
                    return(Json("1"));//代表已經處裡完
                }
                else
                {
                    return(Json(""));//失敗
                }
            }
            catch (Exception ex)
            {
                return(Json(ex.Message));
            }
            catch
            {
                return(Json("系統發生錯誤"));
            }
        }
        public ActionResult Index()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;


            string       ProgramID  = "W001";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }
            return(View());
        }
        public ActionResult Manage()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;

            string       ProgramID  = "W002";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }

            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = new UserFreeStyleModel()
            {
                Name               = "AttendanceManage",
                OrderField         = "",
                OrderType          = "",
                PageNum            = "",
                SearchCompany      = GeneralObj.SearchCompanyDefault(LoginUserInfo, SysProgram),
                SearchDepartMentNo = GeneralObj.SearchDepartMentDefault(LoginUserInfo, SysProgram),
                SearchEmpNo        = "",  //搜尋人員
                SearchEmpStatus    = "1", //搜尋 離職狀態
                SearchText         = "",  //搜尋狀態
            };

            ViewData["UserFreeStyle"] = UserFreeStyle;

            return(View());
        }
        public ActionResult TempEmpForm()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;



            string       ProgramID  = "E002";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                return(View("../SysMsg/NoAccess"));
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }



            UserFreeStyleModel UserFreeStyle;

            UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());


            try
            {
                if (UserFreeStyle.SignId == "")
                {
                    EmpModel Emp = new EmpModel();
                    Emp.Mode = "ADD"; //新增模式

                    Emp.EmployeeNo        = ModelFactory.GetNewTempEmpNo();
                    Emp.CardNo            = "";
                    Emp.CardExpiryDate    = "";
                    Emp.CardEffectiveDate = "";
                    Emp.EmployeeEName     = "";
                    Emp.EmployeeName      = "";
                    Emp.DepartMentNo      = "";
                    Emp.Company           = LoginUserInfo.Company;

                    ViewData["Emp"] = Emp;
                }
                else
                {
                    EmpModel Emp = ModelFactory.GetTempEmpData(UserFreeStyle.SignId);
                    Emp.Mode        = "EDIT"; //修改模式
                    ViewData["Emp"] = Emp;
                }
            }
            catch (Exception ex)
            {
            }
            catch
            {
            }



            return(View());
        }
        public ActionResult History()
        {
            ViewData["LoginUserInfo"] = LoginUserInfo;



            string       ProgramID  = "W006";
            ProgramModel SysProgram = null;

            if (!GeneralObj.CheckProgID(LoginUserInfo.ProgramList, ProgramID))
            {
                //特例: 允許進入
                //SysProgram = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                SysProgram           = new ProgramModel();
                SysProgram.ProgID    = "W006";
                SysProgram.ProgName  = "外出歷程記錄";
                SysProgram.ViewLevel = "";

                ViewData["SysProgram"] = SysProgram;
                //return View("../SysMsg/NoAccess");
            }
            else
            {
                SysProgram             = GeneralObj.GetProgram(LoginUserInfo.ProgramList, ProgramID);
                ViewData["SysProgram"] = SysProgram;
            }



            UserFreeStyleModel UserFreeStyle;

            try
            {
                if (Request["action"] == "BACK" && Session[UserFreeStyle_id] != null)
                {
                    UserFreeStyle = JsonConvert.DeserializeObject <UserFreeStyleModel>(Session[UserFreeStyle_id].ToString());
                }
                else
                {
                    UserFreeStyle = new UserFreeStyleModel()
                    {
                        Name               = UserFreeStyle_id,
                        OrderField         = "EmployeeNo",
                        OrderType          = "ASC",
                        PageNum            = "0",
                        SearchCompany      = GeneralObj.SearchCompanyDefault(LoginUserInfo, SysProgram),
                        SearchDepartMentNo = GeneralObj.SearchDepartMentDefault(LoginUserInfo, SysProgram),
                        SearchEmpNo        = "",  //搜尋人員
                        SearchEmpStatus    = "1", //搜尋 離職狀態
                        SearchText         = "",  //搜尋狀態
                    };
                }
            }
            catch
            {
                UserFreeStyle = new UserFreeStyleModel()
                {
                    Name               = UserFreeStyle_id,
                    OrderField         = "",
                    OrderType          = "ASC",
                    PageNum            = "0",
                    SearchCompany      = GeneralObj.SearchCompanyDefault(LoginUserInfo, SysProgram),
                    SearchDepartMentNo = GeneralObj.SearchDepartMentDefault(LoginUserInfo, SysProgram),
                    SearchEmpNo        = "",  //搜尋人員
                    SearchEmpStatus    = "1", //搜尋 離職狀態
                    SearchText         = "",  //搜尋狀態
                };
            }


            Session[UserFreeStyle_id] = JsonConvert.SerializeObject(UserFreeStyle);
            ViewData["UserFreeStyle"] = UserFreeStyle;


            return(View());
        }