Esempio n. 1
0
        private void ucGe_Menu_Mantenimiento_x_usuario1_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                info_tecnico = (man_tecnico_Info)gridView_tecnicos.GetFocusedRow();

                if (info_tecnico == null)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Seleccione_un_registro), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (!info_tecnico.estado)
                {
                    MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.El_registro_se_encuentra_anulado), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                llamar_formulario(Cl_Enumeradores.eTipo_action.actualizar);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Esempio n. 2
0
        public bool guardarDB(man_tecnico_Info info)
        {
            try
            {
                using (EntitiesMantenimiento Context = new EntitiesMantenimiento())
                {
                    man_tecnico Entity = new man_tecnico();
                    Entity.IdEmpresa      = info.IdEmpresa;
                    Entity.IdTecnico      = info.IdTecnico = get_id(info.IdEmpresa);
                    Entity.IdEmpleado     = info.IdEmpleado;
                    Entity.te_codigo      = info.te_codigo;
                    Entity.te_observacion = info.te_observacion;
                    Entity.estado         = true;
                    Context.man_tecnico.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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Esempio n. 3
0
        public bool anularDB(man_tecnico_Info info)
        {
            try
            {
                using (EntitiesMantenimiento Context = new EntitiesMantenimiento())
                {
                    man_tecnico Entity = Context.man_tecnico.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdTecnico == info.IdTecnico);
                    if (Entity != null)
                    {
                        Entity.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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Esempio n. 4
0
        public List <man_tecnico_Info> get_list(int IdEmpresa, bool mostrar_anulados)
        {
            try
            {
                List <man_tecnico_Info> Lista = new List <man_tecnico_Info>();

                using (EntitiesMantenimiento Context = new EntitiesMantenimiento())
                {
                    IQueryable <vwman_tecnico> lst;

                    if (mostrar_anulados)
                    {
                        lst = from q in Context.vwman_tecnico
                              where q.IdEmpresa == IdEmpresa
                              select q;
                    }
                    else
                    {
                        lst = from q in Context.vwman_tecnico
                              where q.IdEmpresa == IdEmpresa &&
                              q.estado == true
                              select q;
                    }

                    foreach (var item in lst)
                    {
                        man_tecnico_Info info = new man_tecnico_Info();
                        info.IdEmpresa      = item.IdEmpresa;
                        info.IdTecnico      = item.IdTecnico;
                        info.IdEmpleado     = item.IdEmpleado;
                        info.te_codigo      = item.te_codigo;
                        info.te_observacion = item.te_observacion;
                        info.estado         = item.estado;

                        info.pe_cedulaRuc      = item.pe_cedulaRuc;
                        info.pe_nombreCompleto = item.pe_nombreCompleto;
                        Lista.Add(info);
                    }
                }

                return(Lista);
            }
            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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Esempio n. 5
0
 public void set_info(man_tecnico_Info info)
 {
     try
     {
         info_tecnico = info;
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Esempio n. 6
0
 public bool anularDB(man_tecnico_Info info)
 {
     try
     {
         return(oData.anularDB(info));
     }
     catch (Exception ex)
     {
         string mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(mensaje);
     }
 }
Esempio n. 7
0
 private void gridView_tecnicos_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
 {
     try
     {
         man_tecnico_Info row = (man_tecnico_Info)gridView_tecnicos.GetRow(e.RowHandle);
         if (row == null)
         {
             return;
         }
         if (!row.estado)
         {
             e.Appearance.ForeColor = Color.Red;
         }
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Esempio n. 8
0
        private void limpiar()
        {
            try
            {
                info_tecnico = new man_tecnico_Info();

                txt_codigo.Text        = "";
                cmb_empleado.EditValue = null;
                txt_observacion.Text   = "";
                txt_IdTecnico.Text     = "";

                Accion = Cl_Enumeradores.eTipo_action.grabar;
                set_accion_in_controls();

                lbl_anulado.Visible = false;
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }