Beispiel #1
0
        /// <summary>
        /// 修改用户最后操作时间
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message MdyLastOpTime(T_SYSSEC_IPSUSER_Model m)
        {
            //判断用户序号是否存在于系统扩展表中
            if (T_SYSSEC_USER.isExists(new T_SYSSEC_IPSUSER_SW {
                USERID = m.USERID
            }) == false)
            {
                return(new Message(false, "修改失败,系统用户不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("update T_SYSSEC_USER");
            sb.AppendFormat(" set ");
            sb.AppendFormat(" LASTOPTIME='{0}'", ClsSql.EncodeSql(PublicClassLibrary.ClsSwitch.SwitTM(DateTime.Now)));
            sb.AppendFormat(" where USERID= '{0}'", ClsSql.EncodeSql(m.USERID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(T_SYSSEC_IPSUSER_Model m)
        {
            //判断用户序号是否存在于系统扩展表中
            if (T_SYSSEC_USER.isExists(new T_SYSSEC_IPSUSER_SW {
                USERID = m.USERID
            }) == false)
            {
                return(new Message(false, "添加失败,系统用户不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO T_SYSSEC_IPSUSER(USERID,SEX,PHONE,USERJOB)");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.USERID));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.SEX));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.PHONE));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.USERJOB));
            sb.AppendFormat(")");
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(T_SYSSEC_IPSUSER_Model m)
        {
            //判断用户序号是否存在于系统扩展表中
            if (T_SYSSEC_USER.isExists(new T_SYSSEC_IPSUSER_SW {
                USERID = m.USERID
            }) == false)
            {
                return(new Message(false, "修改失败,系统用户不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("update T_SYSSEC_IPSUSER");
            sb.AppendFormat(" set ");
            sb.AppendFormat(" SEX='{0}'", ClsSql.EncodeSql(m.SEX));
            sb.AppendFormat(",PHONE='{0}'", ClsSql.EncodeSql(m.PHONE));
            sb.AppendFormat(",USERJOB='{0}'", ClsSql.EncodeSql(m.USERJOB));
            sb.AppendFormat(" where USERID= '{0}'", ClsSql.EncodeSql(m.USERID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Beispiel #4
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(T_SYSSEC_IPSUSER_Model m)
        {
            if (isExists(new T_SYSSEC_IPSUSER_SW {
                LOGINUSERNAME = m.LOGINUSERNAME
            }) == true)
            {
                return(new Message(false, "添加失败,登陆名重复请重新输入!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO T_SYSSEC_USER(ORGNO,LOGINUSERNAME,USERNAME,USERPWD,REGISTERTIME,LOGINNUM,NOTE,DEPARTMENT)");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.ORGNO));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.LOGINUSERNAME));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.USERNAME));
            sb.AppendFormat(",'{0}'", ClsStr.getSystemManMd5(ClsSql.EncodeSql(m.USERPWD)));
            sb.AppendFormat(",'{0}'", PublicClassLibrary.ClsSwitch.SwitTM(DateTime.Now));
            sb.AppendFormat(",'{0}'", "0");
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.NOTE));
            sb.AppendFormat(",'{0}'", ClsSql.EncodeSql(m.DEPARTMENT));
            sb.AppendFormat(")");
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }
Beispiel #5
0
        /// <summary>
        /// 获取用户ID
        /// </summary>
        /// <returns>用户ID</returns>
        public static string getUserID()
        {
            CookieModel cm = getCookieInfo();

            if (ConfigCls.getIsSaveLastOpTime() != "0" && string.IsNullOrEmpty(cm.UID) == false)//需要判断用户在线状态
            {
                //更改该用户最后操作时间
                T_SYSSEC_IPSUSER_Model m = new T_SYSSEC_IPSUSER_Model {
                    USERID = cm.UID, opMethod = "MdyLastOpTime"
                };
                T_SYSSEC_IPSUSERCls.Manager(m);
            }
            return(cm.UID);
        }
Beispiel #6
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Del(T_SYSSEC_IPSUSER_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete T_SYSSEC_USER");
            sb.AppendFormat(" where USERID= '{0}'", ClsSql.EncodeSql(m.USERID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
        //
        // GET: /Interface/

        public ActionResult SystemRedirect()
        {
            SystemCls.ClearLoginState();
            string uid = Request.Params["uid"];

            if (string.IsNullOrEmpty(uid))
            {
                ViewBag.logined = "自动登录失败";
            }
            else
            {
                T_SYSSEC_IPSUSER_Model m = T_SYSSEC_IPSUSERCls.getModel(new T_SYSSEC_IPSUSER_SW {
                    USERID = uid
                });

                CookieModel cookieM = new CookieModel();
                if (m != null)
                {
                    if (string.IsNullOrEmpty(m.USERID))
                    {
                        ViewBag.logined = "自动登录失败";
                    }
                    else
                    {
                        cookieM.UID      = m.USERID;
                        cookieM.userName = m.LOGINUSERNAME;
                        cookieM.trueName = m.USERNAME;
                        cookieM.SaveType = "true";
                        SystemCls.SaveLoginState(cookieM);
                        ViewBag.logined = "<script language=\"javascript\">window.location.href = '" + ConfigCls.getLoginRedirectUrl(m.USERID) + "';</script>";
                    }
                }
                else
                {
                    ViewBag.logined = "自动登录失败";
                }
            }
            return(View());
        }
Beispiel #8
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(T_SYSSEC_IPSUSER_Model m)
        {
            if (string.IsNullOrEmpty(m.USERID))
            {
                return(new Message(false, "修改失败,无效的用户序号!", ""));
            }
            if (isExists(new T_SYSSEC_IPSUSER_SW {
                USERID = m.USERID
            }) == false)
            {
                return(new Message(false, "修改失败,用户名不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("UPDATE T_SYSSEC_USER");
            sb.AppendFormat(" set ");
            sb.AppendFormat("ORGNO='{0}'", ClsSql.EncodeSql(m.ORGNO));
            sb.AppendFormat(",LOGINUSERNAME='******'", ClsSql.EncodeSql(m.LOGINUSERNAME));
            sb.AppendFormat(",USERNAME='******'", ClsSql.EncodeSql(m.USERNAME));
            if (string.IsNullOrEmpty(m.USERPWD) == false)
            {
                sb.AppendFormat(",USERPWD='{0}'", ClsStr.getSystemManMd5(ClsSql.EncodeSql(m.USERPWD)));
            }
            sb.AppendFormat(" ,NOTE= '{0}'", ClsSql.EncodeSql(m.NOTE));
            sb.AppendFormat(" ,DEPARTMENT= '{0}'", ClsSql.EncodeSql(m.DEPARTMENT));
            sb.AppendFormat(" where USERID= '{0}'", ClsSql.EncodeSql(m.USERID));

            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Beispiel #9
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Del(T_SYSSEC_IPSUSER_Model m)
        {
            //判断用户序号是否存在于系统扩展表中
            if (isExists(new T_SYSSEC_IPSUSER_SW {
                USERID = m.USERID
            }) == false)
            {
                return(new Message(false, "删除失败,系统用户不存在!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete T_SYSSEC_IPSUSER");
            sb.AppendFormat(" where USERID= '{0}'", ClsSql.EncodeSql(m.USERID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }