Пример #1
0
        public ActionResult WorkerEdit(string workerId)
        {
            BLL.Organize.Worker worker = new BLL.Organize.Worker();

            if (string.IsNullOrEmpty(workerId))
            {
                B_WORKER wo = worker.GetWorkerById(null);
                ViewData["workerId"] = wo.ID;
                ViewData["entity"]   = wo;

                ViewData["title"]   = null;
                ViewData["IsQuota"] = null;

                this.ViewData["type"] = "add";
            }
            else
            {
                int intWorkerId = int.Parse(workerId);  //去掉"Worker-"前缀

                B_WORKER wo = worker.GetWorkerById(intWorkerId);

                ViewData["entity"]   = wo;
                ViewData["workerId"] = intWorkerId;
                ViewData["title"]    = wo.TitleTechnicalID;
                ViewData["JobLevel"] = wo.JobLevel;

                ViewData["IsQuota"] = wo.IsQuota;

                this.ViewData["type"] = "update";
            }

            ViewData["display"] = AppConfig.GetStringConfigValue("WorkerExtendedAttribute") == "N" ? "display: none" : "";

            return(View());
        }
Пример #2
0
        private B_WORKER GetCurrentUser()
        {
            BLL.Organize.Worker worker = new BLL.Organize.Worker();

            return(worker.GetWorkerById(int.Parse(User.Identity.Name.Split('|')[0])));
        }