Exemplo n.º 1
0
 public List<Person> GetAllCredentials()
 {
     PersonDAC _personComponent = new PersonDAC();
     IDataReader reader = _personComponent.GetAllPerson("BusinessEntityId in (select BusinessEntityId from Person.Credential)").CreateDataReader();
     List<Person> _personList = new List<Person>();
     while (reader.Read())
     {
         if (_personList == null)
             _personList = new List<Person>();
         Person _person = new Person();
         if (reader["BusinessEntityId"] != DBNull.Value)
             _person.BusinessEntityId = Convert.ToInt32(reader["BusinessEntityId"]);
         if (reader["NameStyle"] != DBNull.Value)
             _person.NameStyle = Convert.ToBoolean(reader["NameStyle"]);
         if (reader["EmailPromotion"] != DBNull.Value)
             _person.EmailPromotion = Convert.ToInt32(reader["EmailPromotion"]);
         if (reader["RowGuid"] != DBNull.Value)
             _person.RowGuid = new Guid(reader["RowGuid"].ToString());
         if (reader["ModifiedDate"] != DBNull.Value)
             _person.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
         if (reader["CreatedDate"] != DBNull.Value)
             _person.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
         if (reader["NationalityCode"] != DBNull.Value)
             _person.NationalityCode = Convert.ToString(reader["NationalityCode"]);
         if (reader["Gender"] != DBNull.Value)
             _person.Gender = Convert.ToString(reader["Gender"]);
         if (reader["DateofBirth"] != DBNull.Value)
             _person.DateofBirth = Convert.ToDateTime(reader["DateofBirth"]);
         if (reader["PersonImage"] != DBNull.Value)
             _person.PersonImage = Convert.ToString(reader["PersonImage"]);
         _person.NewRecord = false;
         _personList.Add(_person);
     } reader.Close();
     return _personList;
 }
Exemplo n.º 2
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     PersonDAC personcomponent = new PersonDAC();
     return personcomponent.UpdateDataset(dataset);
 }
Exemplo n.º 3
0
 public void Delete(int Original_BusinessEntityId)
 {
     PersonDAC personComponent = new PersonDAC();
     personComponent.DeletePerson(Original_BusinessEntityId);
 }
Exemplo n.º 4
0
 public bool Update(Person person ,int old_businessEntityId)
 {
     PersonDAC personComponent = new PersonDAC();
     return personComponent.UpdatePerson( person.BusinessEntityId,  person.NameStyle,  person.EmailPromotion,  person.RowGuid,  DateTime.Now,  person.CreatedDate,  person.NationalityCode,person.Gender,person.DateofBirth,person.PersonImage,  old_businessEntityId);
 }
Exemplo n.º 5
0
 public bool Update(int BusinessEntityId, bool NameStyle, int EmailPromotion, Guid RowGuid, DateTime ModifiedDate, DateTime CreatedDate, string NationalityCode, string Gender, DateTime DateofBirth, string PersonImage, int Original_BusinessEntityId)
 {
     PersonDAC personComponent = new PersonDAC();
     return personComponent.UpdatePerson( BusinessEntityId,  NameStyle,  EmailPromotion,  RowGuid,  DateTime.Now,  CreatedDate,  NationalityCode,Gender,DateofBirth,PersonImage,  Original_BusinessEntityId);
 }
Exemplo n.º 6
0
 public bool Update(int BusinessEntityId, bool NameStyle, int EmailPromotion, Guid RowGuid, DateTime ModifiedDate, DateTime CreatedDate, string NationalityCode, string Title, string FirstName, string MiddleName, string LastName, string DisplayName, string Suffix, string Gender, DateTime DateofBirth, string PersonImage)
 {
     PersonDAC personComponent = new PersonDAC();
      personComponent.UpdatePerson(BusinessEntityId, NameStyle, EmailPromotion, new Guid(), DateTime.Now, DateTime.Now, NationalityCode, Gender, DateofBirth, PersonImage,BusinessEntityId);
      PersonLanguagesDAC plangComponent = new PersonLanguagesDAC();
      Person person= new PersonLogic().GetByID(BusinessEntityId);
      return plangComponent.UpdatePersonLanguages(BusinessEntityId, Common.DefaultLanguage.LanguageId, Title, FirstName, MiddleName, LastName, Suffix, DisplayName,person.PersonDefaultLanguage.PersonLanguageId);
 }
