示例#1
0
 public Boolean AnularDB(imp_catalogo_Info info)
 {
     try
     {
         using (EntitiesImportacion context = new EntitiesImportacion())
         {
             var contact = context.imp_catalogo.FirstOrDefault(catalogo => catalogo.IdCatalogoImport == info.IdCatalogoImport && catalogo.IdCatalogoImport_tipo == info.IdCatalogoImport_tipo);
             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());
     }
 }
示例#2
0
        private void llamar_formulario_catalogo(Cl_Enumeradores.eTipo_action Accion)
        {
            try
            {
                imp_catalogo_Info row = new imp_catalogo_Info();
                row.IdCatalogo_tipo = listBoxControl_catalogo_tipo.SelectedValue == null ? 0 : Convert.ToInt32(listBoxControl_catalogo_tipo.SelectedValue);

                if (Accion != Cl_Enumeradores.eTipo_action.grabar)
                {
                    row = (imp_catalogo_Info)gridView_catalogo.GetFocusedRow();
                    if (row == null)
                    {
                        MessageBox.Show("Seleccione un registro", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                    if (!row.estado)
                    {
                        MessageBox.Show("El registro seleccionado se encuentra anulado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }
                }
                frmImp_catalogo_mant frm = new frmImp_catalogo_mant();
                frm.set_accion(Accion);
                frm.set_info(row);
                frm.ShowDialog();
                load_data_catalogo();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#3
0
        public bool guardarDB(imp_catalogo_Info info)
        {
            try
            {
                using (Entities_importacion Context = new Entities_importacion())
                {
                    imp_catalogo Entity = new imp_catalogo();
                    Entity.IdCatalogo_tipo = info.IdCatalogo_tipo;
                    Entity.IdCatalogo      = info.IdCatalogo = get_id();
                    Entity.ca_descripcion  = info.ca_descripcion;
                    Entity.estado          = info.estado = true;
                    Context.imp_catalogo.Add(Entity);
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
示例#4
0
        public bool anularDB(imp_catalogo_Info info)
        {
            try
            {
                using (Entities_importacion Context = new Entities_importacion())
                {
                    imp_catalogo Entity = Context.imp_catalogo.FirstOrDefault(q => q.IdCatalogo == info.IdCatalogo);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.estado = info.estado = false;
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
示例#5
0
 public imp_catalogo_Info get_info(int IdCatalogo_tipo, int IdCatalogo)
 {
     try
     {
         imp_catalogo_Info info = new imp_catalogo_Info();
         using (Entities_importacion Context = new Entities_importacion())
         {
             imp_catalogo Entity = Context.imp_catalogo.FirstOrDefault(q => q.IdCatalogo_tipo == IdCatalogo_tipo && q.IdCatalogo == IdCatalogo);
             if (Entity == null)
             {
                 return(null);
             }
             info = new imp_catalogo_Info
             {
                 IdCatalogo      = Entity.IdCatalogo,
                 IdCatalogo_tipo = Entity.IdCatalogo_tipo,
                 ca_descripcion  = Entity.ca_descripcion,
                 estado          = Entity.estado
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
 public void setTipo(imp_catalogo_Info inf)
 {
     try
     {
         this.txtIdCat.Text        = inf.IdCatalogoImport;
         this.txtCatTipo.Text      = inf.IdCatalogoImport_tipo.ToString();
         this.txtNombre.Text       = inf.Nombre;
         this.txtAbreviatura.Text  = inf.Abrebiatura;
         this.txtNombreIngles.Text = inf.NombreIngles;
         try
         {
             if (inf.Estado == "A")
             {
                 this.chbEstado.Checked = true;
             }
             else
             {
                 this.chbEstado.Checked = false;
             }
         }
         catch (Exception ex)
         {
             Log_Error_bus.Log_Error(ex.ToString());
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
     info = inf;
 }
 public ActionResult Modificar(imp_catalogo_Info model)
 {
     if (!bus_catalogo.modificarDB(model))
     {
         ViewBag.IdCatalogo_tipo = model.IdCatalogo_tipo;
         cargar_combos();
         return(View(model));
     }
     return(RedirectToAction("Index", new { IdCatalogo_tipo = model.IdCatalogo_tipo }));
 }
 public frmImp_catalogo_mant()
 {
     InitializeComponent();
     info_catalogo     = new imp_catalogo_Info();
     bus_catalogo      = new imp_catalogo_Bus();
     bus_catalogo_tipo = new imp_catalogo_tipo_Bus();
     lst_catalogo_tipo = new List <imp_catalogo_tipo_Info>();
     param             = cl_parametrosGenerales_Bus.Instance;
     Log_Error_bus     = new tb_sis_Log_Error_Vzen_Bus();
 }
 public bool anularDB(imp_catalogo_Info info)
 {
     try
     {
         return(odata.anularDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public ActionResult Nuevo(int IdCatalogo_tipo = 0)
        {
            imp_catalogo_Info model = new imp_catalogo_Info
            {
                IdCatalogo_tipo = IdCatalogo_tipo
            };

            ViewBag.IdCatalogo_tipo = IdCatalogo_tipo;
            cargar_combos();
            return(View(model));
        }
示例#11
0
 private void gridViewCatalogo_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     try
     {
         infoCata = GetSelectedRow((DevExpress.XtraGrid.Views.Grid.GridView)sender);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
 public void set_info(imp_catalogo_Info _info)
 {
     try
     {
         info_catalogo = _info;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public ActionResult Anular(int IdCatalogo_tipo = 0, int IdCatalogo = 0)
        {
            imp_catalogo_Info model = bus_catalogo.get_info(IdCatalogo_tipo, IdCatalogo_tipo);

            if (model == null)
            {
                return(RedirectToAction("Index", new { IdCatalogo_tipo = IdCatalogo_tipo }));
            }
            ViewBag.IdCatalogo_tipo = model.IdCatalogo_tipo;
            cargar_combos();
            return(View(model));
        }
 public bool anularDB(imp_catalogo_Info info)
 {
     try
     {
         return(odata.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_catalogo_Bus)
               };
     }
 }
示例#15
0
 public Boolean GrabarDB(imp_catalogo_Info inf, ref string Mensaje)
 {
     try
     {
         return(oDat.GrabarDB(inf, ref Mensaje));
     }
     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("", "Grabar", ex.Message), ex)
               {
                   EntityType = typeof(imp_catalogo_Bus)
               };
     }
 }
示例#16
0
        public Boolean GrabarDB(imp_catalogo_Info info, ref string Mensaje)
        {
            try
            {
                using (EntitiesImportacion context = new EntitiesImportacion())
                {
                    EntitiesImportacion EDB = new EntitiesImportacion();
                    var Q = (from per in EDB.imp_catalogo
                             select per.Orden).Max() + 1;


                    if ((from per in EDB.imp_catalogo where per.IdCatalogoImport == info.IdCatalogoImport select per).Count() != 0)
                    {
                        Mensaje = "El Codigo Ingresado Ya existe por favor ingrese uno distinto";
                        return(false);
                    }
                    var address = new imp_catalogo();
                    address.IdCatalogoImport      = info.IdCatalogoImport;
                    address.IdCatalogoImport_tipo = info.IdCatalogoImport_tipo;
                    address.Nombre       = info.Nombre;
                    address.NombreIngles = info.NombreIngles;
                    address.Abrebiatura  = info.Abrebiatura;
                    address.Orden        = Q;
                    address.Estado       = "A";

                    context.imp_catalogo.Add(address);
                    context.SaveChanges();
                    Mensaje = "Registro Ingresado Correctamente";
                }
                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;

                Mensaje = "Error al ingresar el registro ";
                throw new Exception(ex.ToString());
            }
        }
示例#17
0
 private void gridView_catalogo_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
 {
     try
     {
         imp_catalogo_Info row = (imp_catalogo_Info)gridView_catalogo.GetRow(e.RowHandle);
         if (row == null)
         {
             return;
         }
         if (!row.estado)
         {
             e.Appearance.ForeColor = Color.Red;
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#18
0
        public bool anularDB(imp_catalogo_Info info)
        {
            try
            {
                using (Entities_importacion Context = new Entities_importacion())
                {
                    imp_catalogo Entity = Context.imp_catalogo.FirstOrDefault(q => q.IdCatalogo_tipo == info.IdCatalogo_tipo && q.IdCatalogo == info.IdCatalogo);
                    if (Entity == null)
                    {
                        return(false);
                    }

                    Entity.estado = info.estado = false;
                    Context.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#19
0
        public List <imp_catalogo_Info> Get_List_catalogo()
        {
            List <imp_catalogo_Info> lista = new List <imp_catalogo_Info>();
            EntitiesImportacion      oEnt  = new EntitiesImportacion();

            try
            {
                var select = from q in oEnt.imp_catalogo
                             select q;

                foreach (var item in select)
                {
                    imp_catalogo_Info info = new imp_catalogo_Info();


                    info.IdCatalogoImport      = item.IdCatalogoImport.Trim();
                    info.IdCatalogoImport_tipo = item.IdCatalogoImport_tipo;
                    info.Nombre       = item.Nombre.Trim();
                    info.NombreIngles = item.NombreIngles;
                    info.Orden        = item.Orden;
                    info.Estado       = item.Estado;
                    info.Abrebiatura  = item.Abrebiatura;
                    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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
示例#20
0
 public bool guardarDB(imp_catalogo_Info info)
 {
     try
     {
         using (Entities_importacion Context = new Entities_importacion())
         {
             imp_catalogo Entity = new imp_catalogo
             {
                 IdCatalogo      = info.IdCatalogo = get_id(),
                 IdCatalogo_tipo = info.IdCatalogo_tipo,
                 ca_descripcion  = info.ca_descripcion,
                 estado          = info.estado = true
             };
             Context.imp_catalogo.Add(Entity);
             Context.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }