private void Guardarbutton_Click(object sender, EventArgs e) { Paquetes p = GenericBLL.Buscar <Paquetes>((int)PaqueteIdnumericUpDown.Value); if (CanSave()) { if (p == null) { if (GenericBLL.Guardar <Paquetes>(LlenaClase())) { MessageBox.Show("Paquete guardado"); Limpiar(); } else { MessageBox.Show("El paquete no pudo ser guardado"); } } else { if (GenericBLL.Modificar <Paquetes>(LlenaClase())) { MessageBox.Show("Se modifico el paquete"); Limpiar(); } else { MessageBox.Show("El paquete no pudo ser modificado"); } } } }
private void Guardarbutton_Click(object sender, EventArgs e) { Transportes tr = GenericBLL.Buscar <Transportes>((int)TransporteIdnumericUpDown.Value); if (CanSave()) { if (tr == null) { if (GenericBLL.Guardar <Transportes>(LlenaClase())) { MessageBox.Show("Compañia de transporte registrado"); Limpiar(); } else { MessageBox.Show("No se pudo registrar la compañia transportista"); } } else { if (GenericBLL.Guardar <Transportes>(LlenaClase())) { MessageBox.Show("Se modifico la compañia transportista"); Limpiar(); } else { MessageBox.Show("No se pudo modificar la compañia transportista"); } } } }
private void Guardarbutton_Click(object sender, EventArgs e) { Clientes c = GenericBLL.Buscar <Clientes>((int)ClienteIdnumericUpDown.Value); if (CanSave()) { if (c == null) { if (GenericBLL.Guardar <Clientes>(LlenaClase())) { MessageBox.Show("El cliente a sido registrado"); } else { MessageBox.Show("No se pudo registrar el cliente"); } } else { if (GenericBLL.Modificar <Clientes>(LlenaClase())) { MessageBox.Show("Se a modificado el este cliente"); } else { MessageBox.Show("El cliente no pudo ser modificado"); } } } }
public rPaquetes() { InitializeComponent(); TransportistacomboBox.DataSource = GenericBLL.GetList <Transportes>(x => 1 == 1).ToList(); TransportistacomboBox.DisplayMember = "Compania"; TransportistacomboBox.ValueMember = "Compania"; }
/// <summary> /// Get view with selected errorlogList by searchstring. /// </summary> /// <param name="searchString"></param> /// <returns></returns> public ActionResult SearchErrorLog(string searchString) { try { #region IsAdminCheck if (Session["Kunde"] == null) { return(RedirectToAction("Frontpage", "Film")); } var user = (UserVM)Session["Kunde"]; int userId = user.Id; if (!_UserLogic.IsAdmin(userId)) { return(RedirectToAction("Frontpage", "Film")); } #endregion IsAdminCheck IGenericBLL <ErrorLogVM> _genericLogic = new GenericBLL <ErrorLogVM>(); return(View("ErrorLog", _genericLogic.Search(searchString, _errorLogLogic.AllErrors()))); } catch (DatabaseErrorException e) { TempData["message"] = "Databasefeil. Se errorlog."; TempData["errormessage"] = e.GetMessage(); return(RedirectToAction("AdminFrontPage")); } }
public override void LoadData() { base.LoadData(); //Create a default change tracking insance var changeType = new ChangeType { Type = StaticProperties.TestString }; var changeTracking = new ChangeTracking { ChangeDate = DateTime.Now, ObjectChanged = StaticProperties.TestString, ObjectChangedID = StaticProperties.TestString, UserName = StaticProperties.TestString, ChangeType = changeType }; using (var ts = new TransactionScope()) { GenericBLL <ChangeType, int> .EnsurePersistent(changeType); GenericBLL <ChangeTracking, int> .EnsurePersistent(changeTracking); ts.CommitTransaction(); } }
private static void LoadUser() { //Let's put a user for testing var user = new User { FirstName = "Test", LastName = "User", LoginIDs = new List <Login>() }; var userLogin = new Login() { User = user }; EntityIdSetter.SetIdOf <string>(userLogin, "tester"); user.LoginIDs.Add(userLogin); //Now associate this person with some units user.Units = new List <Unit>(); var apls = UnitBLL.GetByID("APLS"); var chem = UnitBLL.GetByID("CHEM"); user.Units.Add(apls); user.Units.Add(chem); UserBLL.EnsurePersistent(user, true); GenericBLL <Login, string> .EnsurePersistent(userLogin, true); }
public override void LoadData() { base.LoadData(); Login login = new Login(); EntityIdSetter.SetIdOf <string>(login, StaticProperties.TestString); //Load in a user User user = new User(); user.FirstName = StaticProperties.TestString; user.LastName = StaticProperties.TestString; user.LoginIDs = new List <Login> { login }; login.User = user; using (var ts = new TransactionScope()) { UserBLL.EnsurePersistent(user); GenericBLL <Login, string> .EnsurePersistent(login, true); ts.CommitTransaction(); } }
public POS() { InitializeComponent(); this.medicine = new MedicineBLL(); this.generic = new GenericBLL(); this.medicines = new BindingList <Medicine>(); }
private void Guardarbutton_Click(object sender, EventArgs e) { Facturas factura = GenericBLL.Buscar <Facturas>((int)IdnumericUpDown.Value); if (CanSave()) { if (factura == null) { if (GenericBLL.Guardar <Facturas>(LlenaClase(detalles))) { MessageBox.Show("Se guardo la factura"); Limpiar(); } else { MessageBox.Show("No se pudo guardar la factura"); } } else { if (GenericBLL.Modificar <Facturas>(LlenaClase(detalles))) { MessageBox.Show("Se modifico la factura"); Limpiar(); } else { MessageBox.Show("No se pudo modificar la factura"); } } } }
private static void LoadApplicants() { for (int i = 0; i < 10; i++) { var profile = new Profile { FirstName = string.Format("FName{0}", i), LastName = string.Format("LName{0}", i), Address1 = shortRandString, City = shortRandString, State = shortRandString }; var applicant = new Applicant() { Email = string.Format("email{0}@fake.com", i), IsActive = true }; profile.AssociatedApplicant = applicant; applicant.Profiles.Add(profile); GenericBLL <Applicant, int> .EnsurePersistent(applicant); GenericBLL <Profile, int> .EnsurePersistent(profile); } }
private void Addbutton_Click(object sender, EventArgs e) { Decimal monto = 0; var lista = GenericBLL.GetList <Paquetes>(x => (x.ClienteId == (int)ClienteIdnumericUpDown.Value && x.Estado.Equals("Disponible"))).ToList(); detalles.Clear(); foreach (Paquetes p in lista) { FacturaDetalles f = new FacturaDetalles( 0, (IdnumericUpDown.Value == 0) ? 0 : (int)IdnumericUpDown.Value, p.PaqueteId, p.Contenido, p.Proveedor, p.Peso, 0, (p.Peso <= 1) ? 180 : (Decimal)(180 * p.Peso) ); monto += f.Precio; detalles.Add(f); } dataGridView.DataSource = detalles.ToList(); MontotextBox.Text = monto.ToString(); errorProvider.SetError(dataGridView, ""); }
private void Guardarbutton_Click(object sender, EventArgs e) { Usuarios us = GenericBLL.Buscar <Usuarios>((int)UsuarioIdnumericUpDown.Value); if (CanSave()) { if (us == null) { if (GenericBLL.Guardar <Usuarios>(LlenaClase())) { MessageBox.Show("Usuario registrado"); Limpiar(); } else { MessageBox.Show("No se pudo registrar el usuario"); } } else { if (GenericBLL.Guardar <Usuarios>(LlenaClase())) { MessageBox.Show("Se modifico el usuario"); Limpiar(); } else { MessageBox.Show("No se pudo modificar el usuario"); } } } }
private void Reportebutton_Click(object sender, EventArgs e) { if (Validacion()) { Filtrar(); new PaquetesReportForm(GenericBLL.GetList <Paquetes>(filter)).Show(); } }
private void Imprimirbutton_Click(object sender, EventArgs e) { if (Validacion()) { Filtrar(); dataGridView.DataSource = GenericBLL.GetList <Paquetes>(filter); } }
public ManageInventory() { InitializeComponent(); generic = new GenericBLL(); formulation = new FormulationBLL(); dosage = new DosageBLL(); manufacturer = new ManufacturerBLL(); medicine = new MedicineBLL(); }
private void BuscarClientebutton_Click(object sender, EventArgs e) { Clientes cliente = GenericBLL.Buscar <Clientes>((int)ClienteIdnumericUpDown.Value); if (cliente != null) { ClienteNombretextBox.Text = cliente.Nombres; } }
public void CarregaComboTipoPessoa() { List <GenericDTO> lista = new GenericBLL().GetAllData(new GenericDTO() { dominio = domains.TipoPessoa }); cmbTipoPessoa.DisplayMember = "descGeneric"; cmbTipoPessoa.ValueMember = "idGeneric"; cmbTipoPessoa.DataSource = lista; }
public void CarregaComboGenero() { List <GenericDTO> lista = new GenericBLL().GetAllData(new GenericDTO() { dominio = domains.Genero }); cmbGenero.DisplayMember = "descGeneric"; cmbGenero.ValueMember = "idGeneric"; cmbGenero.DataSource = lista; }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (GenericBLL.Eliminar <Clientes>((int)ClienteIdnumericUpDown.Value)) { MessageBox.Show("Se elimino este cliente"); } else { MessageBox.Show("No se pudo eliminar este cliente"); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (GenericBLL.Eliminar <Transportes>((int)TransporteIdnumericUpDown.Value)) { MessageBox.Show("Esta compañia transportista a sido eliminada"); } else { MessageBox.Show("Esta compañia transportista no fue eliminado"); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (GenericBLL.Eliminar <Usuarios>((int)UsuarioIdnumericUpDown.Value)) { MessageBox.Show("Usuario eliminado"); } else { MessageBox.Show("El usuario no fue eliminado"); } }
private void UsuariotextBox_TextChanged(object sender, EventArgs e) { if (GenericBLL.GetList <Usuarios>(x => x.Usuario.Equals(UsuariotextBox.Text)).Count > 0) { errorProvider.SetError(UsuariotextBox, "Este usuario ya existe"); } else { errorProvider.SetError(UsuariotextBox, ""); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (GenericBLL.Eliminar <Facturas>((int)IdnumericUpDown.Value)) { MessageBox.Show("Se elimino la factura"); Limpiar(); } else { MessageBox.Show("No se pudo eliminar la factura"); } }
private void Buscarbutton_Click(object sender, EventArgs e) { Facturas f = GenericBLL.Buscar <Facturas>((int)IdnumericUpDown.Value); if (f != null) { detalles = f.Detalles; ClienteIdnumericUpDown.Value = f.ClienteId; dataGridView.DataSource = detalles.ToList(); MontotextBox.Text = f.Monto.ToString(); } }
private void Eliminarbutton_Click(object sender, EventArgs e) { if (GenericBLL.Eliminar <Paquetes>((int)PaqueteIdnumericUpDown.Value)) { MessageBox.Show("Se elimino el paquete"); Limpiar(); } else { MessageBox.Show("El paquete no pudo ser elimiando"); } }
private void BuscarClientebutton_Click(object sender, EventArgs e) { Clientes c = GenericBLL.Buscar <Clientes>((int)ClienteIdnumericUpDown.Value); if (c != null) { ClienteNombrestextBox.Text = c.Nombres; } else { MessageBox.Show("Este cliente no existe"); } }
private void Buscarbutton_Click(object sender, EventArgs e) { UsuarioEmpleados us = GenericBLL.Buscar <UsuarioEmpleados>((int)IdnumericUpDown.Value); if (us != null) { UsuariotextBox.Text = us.Usuario; ClavetextBox.Text = us.Clave; } else { MessageBox.Show("Este usuario no existe"); } }
private void Buscarbutton_Click(object sender, EventArgs e) { Clientes c = GenericBLL.Buscar <Clientes>((int)ClienteIdnumericUpDown.Value); if (c != null) { NombrestextBox.Text = c.Nombres; EdadnumericUpDown.Value = c.Edad; SexocomboBox.SelectedIndex = (c.Sexo == 'M') ? 0 : 1; CiudadtextBox.Text = c.Ciudad; TelefonomaskedTextBox.Text = c.Telefono; CelularmaskedTextBox.Text = c.Celular; EmailtextBox.Text = c.Email; } }
private void Buscarbutton_Click(object sender, EventArgs e) { Transportes tr = GenericBLL.Buscar <Transportes>((int)TransporteIdnumericUpDown.Value); if (tr != null) { TransporteIdnumericUpDown.Value = tr.TransporteId; CompaniatextBox.Text = tr.Compania; TelefonomaskedTextBox.Text = tr.Telefono; } else { MessageBox.Show("Esta compañia transportist no existe"); } }