コード例 #1
0
ファイル: ContractorsLogic.cs プロジェクト: zep2zep/Compas
        public Contractor Create(string PrefixName, string LastName, string FirstName, string MiddleName,
                                 string Country, string Region, string District, string City, string Street, string Building, string Flat,
                                 string Phone, string MobilePhone, string Email, string Site, DateTime?Birthdate, bool?Sex, bool?Person,
                                 List <int> ContractorTypes)
        {
            Contractor sr = Contractor.CreateContractor(1, LastName);

            sr.FirstName   = FirstName;
            sr.MiddleName  = MiddleName;
            sr.Country     = Country;
            sr.City        = City;
            sr.Region      = Region;
            sr.District    = District;
            sr.Street      = Street;
            sr.Building    = Building;
            sr.Flat        = Flat;
            sr.Phone       = Phone;
            sr.MobilePhone = MobilePhone;
            sr.EMail       = Email;
            sr.Site        = Site;
            sr.Birthdate   = Birthdate;
            sr.Sex         = Sex;
            sr.Person      = Person;
            sr.PrefixName  = PrefixName;
            context.AddToContractors(sr);


            foreach (int a in ContractorTypes)
            {
                ContractorContractorType ct = new ContractorContractorType();
                ct.ContractorTypeID = a;
                sr.ContractorContractorTypes.Add(ct);
            }

            return(sr);
        }