private void AsentarPlan() { string cuit = dgv_EmpresaAfectada.CurrentRow.Cells["cuit"].Value.ToString(); if (MessageBox.Show("Esta seguro de Asentar el Plan de Pago? ", "¡¡¡ ATENCION !!!", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (!ExistePlanVigente(cuit, NroDeAsignacion)) { using (var context = new lts_sindicatoDataContext()) { var NroDePlan = context.PlanesDePago.ToList().Count() == 0 ? 1 : context.PlanesDePago.Max(x => x.NroDePlan) + 1; PlanesDePago Insert = new PlanesDePago(); Insert.Fecha = DateTime.Now; Insert.CUIT = dgv_EmpresaAfectada.CurrentRow.Cells["cuit"].Value.ToString(); Insert.NroDeAsignacion = NroDeAsignacion; Insert.NroDePlan = NroDePlan; Insert.Estado = 1; Insert.DeudaInicial = Convert.ToDecimal(txt_DeudaInicial.Text); context.PlanesDePago.InsertOnSubmit(Insert); context.SubmitChanges(); CargarPlanDetalle(dgv_PlanDePagos, NroDePlan); Novedades InsertNovedad = new Novedades(); InsertNovedad.Fecha = DateTime.Now; InsertNovedad.Usuario = UserId; InsertNovedad.NumeroDeAsignacion = NroDeAsignacion; InsertNovedad.CUIT = cuit; if (txt_CantidadDeCuotas.Text == "1") { InsertNovedad.Novedad = "Se Confirma Plan de Pago bajo las siguientes condiciones: " + "Deuda Inical: $" + txt_DeudaInicial.Text + " - Compromiso de pago hasta el dia " + dtp_VencCuota.Value.Date.ToString("dd-MM-yyyy") + " - el importe a abonar es de: $" + txt_DeudaInicial.Text + " - NOTA IMPORTANTE !!! ->>> En caso de NO ABONAR dentro de la fecha pactada" + ", El plan CAERA hasta llegar a un nuevo acuerdo." ; } else { InsertNovedad.Novedad = "Se Confirma Plan de Pago bajo las siguientes condiciones: " + "Deuda Inical: $" + txt_DeudaInicial.Text + " - Anticipo: $" + txt_Anticipo.Text + " - Abonar Anticipo hasta el dia " + dtp_VencAnticipo.Value.Date + " - Una vez Abonado el Anticipo Toma Vigencia el PLan de Pago de " + txt_CantidadDeCuotas.Text + " Cuotas de $" + txt_ImporteDeCuota.Text + " Con vencimiento de la 1ª cuota el dia " + dtp_VencCuota.Value.Date.ToString("dd-MM-yyyy") + " - NOTA IMPORTANTE !!! ->>> En caso NO ABONAR el anticipo dentro de la fecha pactada, El plan CAERA hasta nuevo acuerdo." ; } context.Novedades.InsertOnSubmit(InsertNovedad); context.SubmitChanges(); MostrarNovedades(cuit, NroDeAsignacion); } } else { MessageBox.Show("Ya esiste un plan vigente para esta Empresa !!!!!"); } } }
private void btn_Actualizar_VD_Click(object sender, EventArgs e) { using (var context = new lts_sindicatoDataContext()) { foreach (var periodo in _VDDetalle) { var VDDetalle = context.VD_Detalle.Where(x => x.Id == periodo.Id).SingleOrDefault(); DateTime?FechaDePago = null; if (FechaDePago != null) { Convert.ToDateTime(periodo.FechaDePago); } VDDetalle.Periodo = Convert.ToDateTime(periodo.Periodo); VDDetalle.Rectificacion = periodo.Rectificacion; VDDetalle.CantidadEmpleados = periodo.CantidadEmpleados; VDDetalle.CantidadSocios = periodo.CantidadSocios; VDDetalle.TotalSueldoEmpleados = periodo.TotalSueldoEmpleados; VDDetalle.TotalSueldoSocios = periodo.TotalSueldoSocios; VDDetalle.TotalAporteEmpleados = periodo.TotalAporteEmpleados; VDDetalle.TotalAporteSocios = periodo.TotalAporteSocios; VDDetalle.FechaDePago = FechaDePago;//periodo.FechaDePago == null ? null : Convert.ToDateTime(periodo.FechaDePago); VDDetalle.ImporteDepositado = periodo.ImporteDepositado; VDDetalle.DiasDeMora = periodo.DiasDeMora; VDDetalle.DeudaGenerada = periodo.DeudaGenerada; VDDetalle.InteresGenerado = periodo.InteresGenerado; VDDetalle.Total = periodo.Total; VDDetalle.PerNoDec = periodo.PerNoDec; VDDetalle.ActaId = 0; VDDetalle.NumeroDeActa = 0; VDDetalle.Estado = 0; context.SubmitChanges(); } ; // Actualizo la tabla de VD_Inspector var UpdateVD = (from a in context.VD_Inspector where a.Id == _VDId select a).SingleOrDefault(); UpdateVD.Desde = Convert.ToDateTime(msk_Desde.Text); UpdateVD.Hasta = Convert.ToDateTime(msk_Hasta.Text); UpdateVD.FechaVenc = Convert.ToDateTime(msk_Vencimiento.Text); UpdateVD.TipoInteres = cbx_TipoDeInteres.SelectedIndex; UpdateVD.InteresMensual = Convert.ToDecimal(txt_Interes.Text); UpdateVD.InteresDiario = Convert.ToDecimal(txt_InteresDiario.Text); UpdateVD.Capital = Convert.ToDecimal(txt_Deuda.Text); //Math.Round(_ddjj.Sum(x => x.Capital), 2) UpdateVD.Interes = Convert.ToDecimal(txt_TotalInteres.Text); UpdateVD.Total = Convert.ToDecimal(txt_Total.Text); context.SubmitChanges(); } }
public int InsertarEntradaSocio(int eventoID, double cuil, int UsuarioId) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { eventos_cupones insert = new eventos_cupones(); if (context.eventos_cupones.Where(x => x.eventcupon_evento_id == eventoID).Count() > 0) { insert.event_cupon_nro = context.eventos_cupones.Where(x => x.eventcupon_evento_id == eventoID).Max(x => x.event_cupon_nro) + 1; } else { insert.event_cupon_nro = 1; } insert.eventcupon_evento_id = eventoID; insert.eventcupon_maesoc_cuil = cuil; insert.eventcupon_maeflia_codfliar = 0; insert.event_cupon_event_exep_id = 0; insert.event_cupon_fecha = DateTime.Now; insert.UsuarioId = UsuarioId; insert.Invitado = 0; insert.CajaId = 0; insert.Costo = 0; insert.ComprobanteId = 0; context.eventos_cupones.InsertOnSubmit(insert); context.SubmitChanges(); return(insert.event_cupon_nro); } }
public int EventosCuponesInsertar(int eventoID, double cuil, int CodigoFliar, int ExepcionID, int ArticuloID, int UsuarioID, string QuienRetira, int FondoDeDesempleo, string cuilSocio, int Termas) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { eventos_cupones insert = new eventos_cupones(); if (context.eventos_cupones.Count() > 0) { insert.event_cupon_nro = context.eventos_cupones.Max(x => x.event_cupon_nro) + 1; } else { insert.event_cupon_nro = 1; } insert.TurnoId = GetTurno(cuilSocio, Termas); insert.eventcupon_evento_id = eventoID; insert.eventcupon_maesoc_cuil = cuil; insert.eventcupon_maeflia_codfliar = CodigoFliar; insert.event_cupon_event_exep_id = ExepcionID; insert.event_cupon_fecha = DateTime.Now; insert.UsuarioId = UsuarioID; insert.ArticuloID = ArticuloID; insert.QuienRetiraCupon = QuienRetira; insert.FondoDeDesempleo = FondoDeDesempleo; insert.CuilStr = cuilSocio; context.eventos_cupones.InsertOnSubmit(insert); context.SubmitChanges(); return(insert.event_cupon_nro); } }
public cls_EventosExep InsertarExepciones(string apellido, string nombre, string dni, DateTime fechanac, string sexo, int parentescoId, double socioCuil) { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { try { eventos_exep insert = new eventos_exep(); insert.event_exep_apellido = apellido.ToUpper(); insert.event_exep_nombre = nombre.ToUpper(); insert.event_exep_dni = dni; insert.event_exep_fechanac = fechanac; insert.event_exep_sexo = sexo; insert.event_exep_parent = parentescoId; insert.event_exep_socio_cuil = socioCuil; context.eventos_exep.InsertOnSubmit(insert); context.SubmitChanges(); varEventoExepecion.EventExepId = context.eventos_exep.Max(x => x.event_exep_id); varEventoExepecion.EventExepApellido = apellido; varEventoExepecion.EventExepNombre = nombre; varEventoExepecion.EventExepDni = dni; varEventoExepecion.EventFechaNac = fechanac; varEventoExepecion.EventExpSexo = sexo; varEventoExepecion.EventExepParent = parentescoId; varEventoExepecion.EventSocioCuil = socioCuil; return(varEventoExepecion); } catch (Exception) { throw; } } }
public static void InsertVDDetalle(EstadoDDJJ periodo, int VDInspectorId) { using (var context = new lts_sindicatoDataContext()) { VD_Detalle VDDetalle = new VD_Detalle { VDInspectorId = VDInspectorId, Periodo = periodo.Periodo, Rectificacion = periodo.Rectificacion, CantidadEmpleados = periodo.Empleados, CantidadSocios = periodo.Socios, TotalSueldoEmpleados = periodo.TotalSueldoEmpleados, TotalSueldoSocios = periodo.TotalSueldoSocios, TotalAporteEmpleados = periodo.AporteLey, TotalAporteSocios = periodo.AporteSocio, FechaDePago = periodo.FechaDePago, ImporteDepositado = periodo.ImporteDepositado, DiasDeMora = periodo.DiasDeMora, DeudaGenerada = periodo.Capital, InteresGenerado = periodo.Interes, Total = periodo.Total, PerNoDec = periodo.PerNoDec, ActaId = 0, NumeroDeActa = 0, Estado = 0 }; context.VD_Detalle.InsertOnSubmit(VDDetalle); context.SubmitChanges(); } }
private void btn_CopiarFotos_Click(object sender, EventArgs e) { convertir_imagen cnvImg = new convertir_imagen(); Image fto; using (var context = new lts_sindicatoDataContext()) { var fotos = from a in context.fotos.Where(x => x.FOTOS_CODFLIAR > 0)//.Take(30) //where a.FOTOS_CODFLIAR == 0 Take(10) select a; if (fotos.Count() > 0) { lbl_Inicio.Text = DateTime.Now.ToLongTimeString(); foreach (var foto in fotos) { using (var context2 = new lts_sindicatoDataContext()) { fotos2 FotoInsert = new fotos2(); FotoInsert.FOTOS_CUIL = foto.FOTOS_CUIL; FotoInsert.FOTOS_CODFLIAR = foto.FOTOS_CODFLIAR; FotoInsert.FOTOS_FECHA = foto.FOTOS_FECHA; fto = cnvImg.ByteArrayToImage(foto.FOTOS_FOTO.ToArray()); FotoInsert.FOTOS_FOTO = cnvImg.ConvertImageToByteArray(fto); context2.fotos2.InsertOnSubmit(FotoInsert); context2.SubmitChanges(); } } lbl_Fin.Text = DateTime.Now.ToLongTimeString(); } } }
public static void CargarPlanDetalle(List <mdlCuadroAmortizacion> _PlanDePago, int NroDePlan) { using (var context = new lts_sindicatoDataContext()) { foreach (var item in _PlanDePago) { PlanDetalle InsertPlanDetalle = new PlanDetalle(); InsertPlanDetalle.NroPlanDePago = NroDePlan; InsertPlanDetalle.Cuota = item.Cuota == "Anticipo" ? 0 : Convert.ToInt32(item.Cuota); //fila.Cells["CuotaDelPlan"].Value.ToString() == "Anticipo" ? 0 : Convert.ToInt32(fila.Cells["CuotaDelPlan"].Value); InsertPlanDetalle.ImporteCuota = (decimal)item.ImporteDeCuota; //Convert.ToDecimal(fila.Cells["ImporteDeCuota"].Value); InsertPlanDetalle.Interes = (decimal)item.Interes; //Convert.ToDecimal(fila.Cells["InteresDeCuota"].Value); InsertPlanDetalle.Amortizado = (decimal)item.Amortizado; //Convert.ToDecimal(fila.Cells["Amortizado"].Value); InsertPlanDetalle.AAmortizar = (decimal)item.AAmortizar; //Convert.ToDecimal(fila.Cells["AAmortizar"].Value); InsertPlanDetalle.FechaVenc = item.FechaDeVenc; // Convert.ToDateTime(fila.Cells["FechaDeVencimiento"].Value); InsertPlanDetalle.Estado = 1; InsertPlanDetalle.InteresResarcitorio = 0; InsertPlanDetalle.DiasDeMora = 0; InsertPlanDetalle.ImporteCobrado = 0; InsertPlanDetalle.Cancelado = "0"; context.PlanDetalle.InsertOnSubmit(InsertPlanDetalle); context.SubmitChanges(); } } }
public static void Update_VDInspector(VD_Inspector VDInspector) { using (var context = new lts_sindicatoDataContext()) { context.SubmitChanges(); } }
private void btn_reservar_Click(object sender, EventArgs e) { try { reservas_quinchos res_qui = new reservas_quinchos(); res_qui.reservas_fecha = dtp_consulta.Value; res_qui.reservas_quinchos_id = Convert.ToInt32(dgv_reservados.CurrentRow.Cells[4].Value);// Convert.ToInt32(cbx_quinchos.SelectedValue); res_qui.reservas_socios_id = Convert.ToDouble(lbl_cuil.Text); res_qui.reservas_evento = Convert.ToInt32(cbx_eventos.SelectedValue); res_qui.reservas_invitados = Convert.ToInt32(txt_invitados.Text); res_qui.reservas_tenedor = Convert.ToInt32(txt_tenedor.Text); res_qui.reservas_vasos = Convert.ToInt32(txt_vasos.Text); res_qui.reservas_cuchillos = Convert.ToInt32(txt_cuchillo.Text); res_qui.reservas_comentario = txt_observaciones.Text; res_qui.reservas_costo = Convert.ToDouble(txt_costo.Text); db_sindicato.reservas_quinchos.InsertOnSubmit(res_qui); db_sindicato.SubmitChanges(); frm_dialog f_dialog = new frm_dialog(); f_dialog.lbl_detalle.Text = "La Reserva de '" + dgv_reservados.CurrentRow.Cells[0].Value.ToString() + "' para el cliente '" + lbl_socio.Text + "' fue reservada con exito " + " para el dia '" + dtp_consulta.Value.ToString("dd/MM/yyyy") + "'"; f_dialog.Show(); mostrar_reservas(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); throw; } }
private void Update_VDInspector(int VDInspectorId) { using (var context = new lts_sindicatoDataContext()) { VD_Inspector VDInspector = context.VD_Inspector.Where(x => x.Id == VDInspectorId).Single(); VDInspector.InspectorId = Convert.ToInt32(cbx_Inspectores.SelectedValue); VDInspector.EmpresaId = 0; VDInspector.CUIT = txt_CUIT.Text.Trim(); VDInspector.FechaAsignacion = DateTime.Now; VDInspector.Estado = 0; VDInspector.FechaCierre = null; VDInspector.Desde = Convert.ToDateTime(msk_Desde.Text); VDInspector.Hasta = Convert.ToDateTime(msk_Hasta.Text); VDInspector.FechaVenc = Convert.ToDateTime(msk_Vencimiento.Text); VDInspector.TipoInteres = cbx_TipoDeInteres.SelectedIndex; VDInspector.InteresMensual = Convert.ToDecimal(txt_Interes.Text); VDInspector.InteresDiario = Convert.ToDecimal(txt_InteresDiario.Text); VDInspector.Capital = Convert.ToDecimal(txt_Deuda.Text); //Math.Round(_ddjj.Sum(x => x.Capital), 2) VDInspector.Interes = Convert.ToDecimal(txt_TotalInteres.Text); VDInspector.Total = Convert.ToDecimal(txt_Total.Text); VDInspector.EmpleadosCantidad = _ddjj.Where(x => x.Periodo == _ddjj.Max(y => y.Periodo)).FirstOrDefault().Empleados; VDInspector.UserId = _UserId; context.SubmitChanges(); } }
private void GuardarActa() { using (var context = new lts_sindicatoDataContext()) { ACTAS insert = new ACTAS(); insert.ACTA = Convert.ToInt32(txt_NroDeActa.Text); insert.FECHA = dtp_FechaDeEmision.Value.Date; insert.FECHA_VENC_ACTA = dtp_FechaDeVencimiento.Value; insert.DESDE = Convert.ToDateTime("01/" + msk_Desde.Text); insert.HASTA = Convert.ToDateTime("01/" + msk_Hasta.Text); insert.DEUDAHISTORICA = Convert.ToDouble(txt_Capital.Text); insert.INTERESES = Convert.ToDouble(txt_Interes.Text); insert.DEUDAACTUALIZADA = insert.DEUDAHISTORICA + insert.INTERESES; insert.INTERESFINANC = Convert.ToDouble(txt_InteresDeFinanciacion.Text); insert.IMPORTECOBRADO = 0; insert.DEUDATOTAL = insert.DEUDAHISTORICA + insert.INTERESES; insert.InspectorId = Convert.ToInt32(cbx_Inspector.SelectedValue); insert.CUIT_STR = txt_CUIT.Text; insert.EMPRESA = txt_RazonSocial.Text; context.ACTAS.InsertOnSubmit(insert); context.SubmitChanges(); MostarActas(); } }
private void asignar_acta_estudio() { using (lts_sindicatoDataContext context = new lts_sindicatoDataContext()) { foreach (DataGridViewRow fila in dgv_actas_estudio.Rows) { if (Convert.ToBoolean(fila.Cells["Imput"].Value)) { var acta = (from a in context.ACTAS.Where(x => x.ACTA == Convert.ToDouble(fila.Cells["num_acta"].Value)) select a).FirstOrDefault(); acta.ESTUDIO_INSPECTOR = Convert.ToInt16(cbx_estudios.SelectedValue); acta.ESTUDIO_JURIDICO = 1; acta.NUM_CERTIF = acta.ACTA + cbx_estudios.SelectedValue.ToString(); acta.MONTO_CERTIF = Convert.ToDecimal(lbl_total_deuda.Text); acta.MONTO_CERTIF_ACTA = Convert.ToDecimal(fila.Cells["importe_act"].Value); acta.INSPECTOR_ANTERIOR = acta.INSPECTOR; acta.INSPECTOR = cbx_estudios.Text; acta.FECHA_ASIG_ANTERIOR = acta.FECHA_ASIG; acta.FECHA_ASIG = DateTime.Now.Date; context.SubmitChanges(); MessageBox.Show("Deuda asignada con exito."); Close(); } } } }
public static void GuardarActaDetalle(List <EstadoDDJJ> ddjjt, int actaNumero, string actaCuit, int actaId) { using (var context = new lts_sindicatoDataContext()) { foreach (var periodo in ddjjt) { ActasDetalle actadet = new ActasDetalle { NumeroDeActa = actaNumero, ActaId = actaId, Periodo = periodo.Periodo, CantidadEmpleados = periodo.Empleados, CantidadSocios = periodo.Socios, TotalSueldoEmpleados = periodo.TotalSueldoEmpleados, TotalSueldoSocios = periodo.TotalSueldoSocios, TotalAporteEmpleados = periodo.AporteLey, TotalAporteSocios = periodo.AporteSocio, FechaDePago = Convert.ToDateTime(periodo.FechaDePago), ImporteDepositado = periodo.ImporteDepositado, DiasDeMora = periodo.DiasDeMora, DeudaGenerada = periodo.Capital, InteresGenerado = periodo.Interes, Total = periodo.Total, PerNoDec = periodo.PerNoDec }; context.ActasDetalle.InsertOnSubmit(actadet); context.SubmitChanges(); } } }
private void btn_aceptar_Click(object sender, EventArgs e) { if (pasa_control() == true) { using (var context = new lts_sindicatoDataContext()) { ParaInspeccion insert = new ParaInspeccion(); insert.CUIL = txt_cuil.Text.ToString().Trim(); insert.CUIT = txt_cuit.Text.ToString().Trim(); insert.FECHA = DateTime.Today; insert.ESTADO = 0; try { context.ParaInspeccion.InsertOnSubmit(insert); context.SubmitChanges(); } catch (Exception) { throw; } try { if (txt_comentario.Text != string.Empty) { comentarios comit = new comentarios(); comit.ID_USUARIO = id_usuario; comit.COMENTARIO = txt_comentario.Text; comit.FECHA = DateTime.Today; comit.PI_ID = context.ParaInspeccion.OrderByDescending(x => x.ID).First().ID; context.comentarios.InsertOnSubmit(comit); context.SubmitChanges(); MessageBox.Show("¡¡¡¡¡ Datos para la inspeccion, Cargados Existosamente !!!!! "); btn_aceptar.Enabled = false; Close(); } } catch (Exception) { throw; } } } }
public void ActivarSocio(double cuil) { lts_sindicatoDataContext context = new lts_sindicatoDataContext(); var activar_socio = context.soccen.Where(x => x.SOCCEN_CUIL == Convert.ToDouble(cuil)); activar_socio.Single().SOCCEN_ESTADO = 1; context.SubmitChanges(); }
public static int Insert_VDInspector(VD_Inspector VDInspector)//int IdInspector, string Cuit,int UserId) { using (var context = new lts_sindicatoDataContext()) { context.VD_Inspector.InsertOnSubmit(VDInspector); context.SubmitChanges(); return(context.VD_Inspector.Max(x => x.Id)); //retorna el Id del al relacion inspector verificacion de deuca } }
public void CerrarCaja(int CajaId, int UsuarioId, int EventoId) { using (var context = new lts_sindicatoDataContext()) { var caja = context.Cajas.Where(x => x.Id == CajaId).First(); caja.FechaCierre = DateTime.Now; context.SubmitChanges(); var CierreDeCaja = context.eventos_cupones.Where (x => x.UsuarioId == UsuarioId && x.CajaId == 0 && x.eventcupon_evento_id == EventoId); if (CierreDeCaja.Count() > 0) { foreach (var item in CierreDeCaja.ToList()) { item.CajaId = CajaId; } context.SubmitChanges(); } } }
public void limpiar_tabla_impresion() { using (var context = new lts_sindicatoDataContext()) { foreach (var item in context.impresion_comprobante.ToList()) { context.impresion_comprobante.DeleteOnSubmit(item); context.SubmitChanges(); } } }
public void AbrirCaja(int UsuarioId) { using (var context = new lts_sindicatoDataContext()) { Cajas Insert = new Cajas(); Insert.UserId = UsuarioId; Insert.FechaApertura = DateTime.Now; context.Cajas.InsertOnSubmit(Insert); context.SubmitChanges(); } }
private void ImputarPagoEnCuota(DataGridViewRow fila, int imp, int NroRecibo, mdlEstadoPlanDePago pln) //imp = 1 significa que es pago parcial { using (var context = new lts_sindicatoDataContext()) { // >>>> Imputo el pago en la cuota correspondiente var Cuota = context.PlanDetalle.Where(x => x.NroPlanDePago == _NroDePlan && x.Cuota == (int)fila.Cells["CuotaDelPlan"].Value).SingleOrDefault(); Cuota.InteresResarcitorio = Convert.ToDecimal(fila.Cells["InteresDeCuota"].Value); Cuota.DiasDeMora = (int)fila.Cells["DiasDeMora"].Value; Cuota.ImporteCobrado = imp == 0 ? (decimal)fila.Cells["Total"].Value + Cuota.ImporteCobrado : Cuota.ImporteCobrado + _Recaudado;//(decimal)fila.Cells["Total"].Value - _Diferencia; Cuota.Cancelado = imp == 0 ? "1" : "0"; if (imp == 0) { Cuota.FechaCancela = DateTime.Now; } context.SubmitChanges(); // <<<< Fin de imputacion en cuota // >>>> Guardo el Detalle del recibo. RecibosDetalle RcbDetalle = new RecibosDetalle { CuotaId = pln.CuotaId, NroCuota = pln.Cuota, NroAut = NroRecibo, FechaAut = DateTime.Now, NroManual = 1, FechaManual = DateTime.Now, TipoId = 1, ConceptoId = 1, ModoPagoId = 1, UsuarioId = 1, Importe = imp == 0 ? (decimal)fila.Cells["Total"].Value : _Recaudado }; context.RecibosDetalle.InsertOnSubmit(RcbDetalle); context.SubmitChanges(); // <<<<< fin de guardado del detalle de recibo _ACobrar -= (decimal)fila.Cells["Total"].Value; _Recaudado -= (decimal)fila.Cells["Total"].Value; } }
public void ModificarNovedad(string cuit, int NroDeAsignacionViejo, int NroDeAsignacionNuevo, int UserId) { using (var context = new lts_sindicatoDataContext()) { var novedades = context.Novedades.Where(x => x.CUIT == cuit && x.NumeroDeAsignacion == NroDeAsignacionViejo); foreach (var item in novedades) { item.NumeroDeAsignacion = NroDeAsignacionNuevo; context.SubmitChanges(); } } }
private void btn_recibir_docum_Click(object sender, EventArgs e) { int b = 0; if (contar_document_y_mochilas() == 0) { MessageBox.Show("debe tildar al menos una casilla de recepcion de documentacion", "¡¡¡¡ Atencion !!!!"); } else { try { foreach (DataGridViewRow fila in dgv_familiar_a_cargo_mochilas.Rows) { if ((fila.Cells["documentacion"].Value != null)) { // && (fila.Cells["doc_recibida"].Value.ToString()) != "SI") var var_controlar_repetidos = from a in DB_socios.entregas_mochilas where a.cod_fliar == Convert.ToInt16(fila.Cells["codigo_familiar"].Value.ToString()) select a; if (var_controlar_repetidos.Count() == 0) { entregas_mochilas entrega_mochi = new entregas_mochilas(); entrega_mochi.cod_fliar = Convert.ToInt16(fila.Cells["codigo_familiar"].Value.ToString()); entrega_mochi.nro_doc_fliar = Convert.ToInt32(fila.Cells["dni_beneficiario"].Value.ToString()); entrega_mochi.recibe_docum = true; entrega_mochi.fecha_recepcion_docum = DateTime.Now; entrega_mochi.tipo_mochila = Convert.ToInt16(fila.Cells["mochila"].Value.ToString().Substring(0, 1)); entrega_mochi.codigo_usuario_recepcion = 0; entrega_mochi.legajo = txt_legajo.Text; if (chk_fdo_desempleo.Checked) { entrega_mochi.fondo_desempleo = 1; } entrega_mochi.comentario = txt_comentario.Text; DB_socios.entregas_mochilas.InsertOnSubmit(entrega_mochi); DB_socios.SubmitChanges(); b = 1; } } } if (b == 1) { MessageBox.Show("Documentacion recibia EXITOSAMENTE", "¡¡¡¡ ATENCION !!!!"); limpiar(); } } catch (Exception) { MessageBox.Show("" + e, "¡¡¡¡ ERROR !!!!"); //Console.WriteLine(e)); } } }
public void ModificarAsignacionDeCobranza(string cuit, int NroDeAsignacionViejo, int NroDeAsignacionNuevo, int CobradorId) { using (var context = new lts_sindicatoDataContext()) { var cambio = context.AsignarCobranza.Where(x => x.CUIT == cuit && x.NroAsignacion == NroDeAsignacionViejo); foreach (var item in cambio) { item.NroAsignacion = NroDeAsignacionNuevo; item.CobradorID = CobradorId; context.SubmitChanges(); } } }
public static void GrabarEfectivo(int NroDerecibo, int NroDeActa, Decimal Importe) { using (var context = new lts_sindicatoDataContext()) { Efectivo efectivo = new Efectivo { NroDeRecibo = NroDerecibo, NroDeActa = NroDeActa, Importe = Importe, Fecha = DateTime.Now }; context.Efectivo.InsertOnSubmit(efectivo); context.SubmitChanges(); } }
public void AsignarNroDeAsignacionALaNovedad(int NroDeAsignacion) { using (var context = new lts_sindicatoDataContext()) { var NovedadesParaAsignar = context.Novedades.Where(x => x.NumeroDeAsignacion == 0); if (NovedadesParaAsignar.Count() > 0) { //int NumeroDeAsignacion = GetNroDeAsignacion(CobradorId); foreach (var Item in NovedadesParaAsignar.ToList()) { Item.NumeroDeAsignacion = NroDeAsignacion;//NumeroDeAsignacion; context.SubmitChanges(); } } } }
public void AsignarNumeroDeAsignacion(int CobradorId, int NroDeAsignacion) { using (var context = new lts_sindicatoDataContext()) { var NoAsignadas = context.AsignarCobranza.Where(x => x.NroAsignacion == 0); if (NoAsignadas.Count() > 0) { //int NumeroDeAsignacion = GetNroDeAsignacion(CobradorId); foreach (var Item in NoAsignadas.ToList()) { Item.NroAsignacion = NroDeAsignacion;//NumeroDeAsignacion; context.SubmitChanges(); } } } }
public static void GrabarCanje(int NroDeActa, int NroDerecibo, DateTime?FechaDeRemito, DateTime?FechaFactura, Decimal Importe, string Descripcion, int UsuarioId) { using (var context = new lts_sindicatoDataContext()) { canjes canje = new canjes { NroDeActa = NroDeActa, NroDeRecibo = NroDerecibo, FechaRemito = Convert.ToDateTime(FechaDeRemito), FechaFactura = Convert.ToDateTime(FechaFactura), ImporteFactura = Importe, Descripcion = Descripcion, UsuarioId = UsuarioId }; context.canjes.InsertOnSubmit(canje); context.SubmitChanges(); } }
public static void GrabarNroDeRecibo(int NroDeRecibo, int NroDeActa, decimal ImporteDeRecibo, string FechaReciboManual, string NroReciboManual) { using (var context = new lts_sindicatoDataContext()) { Recibos rcb = new Recibos { NroAutomatico = NroDeRecibo, FechaAutomatica = DateTime.Now, NroDeActa = NroDeActa, Importe = ImporteDeRecibo, Estado = 1, FechaManual = FechaReciboManual, NroManual = NroReciboManual, }; context.Recibos.InsertOnSubmit(rcb); context.SubmitChanges(); } }
public static void GrabarTransf(int NroDerecibo, int NroDeActa, string NroDeTransf, int BancoId, decimal Monto, DateTime FechaDeTransf, int UsuarioId) { using (var context = new lts_sindicatoDataContext()) { Transferencias transf = new Transferencias { NroDeRecibo = NroDerecibo, NroDeActa = NroDeActa, NroDeTransf = NroDeTransf, BancoId = BancoId, Monto = Monto, FechaDeTransf = FechaDeTransf, FechaDeCarga = DateTime.Now, UsuarioId = UsuarioId }; context.Transferencias.InsertOnSubmit(transf); context.SubmitChanges(); } }