Пример #1
0
        public bool anularDB(cp_orden_giro_Info info)
        {
            try
            {
                using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar())
                {
                    cp_orden_giro Entity = Context.cp_orden_giro.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa &&
                                                                                q.IdTipoCbte_Ogiro == info.IdTipoCbte_Ogiro &&
                                                                                q.IdCbteCble_Ogiro == info.IdCbteCble_Ogiro);
                    if (Entity == null)
                    {
                        return(false);
                    }

                    Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    Entity.Fecha_UltAnu    = info.Fecha_UltAnu;
                    Entity.Estado          = "I";

                    var rel = Context.cp_orden_giro_x_in_Ing_Egr_Inven.Where(q => q.og_IdEmpresa == info.IdEmpresa && q.og_IdTipoCbte_Ogiro == info.IdTipoCbte_Ogiro && q.og_IdCbteCble_Ogiro == info.IdCbteCble_Ogiro).FirstOrDefault();
                    if (rel != null)
                    {
                        data_inv.anularDB(new in_Ing_Egr_Inven_Info {
                            IdEmpresa = rel.inv_IdEmpresa, IdSucursal = rel.inv_IdSucursal, IdMovi_inven_tipo = rel.inv_IdMovi_inven_tipo, IdNumMovi = rel.inv_IdNumMovi, IdusuarioUltAnu = info.IdUsuarioUltAnu
                        });
                    }

                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
 public bool anularDB(in_Ing_Egr_Inven_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }