示例#1
0
        public IActionResult Login()
        {
            base.SetGlobalViewBag();
            string DefaultUrl = CPAppContext.GetPara("DefaultUrl");

            if (string.IsNullOrEmpty(DefaultUrl))
            {
                DefaultUrl = "/Plat/Portal/SysFrame";
            }
            ViewBag.DefaultUrl = DefaultUrl;
            return(View());
        }
示例#2
0
文件: CPMsgs.cs 项目: vebin/qMISPlat
        public bool DeleteMsg(List <int> msgIdCol, out string errorMsg)
        {
            errorMsg = "";
            if (msgIdCol.Count <= 0)
            {
                return(true);
            }
            string MsgSendHandler = CPAppContext.GetPara("MsgSendHandler");

            if (string.IsNullOrEmpty(MsgSendHandler))
            {
                return(true);
            }
            bool b = true;

            string[] sArray = MsgSendHandler.Split(';');
            for (int i = 0; i < sArray.Length; i++)
            {
                if (string.IsNullOrEmpty(sArray[i]))
                {
                    continue;
                }
                try
                {
                    ICPMsgHandler inter = null;
                    if (sArray[i].Equals("CPFrameWork.Global.Msg.CPMsgInnerDbHandler,CPFrameWork.Global", StringComparison.CurrentCultureIgnoreCase))
                    {
                        inter = new CPMsgInnerDbHandler();
                    }
                    else
                    {
                        inter = Activator.CreateInstance(Type.GetType(sArray[i])) as ICPMsgHandler;
                    }
                    inter.CPMsgRep = this._CPMsgRep;
                    b = inter.DeleteMsg(msgIdCol);
                    if (!b)
                    {
                        errorMsg = "调用消息接口【" + sArray[i] + "】删除消息时出错。";
                        return(b);
                    }
                }
                catch (Exception ex)
                {
                    errorMsg = "调用消息接口【" + sArray[i] + "】删除消息时出错,详细信息如下:" + ex.Message;
                    return(false);
                }
            }
            return(true);
        }
示例#3
0
        public IActionResult LoginOut()
        {
            CPAppContext.GetHttpContext().Session.Clear();
            string loginUrl = CPAppContext.GetPara("LoginUrl");

            if (string.IsNullOrEmpty(loginUrl))
            {
                return(RedirectToAction("Login"));
            }
            else
            {
                return(Redirect(CPAppContext.CPWebRootPath() + loginUrl));
            }
            //
        }
示例#4
0
 public IActionResult SysFrame()
 {
     base.SetGlobalViewBag();
     ViewBag.UserName      = CPExpressionHelper.Instance.RunCompile("${CPUser.UserName()}");
     ViewBag.UserId        = CPExpressionHelper.Instance.RunCompile("${CPUser.UserId()}");
     ViewBag.UserPhotoPath = CPExpressionHelper.Instance.RunCompile("${CPUser.UserPhotoPath()}");
     if (string.IsNullOrEmpty(ViewBag.UserPhotoPath))
     {
         ViewBag.UserPhotoPath = "../../Style/CommonImage/UserNoPic.png";
     }
     else
     {
         ViewBag.UserPhotoPath = CPAppContext.CPWebRootPath() + "/api/CPCommonEngine/ShowPicture?FilePath=" + System.Web.HttpUtility.UrlEncode(ViewBag.UserPhotoPath);
     }
     ViewBag.SystemTitle = CPAppContext.GetPara("SystemTitle");
     return(View());
 }