Exemplo n.º 7
0
 public bool Insert(ref int BusinessEntityId, bool NameStyle, int EmailPromotion, Guid RowGuid, DateTime ModifiedDate, DateTime CreatedDate, string NationalityCode, string Title, string FirstName, string MiddleName, string LastName, string DisplayName, string Suffix, string Gender, DateTime DateofBirth, string PersonImage)
 {
     PersonDAC personComponent = new PersonDAC();
      Common.BusinessEntityLogic.Insert(ref BusinessEntityId, new Guid(), DateTime.Now);
      personComponent.InsertNewPerson(BusinessEntityId, NameStyle, EmailPromotion, new Guid(), DateTime.Now, DateTime.Now, NationalityCode,Gender,DateofBirth,PersonImage);
      PersonLanguagesDAC plangComponent = new PersonLanguagesDAC();
      int plangId = 0;
      return plangComponent.InsertNewPersonLanguages(ref plangId, BusinessEntityId, Common.DefaultLanguage.LanguageId, Title, FirstName, MiddleName, LastName, Suffix, DisplayName);
 }
Exemplo n.º 8
0
 public bool Insert(int BusinessEntityId, bool NameStyle, int EmailPromotion, Guid RowGuid, DateTime ModifiedDate, DateTime CreatedDate, string NationalityCode, string Gender, DateTime DateofBirth, string PersonImage)
 {
     PersonDAC personComponent = new PersonDAC();
     int id = 0;
     Common.BusinessEntityLogic.Insert(ref id, new Guid(), DateTime.Now);
     return personComponent.InsertNewPerson( id,  NameStyle,  EmailPromotion,  new Guid(),  DateTime.Now,  DateTime.Now,  NationalityCode,Gender,DateofBirth,PersonImage);
 }
Exemplo n.º 9
0
 public bool Insert(Person person)
 {
     PersonDAC personComponent = new PersonDAC();
     if (person.PersonDefaultLanguage != null)
     {
         int id = 0;
         Common.BusinessEntityLogic.Insert(ref id, new Guid(), DateTime.Now);
         personComponent.InsertNewPerson(id, person.NameStyle, person.EmailPromotion, new Guid(), DateTime.Now, DateTime.Now, person.NationalityCode,person.Gender,person.DateofBirth,person.PersonImage);
         Common.PersonLanguagesLogic.Insert(id, Common.DefaultLanguage.LanguageId, person.Title, person.FirstName, person.MiddleName, person.LastName, person.Suffix, person.DisplayName);
         person.BusinessEntityId = id;
         return true;
     }
     return false;
 }
Exemplo n.º 10
0
 public Person GetByUserName(string UserName)
 {
     PersonDAC _personComponent = new PersonDAC();
      IDataReader reader = _personComponent.GetByUserNamePerson(UserName);
      Person _person = null;
      while (reader.Read())
      {
          _person = new Person();
          if (reader["BusinessEntityId"] != DBNull.Value)
              _person.BusinessEntityId = Convert.ToInt32(reader["BusinessEntityId"]);
          if (reader["NameStyle"] != DBNull.Value)
              _person.NameStyle = Convert.ToBoolean(reader["NameStyle"]);
          if (reader["EmailPromotion"] != DBNull.Value)
              _person.EmailPromotion = Convert.ToInt32(reader["EmailPromotion"]);
          if (reader["RowGuid"] != DBNull.Value)
              _person.RowGuid = new Guid(reader["RowGuid"].ToString());
          if (reader["ModifiedDate"] != DBNull.Value)
              _person.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
          if (reader["CreatedDate"] != DBNull.Value)
              _person.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
          if (reader["NationalityCode"] != DBNull.Value)
              _person.NationalityCode = Convert.ToString(reader["NationalityCode"]);
          if (reader["Gender"] != DBNull.Value)
              _person.Gender = Convert.ToString(reader["Gender"]);
          if (reader["DateofBirth"] != DBNull.Value)
              _person.DateofBirth = Convert.ToDateTime(reader["DateofBirth"]);
          if (reader["PersonImage"] != DBNull.Value)
              _person.PersonImage = Convert.ToString(reader["PersonImage"]);
          _person.NewRecord = false;
      } reader.Close();
      return _person;
 }