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")); }
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); }
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; }
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"); }