Exemplo n.º 1
0
    private void MainMethod()
    {
        Client client = new Client(
            "Bob",
            "Dupont",
            20); // constructeur

        client.ChangeSurname("Dylan");

        ClientPremium clientPremium = new ClientPremium(
            "Bob",
            "Dupont",
            20);
    }
        public JsonResult CreatePremiumForClient(ClientPremiumViewModel clientPremium)
        {
            //var parsedObj = JsonConvert.DeserializeObject<ClientPremiumViewModel>(createPremiumJson);
            var clientPremiumData = new ClientPremium
            {
                Name            = clientPremium.Name,
                Age             = clientPremium.Age,
                DateOfBirth     = Convert.ToDateTime(clientPremium.DateOfBirthStr),
                OccupationId    = clientPremium.OccupationId,
                DeathSumInsured = clientPremium.DeathSumInsured,
                MonthlyPremium  = clientPremium.MonthlyPremium,
                IsActive        = true
            };

            _clientBusinessLogic.CreateClientPremium(clientPremiumData);
            return(Json(null, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public static Client CreateObject(TypeClient type)
        {
            Client obj = null;

            switch (type)
            {
            case TypeClient.NORMAL:
                obj = new ClientNormal();
                break;

            case TypeClient.PREMIUM:
                obj = new ClientPremium();
                break;

            case TypeClient.ASURVEILLER:
                obj = new ClientAsurveiller();
                break;

            default:
                break;
            }

            return(obj);
        }
 public void CreateClientPremium(ClientPremium clientPremium)
 {
     _clientPremiumRepository.CreateClientPremium(clientPremium);
 }