Exemple #1
0
        public List <com_CatalogoTipo_Info> Get_List_CatalogoTipo()
        {
            try
            {
                List <com_CatalogoTipo_Info> lista = new List <com_CatalogoTipo_Info>();

                EntitiesCompras oEnt = new EntitiesCompras();

                var select = from q in oEnt.com_catalogo_tipo
                             select q;

                foreach (var item in select)
                {
                    com_CatalogoTipo_Info info = new com_CatalogoTipo_Info();
                    info.IdCatalogocompra_tipo = item.IdCatalogocompra_tipo;
                    info.Descripcion           = item.Descripcion;
                    lista.Add(info);
                }
                return(lista);
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #2
0
        public com_CatalogoTipo_Info Get_Info_CatalogoTipo(string id)
        {
            try
            {
                EntitiesCompras       context = new EntitiesCompras();
                com_CatalogoTipo_Info Info    = new com_CatalogoTipo_Info();

                var contenido = context.com_catalogo_tipo.FirstOrDefault(var => var.IdCatalogocompra_tipo == id);
                if (contenido != null)
                {
                    Info.IdCatalogocompra_tipo = contenido.IdCatalogocompra_tipo;
                    Info.Descripcion           = contenido.Descripcion;
                    Info.Estado = contenido.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemple #3
0
        public Boolean GuardarDB(com_CatalogoTipo_Info Info)
        {
            try
            {
                using (EntitiesCompras Context = new EntitiesCompras())
                {
                    var Address = new com_catalogo_tipo();

                    Address.IdCatalogocompra_tipo = Info.IdCatalogocompra_tipo;
                    Address.Descripcion           = Info.Descripcion;
                    Address.Estado = Info.Estado;
                    Context.com_catalogo_tipo.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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #4
0
        public bool ModificarDB(com_CatalogoTipo_Info info)
        {
            try
            {
                EntitiesCompras context = new EntitiesCompras();

                var contenido = context.com_catalogo_tipo.FirstOrDefault(var => var.IdCatalogocompra_tipo == info.IdCatalogocompra_tipo);
                if (contenido != null)
                {
                    contenido.Descripcion = info.Descripcion;
                    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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #5
0
        private void btnModificar_c_Click(object sender, EventArgs e)
        {
            try
            {
                //string cod = (string)lstbox_TipoCatalogo.SelectedValue;
                com_CatalogoTipo_Info cod  = (com_CatalogoTipo_Info)this.lstbox_TipoCatalogo.SelectedValue;
                com_CatalogoTipo_Info Info = (com_CatalogoTipo_Info)CatalogoTipoBus.Get_Info_CatalogoTipo(cod.IdCatalogocompra_tipo);

                if (Info == null)
                {
                    MessageBox.Show("No Existe el Tipo de Catálogo", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    FrmCom_CatalogoTipo_Mantenimiento frmCataTipoMant = new FrmCom_CatalogoTipo_Mantenimiento();
                    frmCataTipoMant.setAccion(Cl_Enumeradores.eTipo_action.actualizar);
                    frmCataTipoMant.Set(Info);
                    frmCataTipoMant.Event_FrmCom_CatalogoTipo_Mantenimiento_FormClosing += new FrmCom_CatalogoTipo_Mantenimiento.delegate_FrmCom_CatalogoTipo_Mantenimiento_FormClosing(FrmCom_CatalogoTipo_Mantenimiento_FormClosing);
                    frmCataTipoMant.Show();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemple #6
0
 public Boolean GuardarDB(com_CatalogoTipo_Info info)
 {
     try { return(cd.GuardarDB(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("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(com_CatalogoTipo_Bus)
               };
     }
 }
 public void Set(com_CatalogoTipo_Info _SetInfo)
 {
     try
     {
         txtDescripcion.Text = _SetInfo.Descripcion;
         txtId.Text          = _SetInfo.IdCatalogocompra_tipo;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #8
0
 void FrmCataMant_Event_FrmCom_Catalogo_Mantenimiento_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         com_CatalogoTipo_Info cod = (com_CatalogoTipo_Info)this.lstbox_TipoCatalogo.SelectedValue;
         gridControlCatalogo.DataSource = CatalogoBus.Get_IdTipoLista(Convert.ToString(cod.IdCatalogocompra_tipo));
         gridControlCatalogo.RefreshDataSource();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #9
0
 private void lstbox_TipoCatalogo_SelectedIndexChanged_1(object sender, EventArgs e)
 {
     try
     {
         com_CatalogoTipo_Info cod = (com_CatalogoTipo_Info)this.lstbox_TipoCatalogo.SelectedValue;
         CatalogoInfo = new BindingList <com_Catalogo_Info>(CatalogoBus.Get_IdTipoLista(Convert.ToString(cod.IdCatalogocompra_tipo)));
         gridControlCatalogo.DataSource = CatalogoInfo;
         gridControlCatalogo.RefreshDataSource();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }