private void GuardarRecepcioNalmacen(object sender, RoutedEventArgs e) { RequisicionDAO reuisicionDAO = new RequisicionDAO(); Requisicion idRequisicion = reuisicionDAO.FindById(Int32.Parse(IdRequicicion.Text)); RemitenteDAO proveedorDAO = new RemitenteDAO(); Remitente idProveedor = proveedorDAO.FindById(Int32.Parse(IdProveedor.Text)); int idRecepcionAlmacen = Int32.Parse(IdRecepcionAlmacen.Text); int claveRecepcion = Int32.Parse(ClaveRecepcionAlmacen.Text); DateTime fecharecepcion = DateTime.Parse(FechaRecepcion.Text); decimal monto = decimal.Parse(Monto.Text); DateTime fechaEntrega = DateTime.Parse(FechaEntrega.Text); string numeroResguardo = NumeroDeResguardo.Text; RecepcionAlmacen recepcionAlmacen = new RecepcionAlmacen(idRecepcionAlmacen, idRequisicion, idProveedor, claveRecepcion, fechaEntrega, fecharecepcion, monto, numeroResguardo); RecepcionAlmacenDAO recepcionAlmacenDAO = new RecepcionAlmacenDAO(); int f = recepcionAlmacenDAO.Insert(recepcionAlmacen); if (f == 0) { MessageBox.Show("Se agrego correctamente el proveedor"); IdProveedor.Text = ""; IdRequicicion.Text = ""; IdRecepcionAlmacen.Text = "IdProveedor"; ClaveRecepcionAlmacen.Text = ""; FechaRecepcion.Text = ""; FechaEntrega.Text = ""; Monto.Text = ""; NumeroDeResguardo.Text = ""; } }
public static void NotificarPorcorreo(string encabezado, string msgCuerpo, string email) { try { if (!string.IsNullOrEmpty(msgCuerpo) && !string.IsNullOrEmpty(encabezado) && !string.IsNullOrEmpty(email)) { //RCA 09/01/2018 //utilizamos la nueva forma de envio de correos por medio del SMTP EnvioCorreo EnviaCorreo = new EnvioCorreo(); Correo correo = new Correo(); Remitente RemitenteCorreo = new Remitente(); correo.Destinatarios = email; correo.Mensaje = msgCuerpo; correo.Asunto = encabezado; EnviaCorreo.EnviarCorreoElectronico(correo, RemitenteCorreo); //ControladorBUS bus = new ControladorBUS(); // bus.EnviarCorreo(encabezado, msgCuerpo, email); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void InsertRemitente() { Remitente remitente = new Remitente(); remitente.SetNombre("Alvaro"); remitente.SetApellidoPaterno("Salvador"); remitente.SetApellidoMaterno("Hernandez"); RemitenteDAO remitenteDAO = new RemitenteDAO(); remitenteDAO.Insert(remitente); }
public void UpdateRemitente() { Remitente remitente = new Remitente(); remitente.SetId(1); remitente.SetNombre("Alvaro"); remitente.SetApellidoPaterno("Salvador"); remitente.SetApellidoMaterno("Hernandez"); RemitenteDAO remitenteDAO = new RemitenteDAO(); remitenteDAO.Update(remitente); }
/// <summary> /// Actualiza los datos del remitente /// </summary> /// <param name="comprador">El nuevo objeto remitente que reemplazara al anterior</param> public int Update(Remitente remitente) { DAODataContext contexto = new DAODataContext(); remitentes remitenteTable = contexto.remitentes.Single(remitenteRow => remitenteRow.id_remitente == remitente.GetId()); remitenteTable.nombre_remitente = remitente.GetNombre(); remitenteTable.apellido_paterno_remitente = remitente.GetApellidoPaterno(); remitenteTable.apellido_materno_remitente = remitente.GetApellidoMaterno(); contexto.SubmitChanges(); return(0); }
/// <summary> /// Inserta un objeto remitente /// </summary> /// <param name="remitente"></param> public int Insert(Remitente remitente) { remitentes remitenteTable = new remitentes { nombre_remitente = remitente.GetNombre(), apellido_paterno_remitente = remitente.GetApellidoPaterno(), apellido_materno_remitente = remitente.GetApellidoMaterno() }; DAODataContext contexto = new DAODataContext(); contexto.remitentes.InsertOnSubmit(remitenteTable); contexto.SubmitChanges(); return(0); }
/// <summary> /// Borra un objeto remitente /// </summary> /// <param name="pro">El objeto remitente a ser borrado</param> public int Delete(Remitente remitente) { remitentes remitenteTable = new remitentes { id_remitente = remitente.GetId(), nombre_remitente = remitente.GetNombre(), apellido_paterno_remitente = remitente.GetApellidoPaterno(), apellido_materno_remitente = remitente.GetApellidoMaterno() }; DAODataContext contexto = new DAODataContext(); contexto.remitentes.Attach(remitenteTable); contexto.remitentes.DeleteOnSubmit(remitenteTable); contexto.SubmitChanges(); return(0); }
public void DeleteRecepcionAlmacen() { RecepcionAlmacen recepcionAlmacen = new RecepcionAlmacen(); Requisicion requisicion = new Requisicion(); Remitente remitente = new Remitente(); recepcionAlmacen.SetRemitente(remitente); recepcionAlmacen.SetRequisicion(requisicion); recepcionAlmacen.SetClave(3); recepcionAlmacen.SetFechaRecepcion(DateTime.Now); recepcionAlmacen.SetMonto(190); recepcionAlmacen.SetFechaEntregaDeAlmacen(DateTime.Now); recepcionAlmacen.SetNumeroResguardo("12"); RecepcionAlmacenDAO recepcionAlmacenDAO = new RecepcionAlmacenDAO(); recepcionAlmacenDAO.Delete(recepcionAlmacen); }
private void nuevoRemitente(object sender, RoutedEventArgs e) { int id = Int32.Parse(IdRemitente.Text); String nombre = Nombre.Text; String apellidoPaterno = ApellidoMaterno.Text; String apellidoMaterno = ApellidoMaterno.Text; Remitente remitente = new Remitente(id, nombre, apellidoPaterno, apellidoMaterno); RemitenteDAO remitenteDAO = new RemitenteDAO(); int f = remitenteDAO.Insert(remitente); if (f == 0) { MessageBox.Show("Se agrego correctamente el comprador"); IdRemitente.Text = "IdRemitente"; Nombre.Text = ""; ApellidoMaterno.Text = ""; ApellidoPaterno.Text = ""; } }
/// <summary> /// Inserccion del objeto Recepcion /// </summary> /// <param name="requisicion"></param> /// <param name="remitente"></param> /// <param name="clave"></param> /// <param name="fecha"></param> /// <param name="monto"></param> /// <param name="fechaEntrega"></param> /// <param name="numResguardo"></param> /// <returns>El código de error, 0 si el resultado es exitoso</returns> public int Insert(Requisicion requisicion, Remitente remitente, int clave, DateTime fecha, decimal monto, DateTime fechaEntrega, string numResguardo) { recepciones_almacen recepcionAlmacenTable = new recepciones_almacen { id_requisicion = requisicion.GetId(), id_remitente = remitente.GetId(), clave_recepcion_almacen = clave, fecha_recepcion_almacen = fecha, monto_recepcion_almacen = monto, fecha_entrega_de_almacen = fechaEntrega, num_resguardo_almacen = numResguardo }; DAODataContext contexto = new DAODataContext(); contexto.recepciones_almacens.InsertOnSubmit(recepcionAlmacenTable); contexto.SubmitChanges(); return(0); }
public void UpdateRecepcionAlmacen() { RecepcionAlmacen recepcionAlmacen = new RecepcionAlmacen(); RemitenteDAO remitenteDAO = new RemitenteDAO(); RequisicionDAO requisicionDAO = new RequisicionDAO(); CentroGastoDAO centroGastoDAO = new CentroGastoDAO(); ProveedorDAO proveedorDAO = new ProveedorDAO(); CompradorDAO compradorDAO = new CompradorDAO(); remitenteDAO.Insert("Elias", "Rosales", "Martinez"); Remitente remitente = remitenteDAO.FindByNombre("Elias"); centroGastoDAO.Insert("Facultad de Bellas Artes"); CentroGasto centroGasto = centroGastoDAO.FindByNombre("Facultad de Bellas Artes"); proveedorDAO.Insert("HP", true); Proveedor proveedor = proveedorDAO.FindByNombre("HP"); compradorDAO.Insert("Alejandro", "Martínez", "Pérez"); Comprador comprador = compradorDAO.FindByNombre("Alejandro"); requisicionDAO.Insert(centroGasto.GetId(), comprador.GetId(), proveedor.GetId(), "hola", DateTime.Now, DateTime.Now.AddMonths(3), 'e', "hola", DateTime.Now.AddMonths(5), "ninguna"); Requisicion requisicion = requisicionDAO.FindById(5); recepcionAlmacen.SetId(1); recepcionAlmacen.SetRemitente(remitente); recepcionAlmacen.SetRequisicion(requisicion); recepcionAlmacen.SetClave(8); recepcionAlmacen.SetFechaRecepcion(DateTime.Now); recepcionAlmacen.SetMonto(180); recepcionAlmacen.SetFechaEntregaDeAlmacen(DateTime.Now); recepcionAlmacen.SetNumeroResguardo("12"); RecepcionAlmacenDAO recepcionAlmacenDAO = new RecepcionAlmacenDAO(); recepcionAlmacenDAO.Update(recepcionAlmacen); }
public async Task AddRemitente(Remitente remitente) { Expression <Func <Remitente, bool> > exprRemitente = item => item.Nombre == remitente.Nombre; var remitentes = _unitOfWork.RemitenteRepository.FindByCondition(exprRemitente); //if (animals.Any(item => item.NombreArchivo == documento.NombreArchivo)) //throw new BusinessException("This animal name already exist."); /*var older = DateTime.Now - (documento?.FechaCreacion ?? DateTime.Now); * * if (older.TotalDays > 45) * throw new BusinessException("The animal's capture date is older than 45 days"); * Expression<Func<Documento, bool>> expressionTag = => tag.Tag == animal.RfidTag.Tag; * if (animal.RfidTag != null) * { * Expression<Func<RfidTag, bool>> exprTag = item => item.Tag == animal.RfidTag.Tag; * var tags = _unitOfWork.RfifTagRepository.FindByCondition(exprTag); * }*/ await _unitOfWork.RemitenteRepository.Add(remitente); }
public void UpdateRemitente(Remitente remitente) { _unitOfWork.RemitenteRepository.Update(remitente); _unitOfWork.SaveChangesAsync(); }
public void FindById() { RemitenteDAO remitenteDAO = new RemitenteDAO(); Remitente remitente = remitenteDAO.FindById(76); }
public static IRemitente GetRemitente() { Remitente remitente = new Remitente(); return((IRemitente)remitente); }