Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public JsonResult EditOutgoing(AppOutgoingModel AppOutgoing)
        {
            JsonresultModel ResultModel = new JsonresultModel();

            try
            {
                CheckOutDatetime(AppOutgoing.SDate, AppOutgoing.STime);
                CheckOutDatetime(AppOutgoing.SDate, AppOutgoing.GoOutTime);

                OutgoingEventModel Outgoing = new OutgoingEventModel();


                OutgoingModelFactory ModelFactory = new OutgoingModelFactory();

                EmpModel EMP = ModelFactory.GetOutMan(AppOutgoing.OutMan);

                Outgoing.OutId     = AppOutgoing.OutId;
                Outgoing.OutMan    = EMP.EmployeeNo;
                Outgoing.Company   = EMP.Company;
                Outgoing.RecordMan = EMP.EmployeeNo;

                Outgoing.Location       = System.Web.HttpUtility.UrlDecode(AppOutgoing.Location);
                Outgoing.CustomerName   = System.Web.HttpUtility.UrlDecode(AppOutgoing.CustomerName);
                Outgoing.OutDescription = "";
                Outgoing.Status         = "U";//編輯
                Outgoing.OutDate        = AppOutgoing.SDate.Replace("-", "");
                Outgoing.OutTime        = AppOutgoing.STime.Replace(":", "");
                Outgoing.GoOutTime      = AppOutgoing.GoOutTime.Replace(":", "");
                Outgoing.Equipment      = "1";


                if (ModelFactory.EditOutgoing(Outgoing))
                {
                    ResultModel.Result = "1";
                    return(Json(ResultModel, JsonRequestBehavior.AllowGet));//代表已經處裡完
                }
                else
                {
                    ResultModel.Result   = "0";
                    ResultModel.ErrorMsg = "編輯外出失敗";
                    return(Json(ResultModel, JsonRequestBehavior.AllowGet));//失敗
                }
            }
            catch (Exception ex)
            {
                ResultModel.Result   = "0";
                ResultModel.ErrorMsg = ex.Message;
                return(Json(ResultModel, JsonRequestBehavior.AllowGet));
            }
            catch
            {
                ResultModel.Result   = "0";
                ResultModel.ErrorMsg = "系統發生錯誤";
                return(Json(ResultModel, JsonRequestBehavior.AllowGet));
            }
        }