示例#1
0
文件: Users.cs 项目: pank1982/mydoc
    public static string RegisterUser()
    {
        AMADBasePage obj = new AMADBasePage();
        Database     db  = new Database(ConnectionManager.GetDatabaseConnectionString());
        SqlParameter p1  = new SqlParameter("FirstName", FirstName);
        SqlParameter p2  = new SqlParameter("LastName", LastName);
        SqlParameter p3  = new SqlParameter("EmailAddress", EmailAddress);
        SqlParameter p4  = new SqlParameter("MobileNumber", MobileNumber);
        SqlParameter p5  = new SqlParameter("Token", ActivationToken);
        SqlParameter p6  = new SqlParameter("Password", obj.Encrypt(obj.GeneratePassword(), ConfigurationManager.AppSettings["ENCKI"].ToString()));
        SqlParameter p7  = new SqlParameter("IsPatient", IsPatient);
        SqlParameter p8  = new SqlParameter("Key", ConfigurationManager.AppSettings["ENCKI"].ToString());
        object       o   = db.ExecuteScalar("fb_amad_RegisterUser", p1, p2, p3, p4, p5, p6, p7, p8);

        return(string.Format(o != null ? Convert.ToString(o) : "0"));
    }
示例#2
0
文件: Users.cs 项目: pank1982/mydoc
    public static DataSet ValidateLogin(string username, string password)
    {
        int     retval = 0;
        DataSet ds     = new DataSet();

        if (username.Contains("@") && username.Contains("."))
        {
            AMADBasePage obj = new AMADBasePage();
            Database     db  = new Database(ConnectionManager.GetDatabaseConnectionString());
            SqlParameter p1  = new SqlParameter("LoginName", username);
            SqlParameter p2  = new SqlParameter("Password", obj.Encrypt(password, ConfigurationManager.AppSettings["ENCKI"].ToString()));
            SqlParameter p3  = new SqlParameter("ApplicationName", "AMAD");
            SqlParameter p4  = new SqlParameter("UserNameType", "EMAIL");
            SqlParameter p5  = new SqlParameter("AccountStatus", 0);
            SqlParameter p6  = new SqlParameter("LoginType", "");
            p5.Direction = ParameterDirection.Output;
            p6.Direction = ParameterDirection.Output;
            ds           = db.ExecuteDataSet("fb_ValidateLogin", p1, p2, p3, p4, p5, p6);
            UserType     = Convert.ToString(p6.Value);
            retval       = Convert.ToInt32(Convert.ToString(p5.Value));
        }
        else
        {
            AMADBasePage obj = new AMADBasePage();
            Database     db  = new Database(ConnectionManager.GetDatabaseConnectionString());
            SqlParameter p1  = new SqlParameter("LoginName", username);
            SqlParameter p2  = new SqlParameter("Password", obj.Encrypt(password, ConfigurationManager.AppSettings["ENCKI"].ToString()));
            SqlParameter p3  = new SqlParameter("ApplicationName", "AMAD");
            SqlParameter p4  = new SqlParameter("UserNameType", "USERNAME");
            SqlParameter p5  = new SqlParameter("AccountStatus", "0");
            SqlParameter p6  = new SqlParameter("LoginType", "");
            p5.Direction = ParameterDirection.Output;
            p6.Direction = ParameterDirection.Output;
            ds           = db.ExecuteDataSet("fb_ValidateLogin", p1, p2, p3, p4, p5, p6);
            UserType     = Convert.ToString(p6.Value);
            retval       = Convert.ToInt32(Convert.ToString(p5.Value));
        }
        return(ds);
    }
示例#3
0
文件: Users.cs 项目: pank1982/mydoc
 public static DataSet ValidateLogin(string username, string password)
 {
     int retval = 0;
     DataSet ds = new DataSet();
     if (username.Contains("@") && username.Contains("."))
     {
         AMADBasePage obj = new AMADBasePage();
         Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
         SqlParameter p1 = new SqlParameter("LoginName", username);
         SqlParameter p2 = new SqlParameter("Password", obj.Encrypt(password, ConfigurationManager.AppSettings["ENCKI"].ToString()));
         SqlParameter p3 = new SqlParameter("ApplicationName", "AMAD");
         SqlParameter p4 = new SqlParameter("UserNameType", "EMAIL");
         SqlParameter p5 = new SqlParameter("AccountStatus", 0);
         SqlParameter p6 = new SqlParameter("LoginType", "");
         p5.Direction = ParameterDirection.Output;
         p6.Direction = ParameterDirection.Output;
         ds = db.ExecuteDataSet("fb_ValidateLogin", p1, p2, p3, p4, p5, p6);
         UserType = Convert.ToString(p6.Value);
         retval = Convert.ToInt32(Convert.ToString(p5.Value));
     }
     else
     {
         AMADBasePage obj = new AMADBasePage();
         Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
         SqlParameter p1 = new SqlParameter("LoginName", username);
         SqlParameter p2 = new SqlParameter("Password", obj.Encrypt(password, ConfigurationManager.AppSettings["ENCKI"].ToString()));
         SqlParameter p3 = new SqlParameter("ApplicationName", "AMAD");
         SqlParameter p4 = new SqlParameter("UserNameType", "USERNAME");
         SqlParameter p5 = new SqlParameter("AccountStatus", "0");
         SqlParameter p6 = new SqlParameter("LoginType", "");
         p5.Direction = ParameterDirection.Output;
         p6.Direction = ParameterDirection.Output;
         ds = db.ExecuteDataSet("fb_ValidateLogin", p1, p2, p3, p4, p5, p6);
         UserType = Convert.ToString(p6.Value);
         retval = Convert.ToInt32(Convert.ToString(p5.Value));
     }
     return ds;
 }
示例#4
0
文件: Users.cs 项目: pank1982/mydoc
 public static string RegisterUser()
 {
     AMADBasePage obj = new AMADBasePage();
     Database db = new Database(ConnectionManager.GetDatabaseConnectionString());
     SqlParameter p1 = new SqlParameter("FirstName", FirstName);
     SqlParameter p2 = new SqlParameter("LastName", LastName);
     SqlParameter p3 = new SqlParameter("EmailAddress", EmailAddress);
     SqlParameter p4 = new SqlParameter("MobileNumber", MobileNumber);
     SqlParameter p5 = new SqlParameter("Token", ActivationToken);
     SqlParameter p6 = new SqlParameter("Password", obj.Encrypt(obj.GeneratePassword(), ConfigurationManager.AppSettings["ENCKI"].ToString()));
     SqlParameter p7 = new SqlParameter("IsPatient", IsPatient);
     SqlParameter p8 = new SqlParameter("Key", ConfigurationManager.AppSettings["ENCKI"].ToString());
     object o = db.ExecuteScalar("fb_amad_RegisterUser", p1, p2, p3, p4, p5, p6, p7, p8);
     return string.Format(o != null ? Convert.ToString(o) : "0");
 }