예제 #1
0
        public void SaveClient(Client client)
        {
            ClientServices clientServices = new ClientServices();

            clientServices.AddClient(client);
            clients.Add(client);
        }
예제 #2
0
 public ActionResult Index(ClientModel model)
 {
     if (ModelState.IsValid)
     {
         ClientServices.AddClient(model);
         return(RedirectToAction("TicketView"));
     }
     return(View(model));
 }
예제 #3
0
 public ActionResult <ClientConfirmationDto> AddClient(ClientCreationDto client)
 {
     try
     {
         var    createdClient = ClientServices.AddClient(client);
         string location      = LinkGenerator.GetPathByAction("GetClientById", "Client", new { createdClient.Id });
         return(Created(location, createdClient));
     }
     catch (ValidationException)
     {
         return(BadRequest());
     }
 }
예제 #4
0
 public void Post([FromBody] Cliente cliente)
 {
     try
     {
         var clienteService = new ClientServices();
         {
             clienteService.AddClient(cliente);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #5
0
        private async void ExecuteSaveAsync()
        {
            if (AccountStart == null || NewClient.Name == null)
            {
                return;
            }

            if (_clientServ.GetClient(_newClient.Name) != null)
            {
                await _currentWindow.ShowMessageAsync("فشل الإضافة", "هذاالعميل موجود مسبقاً", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = "موافق",
                    DialogMessageFontSize = 25,
                    DialogTitleFontSize   = 30
                });
            }
            else
            {
                if (_accountStartType == true)
                {
                    _newClient.AccountStart = _accountStart;
                }
                else
                {
                    _newClient.AccountStart = -_accountStart;
                }
                _clientServ.AddClient(_newClient);
                _namesSuggestions.Add(_newClient.Name);
                _addressSuggestions.Add(_newClient.Address);
                clients.Add(_newClient);
                NewClient    = new Client();
                AccountStart = null;
                await _currentWindow.ShowMessageAsync("نجاح الإضافة", "تم الإضافة بنجاح", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                {
                    AffirmativeButtonText = "موافق",
                    DialogMessageFontSize = 25,
                    DialogTitleFontSize   = 30
                });
            }
        }
        public ActionResult ClientRegister(Client Newclient)
        {
            if (ModelState.IsValid)
            {
                var isExist = em.ClintEmail(Newclient.Email);

                if (isExist)
                {
                    ModelState.AddModelError("EmailExist", "Email already exist");
                    return(View(Newclient));
                }

                else
                {
                    cs.AddClient(Newclient);

                    return(Redirect("/Admin/allCliernts"));
                }
            }

            return(View(Newclient));
        }
        public ActionResult CreateAccount(Client Newclient)
        {
            if (ModelState.IsValid)
            {
                var isExist = em.ClintEmail(Newclient.Email);

                if (isExist)
                {
                    ModelState.AddModelError("EmailExist", "Email already exist");
                    return(View(Newclient));
                }

                else
                {
                    cl.AddClient(Newclient);

                    return(RedirectToAction("Index"));
                }
            }

            return(View(Newclient));
        }
예제 #8
0
 public void addClient(Client client)
 {
     _clientServices.AddClient(client);
 }
예제 #9
0
        public IHttpActionResult PostClient([FromBody] ClientDTO client)
        {
            //System.Diagnostics.Debug.WriteLine("This is my messaageeeeee "+client.firstname+" " + client.lastname);

            return(Ok(clientSevices.AddClient(client)));
        }