コード例 #1
0
 public Boolean AnularDB(imp_gastosxImport_Info Info)
 {
     try
     {
         EntitiesImportacion oEntities = new EntitiesImportacion();
         var contact = oEntities.imp_gastosxImport.FirstOrDefault(var => var.IdGastoImp == Info.IdGastoImp);
         if (contact != null)
         {
             contact.ga_estado = "I";
             oEntities.SaveChanges();
             oEntities.Dispose();
         }
         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() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #2
0
 public Boolean Validar(imp_gastosxImport_Info Info)
 {
     try
     {
         using (EntitiesImportacion oEntities = new EntitiesImportacion())
         {
             var asd = oEntities.Database.SqlQuery <imp_ordencompra_ext_x_imp_gastosxImport_Det_Info>("select * from imp_ordencompra_ext_x_imp_gastosxImport_det where IdGastoImp = " + Info.IdGastoImp);
             if (asd.ToList().Count >= 1)
             {
                 return(false);
             }
             else
             {
                 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() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #3
0
        public Boolean GuardarDB(ref imp_gastosxImport_Info Info)
        {
            try
            {
                using (EntitiesImportacion Context = new EntitiesImportacion())
                {
                    var Address = new imp_gastosxImport();

                    Address.CodGastoImp   = Info.CodGastoImp;
                    Address.ga_decripcion = Info.ga_decripcion;
                    Address.ga_estado     = "A";
                    Info.IdGastoImp       = Address.IdGastoImp = GetId();
                    Context.imp_gastosxImport.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() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #4
0
        public List <imp_gastosxImport_Info> Get_List_gastosxImport()
        {
            List <imp_gastosxImport_Info> Lst  = new List <imp_gastosxImport_Info>();
            EntitiesImportacion           oEnt = new EntitiesImportacion();

            try
            {
                var Lista = from q in oEnt.imp_gastosxImport
                            select q;
                foreach (var item in Lista)
                {
                    imp_gastosxImport_Info Info = new imp_gastosxImport_Info();
                    Info.IdGastoImp    = item.IdGastoImp;
                    Info.CodGastoImp   = item.CodGastoImp;
                    Info.ga_decripcion = item.ga_decripcion;
                    Info.ga_estado     = item.ga_estado;
                    Lst.Add(Info);
                }
                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() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #5
0
        private void gridViewGastos_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                _Info = (imp_gastosxImport_Info)gridViewGastos.GetFocusedRow();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());

                MessageBox.Show(ex.ToString());
            }
        }
コード例 #6
0
 public Boolean ModificarDB(imp_gastosxImport_Info Info)
 {
     try
     {
         return(oData.ModificarDB(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("", "Actualizar", ex.Message), ex)
               {
                   EntityType = typeof(imp_gastosxImport_Bus)
               };
     }
 }