コード例 #1
0
        public void Get()
        {
            try
            {
                if (lista_empleado_por_zonas.Where(v => v.check == true).Count() == 0)
                {
                    MessageBox.Show("No existe ningun empleado seleccionado", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    info = new ro_empleado_x_rutas_asignadas_Info();

                    info.IdEmpleado    = lista_empleado_por_zonas.Where(v => v.check == true).FirstOrDefault().IdEmpleado;
                    info.IdEmpresa     = param.IdEmpresa;
                    info.IdNomina_Tipo = Get_idemNomina(info.IdEmpleado);
                    info.detalle       = lista_zonas_x_empleados.ToList();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        public bool Guardar_DB(ro_empleado_x_rutas_asignadas_Info info)
        {
            bool bandera = true;

            try
            {
                if (data.Guardar_DB(info))
                {
                    foreach (var item in info.detalle)
                    {
                        item.IdEmpresa     = info.IdEmpresa;
                        item.IdNomina_Tipo = info.IdNomina_Tipo;
                        item.IdEmpleado    = info.IdEmpleado;
                    }
                    bandera = data_detalle.Guardar_DB(info.detalle);
                }

                return(bandera);
            }
            catch (Exception ex)
            {
                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);
            }
        }
コード例 #3
0
        private void gridView_Empleados_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            try
            {
                if (e.HitInfo.Column.Name == "check")
                {
                    gridView_Empleados.SetFocusedRowCellValue(Colicono_eliminar, true);
                    if ((bool)gridView_Empleados.GetFocusedRowCellValue(Col_check))
                    {
                        gridView_Empleados.SetFocusedRowCellValue(Col_check, false);
                    }
                }
                if (e.HitInfo.Column.Name == "Colicono_eliminar")
                {
                    DialogResult dialogResult = MessageBox.Show("¿Esta seguro de querer eliminar el registro?", param.Nombre_sistema, MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        info = (ro_empleado_x_rutas_asignadas_Info)gridView_Empleados.GetFocusedRow();
                        gridView_Empleados.DeleteSelectedRows();

                        bus_empleado_x_zona.Anular_DB(info);
                    }
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
 public bool Guardar_DB(ro_empleado_x_rutas_asignadas_Info info)
 {
     try
     {
         if (!si_Existe(info.IdEmpresa, info.IdNomina_Tipo, info.IdEmpleado))
         {
             using (EntityRoles_FJ db = new EntityRoles_FJ())
             {
                 ro_empleado_x_rutas_asignadas add = new ro_empleado_x_rutas_asignadas();
                 add.IdEmpresa         = info.IdEmpresa;
                 add.IdNomina_Tipo     = info.IdNomina_Tipo;;
                 add.IdEmpleado        = info.IdEmpleado;
                 add.IdUsuario         = info.IdUsuario;
                 add.Fecha_Transaccion = DateTime.Now;
                 add.Estado            = true;
                 db.ro_empleado_x_rutas_asignadas.Add(add);
                 db.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 MensajeError);
         MensajeError = ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
コード例 #5
0
 public bool Anular_DB(ro_empleado_x_rutas_asignadas_Info info)
 {
     try
     {
         return(data.Anular_DB(info));
     }
     catch (Exception ex)
     {
         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);
     }
 }
コード例 #6
0
        private void repositoryItemCheckEdit1_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
        {
            try
            {
                gridView_Empleados.SetFocusedRowCellValue(Colicono_eliminar, true);
                foreach (var item in lista_empleado_por_zonas)
                {
                    item.check = false;
                }
                info = (ro_empleado_x_rutas_asignadas_Info)gridView_Empleados.GetFocusedRow();
                lista_zonas_x_empleados = new BindingList <ro_empleado_x_rutas_asignadas_Det_Info>(bus_zonas_x_empleados.lista_paramatrso_x_empleados(info.IdEmpresa, info.IdNomina_Tipo, Convert.ToInt32(info.IdEmpleado)));
                gridControl_parametros_variables.DataSource = lista_zonas_x_empleados;
                gridControl_Empleados.RefreshDataSource();
            }

            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #7
0
        public bool Anular_DB(ro_empleado_x_rutas_asignadas_Info info)
        {
            try
            {
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_empleado_x_rutas_asignadas_Det where IdEmpresa='" + info.IdEmpresa + "' and IdNomina_Tipo= '" + info.IdNomina_Tipo + "' and IdEmpleado='" + info.IdEmpleado + "'");

                    db.Database.ExecuteSqlCommand("delete Fj_servindustrias.ro_empleado_x_rutas_asignadas where IdEmpresa='" + info.IdEmpresa + "' and IdNomina_Tipo= '" + info.IdNomina_Tipo + "' and IdEmpleado='" + info.IdEmpleado + "'");
                    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 MensajeError);
                MensajeError = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
コード例 #8
0
        public List <ro_empleado_x_rutas_asignadas_Info> listado_empleado_x_parametro_variables(int IdEmpresa)
        {
            try
            {
                List <ro_empleado_x_rutas_asignadas_Info> lista = new List <ro_empleado_x_rutas_asignadas_Info>();
                using (EntityRoles_FJ db = new EntityRoles_FJ())
                {
                    var query = from q in db.ro_empleado_x_rutas_asignadas
                                where
                                q.IdEmpresa == IdEmpresa
                                select q;

                    foreach (var item in query)
                    {
                        ro_empleado_x_rutas_asignadas_Info info = new ro_empleado_x_rutas_asignadas_Info();

                        info.IdEmpresa      = item.IdEmpresa;
                        info.IdNomina_Tipo  = item.IdNomina_Tipo;;
                        info.IdEmpleado     = item.IdEmpleado;
                        info.icono_eliminar = true;
                        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 MensajeError);
                MensajeError = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }