Example #1
0
    public static WCFLogin Make(int usercode, string password)
    {
        WCFLogin item = new WCFLogin();

        item.Usercode = usercode;
        item.Password = password;
        return(item);
    }
Example #2
0
    public string Login(WCFLogin login)
    {
        string wcfe     = "";
        string usercode = Convert.ToString(login.Usercode);
        bool   result   = Membership.ValidateUser(usercode, login.Password);

        if (result)
        {
            string role = Roles.GetRolesForUser(usercode)[0];
            Random rnd1 = new Random(133333333);
            int    i1   = rnd1.Next(1, 99999999);
            Random rnd2 = new Random(2888888);
            int    i2   = rnd2.Next(1, 99999999);
            wcfe = ":" + usercode + ":" + role + ":" + i1 + i2;
        }
        return(wcfe);
    }