Exemplo n.º 1
0
        public Boolean GuardarDB(ref imp_Embarcador_Info Info)
        {
            try
            {
                List <imp_Embarcador_Info> Lst = new List <imp_Embarcador_Info>();
                using (EntitiesImportacion Context = new EntitiesImportacion())
                {
                    var Address = new imp_Embarcador();

                    Info.IdEmbarcador      = Address.IdEmbarcador = GetId(Info.IdEmpresa);
                    Address.IdEmpresa      = Info.IdEmpresa;
                    Address.em_descripcion = Info.em_descripcion;
                    Address.em_direccion   = Info.em_direccion;
                    Address.em_telefono    = Info.em_telefono;
                    Address.em_contacto    = Info.em_contacto;
                    Address.em_email       = Info.em_email;
                    Address.Estado         = "A";

                    Context.imp_Embarcador.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());
            }
        }
Exemplo n.º 2
0
 public Boolean AnularDB(imp_Embarcador_Info Info)
 {
     try
     {
         using (EntitiesImportacion Context = new EntitiesImportacion())
         {
             var contact = Context.imp_Embarcador.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdEmbarcador == Info.IdEmbarcador);
             if (contact != null)
             {
                 contact.Estado = "I";
                 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());
     }
 }
Exemplo n.º 3
0
        public imp_Embarcador_Info Get_Info_Embarcador(int IdEmpresa, int IdEmbarcador)
        {
            EntitiesImportacion oEnti = new EntitiesImportacion();
            imp_Embarcador_Info Info  = new imp_Embarcador_Info();

            try
            {
                var Objeto = oEnti.imp_Embarcador.FirstOrDefault(var => var.IdEmpresa == IdEmpresa && var.IdEmbarcador == IdEmbarcador);
                if (Objeto != null)
                {
                    Info.IdEmpresa      = Objeto.IdEmpresa;
                    Info.IdEmbarcador   = Objeto.IdEmbarcador;
                    Info.em_descripcion = Objeto.em_descripcion;
                    Info.em_direccion   = Objeto.em_direccion;
                    Info.em_telefono    = Objeto.em_telefono;
                    Info.em_contacto    = Objeto.em_contacto;
                    Info.em_email       = Objeto.em_email;
                    Info.Estado         = Objeto.Estado;
                }
                return(Info);
            }
            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());
            }
        }
Exemplo n.º 4
0
 private void gridViewEmbarcador_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         _Info = (imp_Embarcador_Info)gridViewEmbarcador.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
Exemplo n.º 5
0
 public Boolean AnularDB(imp_Embarcador_Info Info)
 {
     try
     {
         return(oDat.AnularDB(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("", "AnularDB", ex.Message), ex)
               {
                   EntityType = typeof(imp_DatosEmbarque_bus)
               };
     }
 }
Exemplo n.º 6
0
        public List <imp_Embarcador_Info> Get_List_Embarcador()
        {
            List <imp_Embarcador_Info> lst  = new List <imp_Embarcador_Info>();
            EntitiesImportacion        oEnt = new EntitiesImportacion();

            try
            {
                var select = from q in oEnt.imp_Embarcador
                             select q;
                foreach (var item in select)
                {
                    imp_Embarcador_Info info = new imp_Embarcador_Info();
                    info.IdEmpresa      = item.IdEmpresa;
                    info.IdEmbarcador   = item.IdEmbarcador;
                    info.em_descripcion = item.em_descripcion.Trim();;
                    info.em_direccion   = item.em_direccion;
                    info.em_telefono    = item.em_telefono;
                    info.em_contacto    = item.em_contacto;
                    info.em_email       = item.em_email;
                    info.Estado         = item.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());
            }
        }