Example #1
0
 public Boolean ModificarDB(ct_GrupoEmpresarial_Info info)
 {
     try
     {
         using (EntitiesDBConta context = new EntitiesDBConta())
         {
             var contact = context.ct_GrupoEmpresarial.FirstOrDefault(minfo => minfo.IdGrupoEmpresarial == info.IdGrupoEmpresarial);
             if (contact != null)
             {
                 contact.GrupoEmpresarial = info.GrupoEmpresarial;
                 contact.Estado           = info.Estado;
                 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());
     }
 }
Example #2
0
 public List <ct_GrupoEmpresarial_Info> Get_list_GrupoEmpresarial()
 {
     try
     {
         List <ct_GrupoEmpresarial_Info> Lst = new List <ct_GrupoEmpresarial_Info>();
         EntitiesDBConta oEnti = new EntitiesDBConta();
         var             Query = from q in oEnti.ct_GrupoEmpresarial
                                 select q;
         foreach (var item in Query)
         {
             ct_GrupoEmpresarial_Info Obj = new ct_GrupoEmpresarial_Info();
             Obj.IdGrupoEmpresarial = item.IdGrupoEmpresarial;
             Obj.GrupoEmpresarial   = item.GrupoEmpresarial;
             Obj.Estado             = item.Estado;
             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());
     }
 }
Example #3
0
        public Boolean GrabarDB(ct_GrupoEmpresarial_Info Info)
        {
            try
            {
                List <ct_GrupoEmpresarial_Info> Lst = new List <ct_GrupoEmpresarial_Info>();
                using (EntitiesDBConta Context = new EntitiesDBConta())
                {
                    var Address = new ct_GrupoEmpresarial();

                    Address.IdGrupoEmpresarial = Info.IdGrupoEmpresarial;
                    Address.GrupoEmpresarial   = Info.GrupoEmpresarial;
                    Address.Estado             = Info.Estado;


                    Context.ct_GrupoEmpresarial.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());
            }
        }
Example #4
0
 private void UltraGrid_GrupoEmp_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         GrupoE_I = (ct_GrupoEmpresarial_Info)UltraGrid_GrupoEmp.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #5
0
        public void set_Info(ct_GrupoEmpresarial_Info _info)
        {
            try
            {
                txt_GrupoEmpresarial.Text = _info.GrupoEmpresarial;
                txt_IdGrupoEmpre.Text     = _info.IdGrupoEmpresarial;
                this.chk_estado.Checked   = (_info.Estado == "I") ? false : true;

                Info = _info;
            }
            catch (Exception ex)
            { Log_Error_bus.Log_Error(ex.ToString());
              MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
 public Boolean AnularDB(ct_GrupoEmpresarial_Info info)
 {
     try
     {
         return(data.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(ct_GrupoEmpresarial_Bus)
               };
     }
 }
Example #7
0
 void LimpiarDatos()
 {
     try
     {
         _Accion = Cl_Enumeradores.eTipo_action.grabar;
         Info    = new ct_GrupoEmpresarial_Info();
         txt_GrupoEmpresarial.Text = "";
         txt_IdGrupoEmpre.Text     = "";
         chk_estado.Checked        = true;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }