public Boolean Guardar(tb_sis_Mensajes_sys_Info Info)
        {
            try
            {
                EntitiesGeneral context = new EntitiesGeneral();
                var             sms     = new tb_sis_Mensajes_sys();

                sms.IdMensaje       = Info.IdMensaje;
                sms.Mensaje_Esp     = Info.Mensaje_Esp;
                sms.Mensaje_Englesh = Info.Mensaje_Englesh;
                sms.Estado          = Info.Estado;
                context.tb_sis_Mensajes_sys.Add(sms);
                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());
            }
        }
        public List <tb_sis_Mensajes_sys_Info> Get_List_Mensajes_sys()
        {
            try
            {
                List <tb_sis_Mensajes_sys_Info> lst = new List <tb_sis_Mensajes_sys_Info>();

                EntitiesGeneral oEnti = new EntitiesGeneral();

                var tarjetas = from q in oEnti.tb_sis_Mensajes_sys
                               select q;

                foreach (var item in tarjetas)
                {
                    tb_sis_Mensajes_sys_Info info = new tb_sis_Mensajes_sys_Info();
                    info.IdMensaje       = item.IdMensaje;
                    info.Mensaje_Esp     = item.Mensaje_Esp;
                    info.Mensaje_Englesh = item.Mensaje_Englesh;
                    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());
            }
        }
示例#3
0
        public Boolean CompararEnum_vs_DB()
        {
            try
            {
                List <tb_sis_Mensajes_sys_Info> ListInfo = new List <tb_sis_Mensajes_sys_Info>();
                tb_sis_Mensajes_sys_Bus         BusMsj   = new tb_sis_Mensajes_sys_Bus();

                ListInfo = BusMsj.Get_List_sis_Mensajes_sys();

                foreach (var item_enum_msg in Enum.GetNames(typeof(enum_Mensajes_sys)))
                {
                    var Existe = ListInfo.FirstOrDefault(v => v.IdMensaje == item_enum_msg);

                    if (Existe == null)//no existe en base hay q insertarlo
                    {
                        tb_sis_Mensajes_sys_Info InfoMsg_a_Guardar = new tb_sis_Mensajes_sys_Info();

                        InfoMsg_a_Guardar.IdMensaje       = item_enum_msg;
                        InfoMsg_a_Guardar.Mensaje_Esp     = item_enum_msg;
                        InfoMsg_a_Guardar.Mensaje_Englesh = "";
                        InfoMsg_a_Guardar.Estado          = "A";
                        BusMsj.GuardarDB(InfoMsg_a_Guardar);
                    }
                }
                return(true);
            }
            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(tb_sis_Mensajes_sys_Bus)
                      };
            }
        }
示例#4
0
 public string Get_Mensaje_sys(enum_Mensajes_sys IdMensaje)
 {
     try
     {
         tb_sis_Mensajes_sys_Info InfoMensaje = listaMensaje.FirstOrDefault(v => v.IdMensaje == IdMensaje.ToString());
         return(InfoMensaje.Mensaje_Esp);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
示例#5
0
 public Boolean GuardarDB(tb_sis_Mensajes_sys_Info Info)
 {
     try
     {
         return(CD.Guardar(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(tb_sis_Mensajes_sys_Bus)
               };
     }
 }
        void LimpiarDatos()
        {
            try
            {
                _Accion          = Cl_Enumeradores.eTipo_action.grabar;
                _Info            = new tb_sis_Mensajes_sys_Info();
                txtMensajeI.Text = "";
                cmbMensaje.Text  = "";
                txtId.Text       = "";

                cbxEstado.Checked = true;
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }