Exemple #1
0
 public bool guardarDB(ct_grupocble_Info info)
 {
     try
     {
         using (Entities_contabilidad Context = new Entities_contabilidad())
         {
             ct_grupocble Entity = new ct_grupocble
             {
                 IdGrupoCble          = info.IdGrupoCble,
                 IdGrupo_Mayor        = info.IdGrupo_Mayor,
                 gc_estado_financiero = info.gc_estado_financiero,
                 gc_GrupoCble         = info.gc_GrupoCble,
                 gc_Orden             = info.gc_Orden,
                 gc_signo_operacion   = info.gc_signo_operacion,
                 Estado = info.Estado = "A"
             };
             Context.ct_grupocble.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #2
0
 public ct_grupocble_Info get_info(string IdGrupoCble)
 {
     try
     {
         ct_grupocble_Info info = new ct_grupocble_Info();
         using (Entities_contabilidad Context = new Entities_contabilidad())
         {
             ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == IdGrupoCble);
             if (Entity == null)
             {
                 return(null);
             }
             info = new ct_grupocble_Info
             {
                 IdGrupoCble          = Entity.IdGrupoCble,
                 IdGrupo_Mayor        = Entity.IdGrupo_Mayor,
                 gc_estado_financiero = Entity.gc_estado_financiero,
                 gc_GrupoCble         = Entity.gc_GrupoCble,
                 gc_Orden             = Entity.gc_Orden,
                 gc_signo_operacion   = Entity.gc_signo_operacion,
                 Estado = Entity.Estado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public Boolean GrabarDB(ct_Grupocble_Info info, ref string mensaje)
        {
            try
            {
                Boolean res = false;
                using (EntitiesDBConta context = new EntitiesDBConta())
                {
                    var Q = from per in context.ct_grupocble
                            where per.IdGrupoCble == info.IdGrupoCble
                            select per;

                    if (Q.ToList().Count == 0)
                    {
                        var address = new ct_grupocble();
                        address.IdGrupoCble          = info.IdGrupoCble;
                        address.gc_GrupoCble         = info.gc_GrupoCble;
                        address.gc_Orden             = Convert.ToByte(info.gc_Orden);
                        address.gc_estado_financiero = info.gc_estado_financiero;
                        address.gc_signo_operacion   = info.gc_signo_operacion;
                        address.Estado = info.Estado;
                        context.ct_grupocble.Add(address);
                        context.SaveChanges();
                        res = true;
                    }
                    else
                    {
                        mensaje = "No se pudo guardar el Grupo Cta Cble: " + info.IdGrupoCble + " ,Por favor revise si ya se encuenta ingresado";
                        return(false);
                    }
                }
                return(res);
            }
            catch (Exception ex)
            {
                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.ToString();
                throw new Exception(ex.ToString());
            }
        }
Exemple #4
0
        public bool anularDB(ct_grupocble_Info info)
        {
            try
            {
                using (Entities_contabilidad Context = new Entities_contabilidad())
                {
                    ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == info.IdGrupoCble);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.Estado = info.Estado = "I";

                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        public bool modificarDB(ct_grupocble_Info info)
        {
            try
            {
                using (Entities_contabilidad Context = new Entities_contabilidad())
                {
                    ct_grupocble Entity = Context.ct_grupocble.FirstOrDefault(q => q.IdGrupoCble == info.IdGrupoCble);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.gc_estado_financiero = info.gc_estado_financiero;
                    Entity.gc_GrupoCble         = info.gc_GrupoCble;
                    Entity.gc_Orden             = info.gc_Orden;

                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }