Insert() public method

public Insert ( Person, person ) : int
person Person,
return int
コード例 #1
0
ファイル: PersonBrl.cs プロジェクト: ddrakan/App-Unibook
 /// <summary>
 /// Create a new person
 /// </summary>
 /// <param name="person"></param>
 /// <param name="objContex"></param>
 public static void Insertar(Person person, PeopleContainer objContex)
 {
     try
     {
         PersonDal.Insert(person, objContex);
     }
     catch (Exception)
     {
     }
 }
コード例 #2
0
        public void TestMethod1()
        {
            AccountDal account = new AccountDal();

            account.Insert(new Account {
                UserID = Guid.NewGuid(), Username = "******", Password = "******"
            });
            PersonDal person = new PersonDal();

            person.Insert(new Person {
                PID = Guid.NewGuid(), Pname = "york", Pgrade = "BoardMember", Padvs = "", Pact4fire = "", Pact4water = "", Pcontact = "", Pemail = "", Pfield_of_firm = "", Phobbies = "", Pjob4u = "", Ppro = "", Psex = "男", Ptel = "135", Ptime = 1234567, PwechatID = "", Pwork_years = 1, Username = "******"
            });
        }
コード例 #3
0
ファイル: PersonBrl.cs プロジェクト: edsonfloresc/App-Unibook
 /// <summary>
 /// Insert a person
 /// </summary>
 /// <param name="person">Object person to insert</param>
 /// <param name="objContex">Get table to object</param>
 public static void Insert(PersonDto personDto, ModelUnibookContainer objContex)
 {
     try
     {
         Person person = new Person();
         person.PersonId = personDto.PersonId;
         person.Name     = personDto.Name;
         person.LastName = personDto.LastName;
         person.Birthday = personDto.BirthDay;
         person.Deleted  = personDto.Deleted;
         //person.Gender = GenderBrl.Get(personDto.Gender.GenderId);
         PersonDal.Insert(person, objContex);
     }
     catch (DbEntityValidationException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
        public bool insertMem(Account account, Person person, XiaoYan xiaoyan)
        {
            bool res = true;

            try
            {
                _account.Insert(account);
                _persondal.Insert(person);
                _memdal.Insert(xiaoyan);
            }
            catch (Exception e)
            {
                res = false;
                using (StreamWriter writer =
                           new StreamWriter(@"C:\Users\lenovo\Desktop\log.txt", true))
                {
                    writer.WriteLine(DateTime.Now.ToString());
                    writer.WriteLine(e.Message);
                    writer.WriteLine(e.StackTrace);
                }
            }
            return(res);
        }