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));
        }
Esempio n. 2
0
 public ActionResult PostApplicantEducation([FromBody] CustomerPoco[] pocos)
 {
     try
     {
         _logic.Add(pocos);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Esempio 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();
            }
        }
Esempio 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));
        }
        public HttpResponseMessage Add(Customer customer)
        {
            var customerResponse = CustomerLogic.Add(customer);

            return(CreateResponse(customerResponse));
        }