示例#1
0
        //默认登录界面
        public ActionResult Index(string appKey = "", string username = "")
        {
            TempData[AppInfo] = _appInfoService.Get(p => p.Id == appKey);

            var viewModel = new PassportLoginRequest
            {
                AppKey   = appKey,
                UserName = username
            };

            return(View(viewModel));
        }
示例#2
0
        /// <summary>
        /// ajax 调用按钮方法
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //[WebMethod]
        public void Save()
        {
            string id = WebUtil.Get("id");                                     //唯一编号
            string ActionDefinitionID   = WebUtil.Get("ActionDefinitionID");   //按钮动作ID
            string ActionDefinitionName = WebUtil.Get("ActionDefinitionName"); //按钮动作名称
            string content = WebUtil.GetForm("Content").HtmlEncode();          //防止跨站脚本注入

            bool IsStartWF = WebUtil.Get("IsStartWF", false);                  //按钮动作名称
            bool IsExists  = true;

            Sys_Module    ModuleInfo = new Sys_Module();
            Sys_ModuleBLL ModuleBLL  = new Sys_ModuleBLL();
            DateTime      dt         = DateTime.Now;

            if (id.IsNullOrEmpty())
            {
                IsExists   = false;
                ModuleInfo = FormToModelHelper <Sys_Module> .ConvertToModel(HttpContext.Current);

                ModuleInfo.Id        = Guid.NewGuid().ToString();
                ModuleInfo.AddUserId = CurrUserInfo().UserID;
                ModuleInfo.AddTime   = dt;
                //ModuleInfo.EditUserId = CurrUserInfo().UserID;
                //ModuleInfo.EditTime = dt;
                //ModuleInfo.IsDelete = false;
                //ModuleInfo.IsShow = true;
            }
            else
            {
                ModuleInfo = ModuleBLL.Get(p => p.Id == id);
                //复制
                ModuleInfo = FormToModelHelper <Sys_Module> .ConvertToModel(HttpContext.Current, ModuleInfo);
            }


            #region 流程与数据交换方法
            //流程启动正常
            if (IsExists)
            {
                IsExists = new Sys_ModuleBLL().Update(ModuleInfo);
            }
            else
            {
                ModuleInfo = new Sys_ModuleBLL().AddEntity(ModuleInfo);
                IsExists   = ModuleInfo.IsNotNull() ? true : false;
            }

            if (IsExists)
            {
                Result.SetData(ModuleInfo);
                Result.SetError(false).SetMsg(ActionDefinitionName + "成功").Output();
            }
            else
            {
                Result.SetError(true).SetMsg("保存出错,请重试").Output();
            }
            #endregion
        }