Ejemplo n.º 1
0
        public bool ModificarDB_campos_op(cp_cuotas_x_doc_det_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    cp_cuotas_x_doc_det Entity = Context.cp_cuotas_x_doc_det.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdCuota == info.IdCuota && q.Secuencia == info.Secuencia);
                    if (Entity != null)
                    {
                        Entity.IdEmpresa_op = info.IdEmpresa_op;
                        Entity.IdOrdenPago  = info.IdOrdenPago;
                        Entity.Secuencia_op = info.Secuencia_op;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 2
0
        public bool GuardarDB(List <cp_cuotas_x_doc_det_Info> Lista)
        {
            try
            {
                int sec = 1;
                using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar())
                {
                    foreach (var item in Lista)
                    {
                        cp_cuotas_x_doc_det Entity = new cp_cuotas_x_doc_det
                        {
                            IdEmpresa        = item.IdEmpresa,
                            IdCuota          = item.IdCuota,
                            Secuencia        = sec,
                            Num_cuota        = item.Num_cuota,
                            Fecha_vcto_cuota = item.Fecha_vcto_cuota,
                            Valor_cuota      = item.Valor_cuota,
                            Observacion      = item.Observacion,
                            Estado           = item.Estado,
                            Secuencia_op     = sec++
                        };
                        Context.cp_cuotas_x_doc_det.Add(Entity);
                    }
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        public bool GuardarDB(List <cp_cuotas_x_doc_det_Info> Lista)
        {
            try
            {
                int sec = 1;
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    foreach (var item in Lista)
                    {
                        cp_cuotas_x_doc_det Entity = new cp_cuotas_x_doc_det();
                        Entity.IdEmpresa        = item.IdEmpresa;
                        Entity.IdCuota          = item.IdCuota;
                        Entity.Secuencia        = sec;
                        Entity.Num_cuota        = item.Num_cuota;
                        Entity.Fecha_vcto_cuota = item.Fecha_vcto_cuota;
                        Entity.Valor_cuota      = item.Valor_cuota;
                        Entity.Observacion      = item.Observacion;
                        Entity.Estado           = item.Estado;

                        Context.cp_cuotas_x_doc_det.Add(Entity);
                        Context.SaveChanges();

                        sec++;
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 4
0
        public bool ModificarDB_campos_op(cp_cuotas_x_doc_det_Info info)
        {
            try
            {
                using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar())
                {
                    cp_cuotas_x_doc_det Entity = Context.cp_cuotas_x_doc_det.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdCuota == info.IdCuota && q.Secuencia == info.Secuencia);
                    if (Entity != null)
                    {
                        Entity.IdEmpresa_op = info.IdEmpresa_op;
                        Entity.IdOrdenPago  = info.IdOrdenPago;
                        Entity.Secuencia_op = info.Secuencia_op;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }