示例#1
0
        public ct_cbtecble_tipo_x_empresa_Info Get_Info_cbtecble_tipo_x_empresa(int IdEmpresa, int IdTipoCbte)
        {
            ct_cbtecble_tipo_x_empresa_Info Obj = new ct_cbtecble_tipo_x_empresa_Info();

            try
            {
                EntitiesDBConta            oEnti = new EntitiesDBConta();
                ct_cbtecble_tipo_x_empresa item  = oEnti.ct_cbtecble_tipo_x_empresa.FirstOrDefault(
                    q => q.IdEmpresa == IdEmpresa && q.IdTipoCbte == IdTipoCbte);


                Obj.IdEmpresa  = item.IdEmpresa;
                Obj.IdTipoCbte = item.IdTipoCbte;
                Obj.UltReg     = item.UltReg;
                return(Obj);
            }
            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());
            }
        }
示例#2
0
        public Boolean GuardarDB(ct_cbtecble_tipo_x_empresa_Info Info)
        {
            try
            {
                using (EntitiesDBConta Context = new EntitiesDBConta())
                {
                    var Address = new ct_cbtecble_tipo_x_empresa();

                    Address.IdTipoCbte = Info.IdTipoCbte;
                    Address.IdEmpresa  = Info.IdEmpresa;
                    Address.UltReg     = 0;

                    Context.ct_cbtecble_tipo_x_empresa.Add(Address);
                    Context.SaveChanges();
                }
                return(true);
            }
            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());
            }
        }
示例#3
0
 public List <ct_cbtecble_tipo_x_empresa_Info> Get_list_cbtecble_tipo_x_empresa(int IdEmpresa)
 {
     try
     {
         List <ct_cbtecble_tipo_x_empresa_Info> Lst = new List <ct_cbtecble_tipo_x_empresa_Info>();
         EntitiesDBConta oEnti = new EntitiesDBConta();
         var             Query = from q in oEnti.ct_cbtecble_tipo_x_empresa
                                 where q.IdEmpresa == IdEmpresa
                                 select q;
         foreach (var item in Query)
         {
             ct_cbtecble_tipo_x_empresa_Info Obj = new ct_cbtecble_tipo_x_empresa_Info();
             Obj.IdEmpresa  = item.IdEmpresa;
             Obj.IdTipoCbte = item.IdTipoCbte;
             Obj.UltReg     = item.UltReg;
             Lst.Add(Obj);
         }
         return(Lst);
     }
     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());
     }
 }
 public Boolean EliminarDB(ct_cbtecble_tipo_x_empresa_Info Info)
 {
     try
     {
         return(oData.EliminarDB(Info));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "EliminarDB", ex.Message), ex)
               {
                   EntityType = typeof(ct_cbtecble_tipo_x_empresa_Bus)
               };
     }
 }
示例#5
0
 public Boolean EliminarDB(ct_cbtecble_tipo_x_empresa_Info Info)
 {
     try
     {
         using (EntitiesDBConta Context = new EntitiesDBConta())
         {
             Context.Database.ExecuteSqlCommand("delete from ct_cbtecble_tipo_x_empresa where IdEmpresa = " + Info.IdEmpresa + " and IdTipoCbte = " + Info.IdTipoCbte);
         }
         return(true);
     }
     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());
     }
 }