Esempio n. 1
0
 public static void ProfessionalContract(CustomerGeneral customer, ProfessionalGeneral professional, ClosedProject cp)
 {
     if (customer == null) return;
     if (cp.HighestBid == null) return;
     var context = new SidejobEntities();
     if (cp.CurrencyID == null) return;
     var professionalcontract = new ProfessionalContract
     {
         BidderID = customer.CustomerID,
         BidderFirstName = customer.FirstName,
         BidderLastName = customer.LastName,
         BidderUsername = customer.UserName,
         ContractDate = DateTime.Now,
         ProjectID = cp.ProjectID,
         ContractID = GetNextContractID(),
         CurrencyID = (int)cp.CurrencyID,
         HighestBid = (double)cp.HighestBid,
         PosterID = professional.ProID,
         PosterUsername = professional.UserName,
         PosterFirstName = professional.FirstName,
         PosterLastName = professional.LastName
     };
     context.AddToProfessionalContracts(professionalcontract);
 }
Esempio n. 2
0
    public static void Contract(ProfessionalGeneral professionalbidder, CustomerGeneral customerposter, ClosedProject cp)
    {
        var context = new SidejobEntities();
        var project = (from c in context.ProjectRequirements
                       where c.ProjectID == cp.ProjectID
                       select c).FirstOrDefault();

        if (project != null)
        {
            var contract = new Contract
            {
                ContractID = GetNextContractID(),
                ProjectID = cp.ProjectID,
                ContractDate = DateTime.Now.Date,
                BidderID = customerposter.CustomerID,
                BidderRole = "CUS",
                BidderUsername = customerposter.UserName,
                BidderFirstName = customerposter.FirstName,
                BidderLastName = customerposter.LastName,
                BidderAddress = customerposter.Address,
                BidderCountryID = customerposter.CountryID,
                BidderCountryName = customerposter.CountryName,
                BidderRegionID = customerposter.RegionID,
                BidderRegionName = customerposter.RegionName,
                BidderHomePhoneNumber = customerposter.HomePhoneNumber,
                PosterID = professionalbidder.ProID,
                PosterRole = "PRO",
                PosterUsername = professionalbidder.UserName,
                PosterFirstName = professionalbidder.FirstName,
                PosterLastName = professionalbidder.LastName,
                PosterAddress = professionalbidder.Address,
                PosterCountryID = professionalbidder.CountryID,
                PosterCountryName = professionalbidder.CountryName,
                PosterRegionID = professionalbidder.RegionID,
                PosterRegionName = professionalbidder.RegionName,
                PosterZipcode = professionalbidder.Zipcode,
                LCID = project.LCID,
                ProjectCategoryID = project.CategoryID,
                ProjectCategoryName = project.CategoryName,
                ProjectJobID = project.JobID,
                ProjectExperienceID = project.ExperienceID,
                ProjectCrewNumberID = project.CrewNumberID,
                ProjectLicensedID = project.LicensedID,
                ProjectInsuredID = project.InsuredID,
                ProjectRelocationID = project.RelocationID,
                ProjectStartDate = project.StartDate,
                ProjectEndDate = project.EndDate,
                ProjectAddress = project.Address,
                ProjectCountryID = project.CountryID,
                ProjectCountryName = project.CountryName,
                ProjectRegionID = project.RegionID,
                ProjectRegionName = project.RegionName,
            };
            context.AddToContracts(contract);
        }
    }
 /// <summary>
 /// Create a new CustomerGeneral object.
 /// </summary>
 /// <param name="customerID">Initial value of the CustomerID property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="lastName">Initial value of the LastName property.</param>
 /// <param name="userName">Initial value of the UserName property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="countryID">Initial value of the CountryID property.</param>
 /// <param name="countryName">Initial value of the CountryName property.</param>
 /// <param name="regionID">Initial value of the RegionID property.</param>
 /// <param name="regionName">Initial value of the RegionName property.</param>
 /// <param name="age">Initial value of the Age property.</param>
 /// <param name="gender">Initial value of the Gender property.</param>
 /// <param name="emailAddress">Initial value of the EmailAddress property.</param>
 /// <param name="photoPath">Initial value of the PhotoPath property.</param>
 public static CustomerGeneral CreateCustomerGeneral(global::System.Int32 customerID, global::System.String firstName, global::System.String lastName, global::System.String userName, global::System.String address, global::System.Int32 countryID, global::System.String countryName, global::System.Int32 regionID, global::System.String regionName, global::System.Int32 age, global::System.Int32 gender, global::System.String emailAddress, global::System.String photoPath)
 {
     CustomerGeneral customerGeneral = new CustomerGeneral();
     customerGeneral.CustomerID = customerID;
     customerGeneral.FirstName = firstName;
     customerGeneral.LastName = lastName;
     customerGeneral.UserName = userName;
     customerGeneral.Address = address;
     customerGeneral.CountryID = countryID;
     customerGeneral.CountryName = countryName;
     customerGeneral.RegionID = regionID;
     customerGeneral.RegionName = regionName;
     customerGeneral.Age = age;
     customerGeneral.Gender = gender;
     customerGeneral.EmailAddress = emailAddress;
     customerGeneral.PhotoPath = photoPath;
     return customerGeneral;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CustomerGenerals EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCustomerGenerals(CustomerGeneral customerGeneral)
 {
     base.AddObject("CustomerGenerals", customerGeneral);
 }
 public void InsertCustomerTables(string username)
 {
     var context = new SidejobModel.SidejobEntities();
     var customerGeneral = new SidejobModel.CustomerGeneral
                               {
                                   CustomerID = _nextCustomerID,
                                   FirstName = "sidefirstname",
                                   LastName = "sidelastname",
                                   UserName = username,
                                   Address = "sideadress",
                                   CountryID = 200,
                                   CountryName = "sidecountryanme",
                                   RegionID = 12,
                                   RegionName = "sideregionname",
                                   CityID = 3,
                                   CityName = "sidecityname",
                                   Zipcode = "58742",
                                   HomePhoneNumber = "913-406-0298",
                                   MobilePhoneNumber = "913-486-0298",
                                   Age = 50,
                                   Gender = 1,
                                   EmailAddress = "*****@*****.**",
                                   PhotoPath = "sidepath"
                               };
     context.AddToCustomerGenerals(customerGeneral);
     context.SaveChanges();
 }