public static Logins GetLoginData(Guid organizationId, string emailAddress) { Logins lg = new Logins(organizationId); lg.Where.Email.Value = emailAddress; lg.Where.Email.Operator = NCI.EasyObjects.WhereParameter.Operand.Equal; lg.Query.Load(); return (lg.RowCount > 0 ? lg : null); }
public static Logins GetLoginData(Guid organizationId, string emailAddress) { Logins lg = new Logins(organizationId); lg.Where.Email.Value = emailAddress; lg.Where.Email.Operator = NCI.EasyObjects.WhereParameter.Operand.Equal; lg.Query.Load(); return(lg.RowCount > 0 ? lg : null); }
public static String GetLoginPassword(Guid organizationId, string emailAddress) { Logins lg = new Logins(organizationId); lg.Where.Email.Value = emailAddress; lg.Where.Email.Operator = NCI.EasyObjects.WhereParameter.Operand.Equal; lg.Query.Load(); return(lg.RowCount > 0 ? lg.Password : String.Empty); }
public static int AddLogin(Guid organizationId, string firstName, string lastName, string emailAddress) { string password = bigWebApps.bigWebDesk.Data.Logins.GenerateRandomPassword(); Exception error = null; try { Micajah.Common.Bll.Providers.UserProvider.AddUserToOrganization(emailAddress, firstName, lastName, null, null, null, null, null, null, null, null, null, null, null, null, (string)null, organizationId, password, false, false); } catch (System.Net.Mail.SmtpException ex) { error = ex; } try { Logins lg = new Logins(organizationId); lg.AddNew(); lg.FirstName = firstName; lg.LastName = lastName; lg.Email = emailAddress; lg.Password = password; lg.ConfigUnassignedQue = false; lg.Save(); if (error != null) { throw error; } return(lg.Id); } catch (SqlException ex) { switch (ex.Number) { case 2601: throw new DuplicateLoginException(String.Format(ERR_DUPLICATE_LOGIN, emailAddress), ex); default: throw new ApplicationException(ex.Message, ex); } } catch (Exception ex) { throw ex; } }
public static int AddLogin(Guid organizationId, string firstName, string lastName, string emailAddress) { string password = bigWebApps.bigWebDesk.Data.Logins.GenerateRandomPassword(); Exception error = null; try { Micajah.Common.Bll.Providers.UserProvider.AddUserToOrganization(emailAddress, firstName, lastName, null, null, null, null, null, null, null, null, null, null, null, null, (string)null, organizationId, password, false, false); } catch (System.Net.Mail.SmtpException ex) { error = ex; } try { Logins lg = new Logins(organizationId); lg.AddNew(); lg.FirstName = firstName; lg.LastName = lastName; lg.Email = emailAddress; lg.Password = password; lg.ConfigUnassignedQue = false; lg.Save(); if (error != null) throw error; return lg.Id; } catch (SqlException ex) { switch (ex.Number) { case 2601: throw new DuplicateLoginException(String.Format(ERR_DUPLICATE_LOGIN, emailAddress), ex); default: throw new ApplicationException(ex.Message, ex); } } catch (Exception ex) { throw ex; } }
// for external use - web service public static DataSet GetLoginData(Guid organizationId, int loginID) { Logins lg = new Logins(organizationId); lg.Where.Id.Value = loginID; lg.Where.Id.Operator = WhereParameter.Operand.Equal; lg.Query.AddResultColumn(tbl_LoginsSchema.FirstName); lg.Query.AddResultColumn(tbl_LoginsSchema.LastName); lg.Query.AddResultColumn(tbl_LoginsSchema.Email); lg.Query.Load(); if (lg.DefaultView.Table.Rows.Count > 0) { DataSet ds = new DataSet(); ds.Tables.Add(lg.DefaultView.Table); return(ds); } return(null); }
// for external use - web service public static DataSet GetLoginData(Guid organizationId, int loginID) { Logins lg = new Logins(organizationId); lg.Where.Id.Value = loginID; lg.Where.Id.Operator = WhereParameter.Operand.Equal; lg.Query.AddResultColumn(tbl_LoginsSchema.FirstName); lg.Query.AddResultColumn(tbl_LoginsSchema.LastName); lg.Query.AddResultColumn(tbl_LoginsSchema.Email); lg.Query.Load(); if (lg.DefaultView.Table.Rows.Count > 0) { DataSet ds = new DataSet(); ds.Tables.Add(lg.DefaultView.Table); return ds; } return null; }
public static String GetLoginPassword(Guid organizationId, string emailAddress) { Logins lg = new Logins(organizationId); lg.Where.Email.Value = emailAddress; lg.Where.Email.Operator = NCI.EasyObjects.WhereParameter.Operand.Equal; lg.Query.Load(); return (lg.RowCount > 0 ? lg.Password : String.Empty); }
public static string GetLoginEmail(Guid organizationId, int ID) { Logins lg = new Logins(organizationId); return lg.LoadByPrimaryKey(ID) ? lg.Email : string.Empty; }
public static string GetLoginEmail(Guid organizationId, int ID) { Logins lg = new Logins(organizationId); return(lg.LoadByPrimaryKey(ID) ? lg.Email : string.Empty); }