public IActionResult Create([Bind] Client client) { if (ModelState.IsValid) { cli.AddClient(client); return(RedirectToAction("Index")); } return(View(client)); }
private void btnSave_Click(object sender, EventArgs e) { Client client = new Client(); client.ClientName = txtClientName.Text.Trim(); client.ContactName = txtContactName.Text.Trim(); client.Phone = txtPhone.Text.Trim(); client.Email = txtEmail.Text.Trim(); client.TIN = txtTIN.Text.Trim(); client.BillingAddress = txtBillingAddress.Text.Trim(); client.City = txtCity.Text.Trim(); client.Country = txtCountry.Text.Trim(); client.Zip = txtZip.Text.Trim(); client.StateCode = Convert.ToString(cmbState.SelectedValue); client.ShipToDifferentAddress = chkDifferentAddress.Checked; client.ShippingAddress = txtShippingAddress.Text.Trim(); client.ShippingCity = txtShippingCity.Text.Trim(); client.ShippingStateCode = Convert.ToString(cmbShippingState.SelectedValue); client.ShippingZip = txtShippingZip.Text.Trim(); client.ShippingCountry = txtShippingCountry.Text.Trim(); client.PrivateClientDetails = txtPrivateClientDetails.Text.Trim(); client.OtherClientDetails = txtOtherClientDetails.Text.Trim(); client.Status = true; client.CreatedDate = DateTime.Now.Date; if (clientID == 0) { int clientId = clientService.AddClient(client); ResetControls(); CustomMessageBox.Show(string.Format(Constants.SUCCESSFULL_ADD_MESSAGE, Constants.CONSTANT_CLIENT, txtClientName.Text), Constants.CONSTANT_INFORMATION, Sleek_Bill.Controls.CustomMessageBox.eDialogButtons.OK, CustomImages.GetDialogImage(Sleek_Bill.Controls.CustomImages.eCustomDialogImages.Success)); } else { client.ClientId = clientID; clientService.UpdateClient(client); CustomMessageBox.Show(string.Format(Constants.SUCCESSFULL_SAVE_MESSAGE, txtClientName.Text), Constants.CONSTANT_INFORMATION, Sleek_Bill.Controls.CustomMessageBox.eDialogButtons.OK, CustomImages.GetDialogImage(Sleek_Bill.Controls.CustomImages.eCustomDialogImages.Success)); } this.Close(); }
public IActionResult FulfillClient(ClientIndexListingModel model, int OrderId) { Client client = new Client() { ClientNumber = _client.NextNumber(), Name = model.Name, Surname = model.Surname, PhoneNumer = model.PhoneNumer, email = model.email }; _client.AddClient(client); Console.WriteLine(" ??????????????????????????????????????????????????????????????//// "); Console.WriteLine("CLIENT : " + client.Id); _client.AddClientToOrder(client.Id, OrderId); return(RedirectToAction("OrderSummary", "Order", new { OrderId = OrderId, ActionId = 1 })); }
private void InitializeClient(Config config) { string mode = config.GetValue("server", "mode", "tcp"); if (mode.ToLower() == "tcp") { _client = new SocketClient(); } else { _client = new HttpClient(); } _client.AddClient(config, _proxobj); Pong = new Timer(); Pong.Interval = 180000; Pong.Elapsed -= Pong_Elapsed; Pong.Elapsed += Pong_Elapsed; Pong.Start(); getBoardthread = new Thread(new ThreadStart(GetBorad)); getBoardthread.Start(); }
private void Button_Click(object sender, RoutedEventArgs e) { phone = phoneBox.Text; name = nameBox.Text; email = emailBox.Text; address = addressBox.Text; if (birthBox.SelectedDate != null && phone.All(char.IsDigit)) { IClient cl = Factory.Instance.GClient(); DateTime date = birthBox.SelectedDate ?? DateTime.Now; cl.AddClient(name, date, email, phone, address); UpdateClient?.Invoke(); MessageBox.Show("You successfully added new client"); phoneBox.Text = null; nameBox.Text = null; emailBox.Text = null; addressBox.Text = null; birthBox.Text = null; } else { MessageBox.Show("Invalid input data"); } }
public int AddClient(DTO.Client client) { return(_client.AddClient(Mapper.Map <DTO.Client, HCRGUniversity.Core.Data.Model.Client>(client))); }
public int AddEntryToClientList(Client client) { int newClientId = _clientRepo.AddClient(client); return(newClientId); }