Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
        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;
            }
        }
Esempio n. 6
0
        // 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);
        }
Esempio n. 7
0
 // 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;
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 public static string GetLoginEmail(Guid organizationId, int ID)
 {
     Logins lg = new Logins(organizationId);
     return lg.LoadByPrimaryKey(ID) ? lg.Email : string.Empty;
 }
Esempio n. 10
0
        public static string GetLoginEmail(Guid organizationId, int ID)
        {
            Logins lg = new Logins(organizationId);

            return(lg.LoadByPrimaryKey(ID) ? lg.Email : string.Empty);
        }