Exemple #1
0
        /// <summary>
        /// 检查用户是否登录
        /// </summary>
        /// <param name="SessionName">SessionName ex:PublicUser</param>
        /// <param name="CSIDBConnectionString">数据库连接串</param>
        /// <returns>true or false</returns>
        public bool CheckLogin(string SessionName, string CSIDBConnectionString)
        {
            if (HttpContext.Current.Session["PublicUser"] == null)
            {
                if (System.Web.HttpContext.Current.Request.Cookies["UserInfo"] == null || string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Cookies["UserInfo"]["UserName"]) || string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Cookies["UserInfo"]["UserPwd"]))
                {
                    return(false);
                }

                string UserName = System.Web.HttpContext.Current.Request.Cookies["UserInfo"]["SessionN"].ToString();
                string userpass = System.Web.HttpContext.Current.Request.Cookies["UserInfo"]["SessionP"].ToString();

                UserName = Shinfotech.Tools.Encryptions.DecryptDES(UserName, "shunovo2015");
                userpass = Shinfotech.Tools.Encryptions.DecryptDES(userpass, "shunovo2015");


                string        Password = ShInfoTech.Common.Security.Md5(userpass);
                BL_UserEntity UserEnt  = new BL_UserEntity();
                MD_UserEntity Users    = UserEnt.getUserInfo(UserName, Password);
                if (Users == null)
                {
                    return(false);
                }
                HttpContext.Current.Session["PublicUser"] = Users;

                //return false;
            }
            return(true);
        }
        public static string logins(string username, string userpass)
        {
            string Link = string.Empty;

            string UserName = Shinfotech.Tools.Encryptions.EncryptDES(username, "shunovo2015");
            string Password = Shinfotech.Tools.Encryptions.EncryptDES(userpass, "shunovo2015");

            Password = ShInfoTech.Common.Security.Md5(userpass);

            BL_UserEntity UserEnt = new BL_UserEntity();
            MD_UserEntity Users   = UserEnt.getUserInfo(username, Password);

            if (Users == null)
            {
                return("");
            }
            HttpContext.Current.Session["PublicUser"] = Users;


            setUpCookies(UserName, Password);
            string sql = "select TL_Link from CT_Tab_Links with(nolock) where TL_Level=1 and TL_Order=1 and TL_UG_Code=" + Users.User.AU_UG_Code + "";

            using (SqlDataReader dr = SqlHelper.ExecuteReader(Tools.GetConnString(), CommandType.Text, sql))
            {
                while (dr.Read())
                {
                    Link = Security.ToStr(dr["TL_Link"]);
                }
            }

            return(Link);
        }
Exemple #3
0
    private void getGroupList(dynamic data)
    {
        BL_UserEntity _user      = new BL_UserEntity();
        string        user_group = _user.getGroupList(1, Interna);

        Response.Write(user_group);
    }
    public static string WechatRegister(string mobile, string Pwd)
    {
        string openId = wechatHandle.GetOpenId(HttpContext.Current, "");

        if (string.IsNullOrEmpty(openId))
        {
            //openId = "ogw2MjhK4qPJbDSmtCeXWLezqAOM1";
        }
        BL_UserEntity u = new BL_UserEntity();
        string        i = u.WechatRegister(mobile, ShInfoTech.Common.Security.Md5(Pwd), openId);

        return(i);
    }
    public static int VerificationUsername(string mobile)
    {
        string openId = wechatHandle.GetOpenId(HttpContext.Current, "");

        if (string.IsNullOrEmpty(openId))
        {
            //openId = "ogw2MjhK4qPJbDSmtCeXWLezqAOM1";
        }
        BL_UserEntity u = new BL_UserEntity();
        int           i = u.VerificationUsername(mobile, openId);

        return(i);
    }
Exemple #6
0
    private void getGroupUser(dynamic data)
    {
        int UG_Code = -1;

        if (data.UG_Code != null)
        {
            UG_Code = (int)data.UG_Code;
        }
        int           ad_code = UserSession.DealerEmpl.DE_AD_OM_Code;
        BL_UserEntity _user   = new BL_UserEntity();
        string        _users  = _user.getGroupUser(ad_code, UG_Code);

        Response.Write(_users);
    }
    private IEnumerable <dynamic> Get_CT_Reports_Method(int CG_Type, int CA)
    {
        MD_UserEntity _user = BL_UserEntity.GetUserInfo();

        if (_user == null)
        {
            return(null);
        }
        var db  = DBCRMTree.GetInstance();
        var sql = string.Format(@"SELECT  RP_Code AS [value] ,
            dbo.F_Format_Paramters({0}, RP_Code,{1},{2}) AS [text],
            {0} as ex_text
            FROM CT_Reports
            WHERE RP_Type IN ( 2, 5, 7, 9, 10, 11 ) 
            AND @0 IN ( SELECT * FROM dbo.f_split(RP_Camp_Type, ',') ) AND(RP_Cat4=@1 OR RP_Cat4 IS NULL)
            order by RP_Sort
            ",
                                Interna ? "[RP_Name_EN]" : "[RP_Name_CN]", _user.User.UG_UType, _user.DealerEmpl.DE_AD_OM_Code);

        return(db.Query <dynamic>(sql, CG_Type, CA));
    }
    private IEnumerable <string> Get_CT_Reports_Info(int RP_Code, int CG_Code)
    {
        MD_UserEntity _user = BL_UserEntity.GetUserInfo();

        if (_user == null)
        {
            return(null);
        }
        int _In = 0;

        if (Language.GetLang2() == EM_Language.en_us)
        {
            _In = 1;
        }
        var db = DBCRMTree.GetInstance();

        var sql = string.Format(@" SELECT dbo.F_Format_Paramters_Target({0},{1},{2},{3},{4})",
                                RP_Code, CG_Code, _user.User.UG_UType, _user.DealerEmpl.DE_AD_OM_Code, _In);

        return(db.Query <string>(sql));
    }
Exemple #9
0
    /// <summary>
    /// 设置文件名
    /// </summary>
    /// <returns></returns>
    private string SetFileName()
    {
        MD_UserEntity _user = BL_UserEntity.GetUserInfo();

        return(new BL_CRMhandle().GetMIName(MI_Code, FL_Code, Interna) + "_" + _user.User.AU_Code + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xls");;
    }