public async Task <IActionResult> Create([FromBody] Models.Customers.Customer customer)
        {
            if (!await PublicAuthLogic.CheckAccessToken(GetAccessToken(), GetDepartmentCode()))
            {
                return(Unauthorized());
            }
            var isSuccess = await CustomerLogic.Add(customer, GetDepartmentCode());

            return(Ok(isSuccess));
        }
Exemplo n.º 2
0
 public ActionResult PostApplicantEducation([FromBody] CustomerPoco[] pocos)
 {
     try
     {
         _logic.Add(pocos);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Exemplo n.º 3
0
        private void AddButton_Click(object sender, System.EventArgs e)
        {
            var customerToAdd = new Customer
            {
                Firstname = FirstnameTextBox.Text,
                Lastname  = LastnameTextBox.Text
            };

            var addResponse = ResponsibleProcessor.Process("Adding Customer", () => CustomerLogic.Add(customerToAdd), true, true);

            if (addResponse.Success)
            {
                SearchCustomers();
            }
        }
Exemplo n.º 4
0
        private void AddButton_Click(object sender, System.EventArgs e)
        {
            var customerToAdd = new Customer
            {
                Firstname = FirstnameTextBox.Text,
                Lastname  = LastnameTextBox.Text
            };

            using (var process = new Processor("Adding Customers"))
            {
                var addResponse = process.Process(() => CustomerLogic.Add(customerToAdd));
                if (addResponse.Success)
                {
                    SearchCustomers();
                }
            }
        }
        public async Task <IActionResult> Create([FromBody] Models.Customers.Customer customer)
        {
            var isSuccess = await CustomerLogic.Add(GetToken(), customer);

            return(Ok(isSuccess));
        }
Exemplo n.º 6
0
        public HttpResponseMessage Add(Customer customer)
        {
            var customerResponse = CustomerLogic.Add(customer);

            return(CreateResponse(customerResponse));
        }