コード例 #1
0
ファイル: Logins.cs プロジェクト: evgeniynet/DataLayer
 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);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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;
            }
        }
コード例 #5
0
ファイル: Logins.cs プロジェクト: evgeniynet/DataLayer
        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;
            }
        }
コード例 #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);
        }
コード例 #7
0
ファイル: Logins.cs プロジェクト: evgeniynet/DataLayer
 // 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;
 }
コード例 #8
0
ファイル: Logins.cs プロジェクト: evgeniynet/DataLayer
 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);
 }
コード例 #9
0
ファイル: Logins.cs プロジェクト: evgeniynet/DataLayer
 public static string GetLoginEmail(Guid organizationId, int ID)
 {
     Logins lg = new Logins(organizationId);
     return lg.LoadByPrimaryKey(ID) ? lg.Email : string.Empty;
 }
コード例 #10
0
        public static string GetLoginEmail(Guid organizationId, int ID)
        {
            Logins lg = new Logins(organizationId);

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