Пример #1
0
        public ActionResult AddApplyCar(Models.ApplyCar.ApplyCarEditModel vm)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var error = new List <string>();
                if (error.Count == decimal.Zero)
                {
                    //审批内容表记录
                    var tb = new Wechat.Entity.tbWeOAApplyCar();
                    tb.CarTime       = vm.ApplyCarEditDto.CarTime;
                    tb.Destination   = vm.ApplyCarEditDto.Destination;
                    tb.OtherUsers    = vm.ApplyCarEditDto.OtherUsers;
                    tb.Remark        = vm.ApplyCarEditDto.Remark;
                    tb.tbTeacherDept = db.Set <Teacher.Entity.tbTeacherDept>().Find(vm.ApplyCarEditDto.tbTeacherDeptId);
                    db.Set <Wechat.Entity.tbWeOAApplyCar>().Add(tb);
                    db.SaveChanges();

                    //执行流程引擎
                    OAWeWorkFlow.ExecuteWorkFlowEngine(db, flowTypeCode, tb.Id, "", "发起流程", false, vm.ApplyCarEditDto.NextApproveUserId);
                }
                else
                {
                    return(Content(string.Join("\r\n", error)));//不提交文件表单的方式
                }
                return(Code.MvcHelper.Post(error, Url.Action("ApplyCarIndex")));
            }
        }
Пример #2
0
        public ActionResult AddApplyCar()
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var vm    = new Models.ApplyCar.ApplyCarEditModel();
                var depts = (from p in db.Table <Teacher.Entity.tbTeacherDept>()
                             select new Code.MuiJsonDataBind
                {
                    text = p.TeacherDeptName,
                    value = p.Id.ToString(),
                }).ToList();
                vm.DepartListJson = JsonConvert.SerializeObject(depts);

                return(View(vm));
            }
        }