//---------CRUD---------// private void createButton_Click(object sender, EventArgs e) { string name = txtNameClient.Text; string lastname = txtLastnameClient.Text; string idType = cmbIdentificationType.Text; string identif = txtIdentification.Text; string bornDate = datepBornDate.Text; string email = txtEmailClient.Text; try { if (ClientManagement.InsertClient(name, lastname, identif, idType, email, bornDate)) { Clear(); WireUpClientsGridView(); FrmMain.Instance.ToolStripLabel.Text = "Se agregó el cliente de manera correcta."; } else { FrmMain.Instance.ToolStripLabel.Text = "Ha ocurrido un error al agregar el cliente, inténtelo nuevamente."; } } catch (Exception) { throw; } }
private void AddButton_Click_1(object sender, EventArgs e) { if (IdLabel.Text.Equals("none")) { if (!string.IsNullOrEmpty(NameTextBox.Text) && !string.IsNullOrEmpty(LastNameTextBox.Text)) { DateTime fecha = DateTime.Now; if (ClientManagement.InsertClient(NameTextBox.Text, LastNameTextBox.Text, IdTypeComboBox.SelectedItem.ToString(), IdentificationTextBox.Text, EmailTextBox.Text, BornDateTimePicker.Value, fecha)) { FrmMain.Instance.ToolStripLabel.Text = "Se agrego el Cliente correctamente."; Clear(); ReloadClient(); } else { FrmMain.Instance.ToolStripLabel.Text = "Error! No se pudo agregar el Cliente."; } } else { } } }
public bool InsertClient(ClientObj param) { string banner = _client.DoFileUpload(param.ClientBanner); bool _clients = _client.InsertClient(param.ClientName, param.ClientAlias, banner, param.RespTime, param.RestTime, param.IsClientActive, param.CreatedBy); if (_clients) { Log.InfoFormat(param.Computername, param.SystemIp, param.UserName, Constants.ActionType.SetupClient.ToString()); _audit.InsertAudit(param.UserName, Constants.ActionType.SetupClient.ToString(), "Setup client account", DateTime.Now, param.Computername, param.SystemIp); return(true); } else { Log.InfoFormat(param.Computername, param.SystemIp, param.UserName, Constants.ActionType.SetupClient.ToString()); return(false); } }