public ActionResult Index()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion

            ro_Parametros_Info model = bus_parametros.get_info(Convert.ToInt32(SessionFixed.IdEmpresa));
            if (model.IdEmpresa == 0)
            {
                model           = new ro_Parametros_Info();
                model.IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            }

            model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
            lst_cta_rubro.set_list_cta_rubros(model.lst_cta_x_rubros, model.IdTransaccionSession);
            lst_cta_rubro.set_list_sueldo_x_pagar(model.lst_cta_x_sueldo_pagar, model.IdTransaccionSession);
            cargar_combos();
            cargar_combos_detalle();
            return(View(model));
        }
        public ActionResult Nuevo(ro_SancionesPorMarcaciones_Info model)
        {
            var parametros = bus_parametro.get_info(model.IdEmpresa);

            if (parametros == null)
            {
                parametros = new ro_Parametros_Info();
            }
            model.detalle   = ro_SancionesPorMarcaciones_det_Info_list.get_list(model.IdTransaccionSession);
            model.IdUsuario = SessionFixed.IdUsuario;
            if (model.detalle == null || model.detalle.Count() == 0)
            {
                ViewBag.mensaje = "No existe detalle de marcaciones";
                cargar_combos(model.IdNomina_Tipo);
                return(View(model));
            }



            model.IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            //model.IdUsuario = SessionFixed.IdUsuario;
            if (!bus_sanciones.guardarDB(model))
            {
                cargar_combos(model.IdNomina_Tipo);
                return(View(model));
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult Nuevo(ro_NominasPagosCheques_Info model)
        {
            var parametros = bus_parametro.get_info(model.IdEmpresa);

            if (parametros == null)
            {
                parametros = new ro_Parametros_Info();
            }
            var tipo_op = bus_tipo_op.get_info(model.IdEmpresa, parametros.IdTipo_op_sueldo_por_pagar);

            model.detalle = ro_NominasPagosCheques_det_Info_list.get_list(model.IdTransaccionSession);
            if (tipo_op == null)
            {
                ViewBag.mensaje = "No existe parametros para las ordenes de pagos";
                cargar_combos(model.IdNomina_Tipo);
                return(View(model));
            }
            else
            {
                if (tipo_op.IdCtaCble == null)
                {
                    ViewBag.mensaje = "No existe cuenta contable en tipo de orden de pago";
                    cargar_combos(model.IdNomina_Tipo);
                    return(View(model));
                }
            }
            if (model.detalle == null || model.detalle.Count() == 0)
            {
                ViewBag.mensaje = "No existe detalle para el pago";
                cargar_combos(model.IdNomina_Tipo);
                return(View(model));
            }
            else
            {
                foreach (var item in model.detalle)
                {
                    if (item.IdCtaCble_Emplea == null || item.IdCtaCble_Emplea == "")
                    {
                        ViewBag.mensaje = "El empleado " + item.pe_nombreCompleto + " no tiene cuenta contable";
                        cargar_combos(model.IdNomina_Tipo);
                        return(View(model));
                    }
                }
            }



            model.IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            model.IdUsuario = SessionFixed.IdUsuario;
            if (!bus_archivo.guardarDB(model))
            {
                cargar_combos(model.IdNomina_Tipo);
                return(View(model));
            }

            return(RedirectToAction("Modificar", new { IdEmpresa = model.IdEmpresa, IdTransaccion = model.IdTransaccion, Exito = true }));
        }
Ejemplo n.º 4
0
        public ActionResult Index()
        {
            int IdEmpresa = Convert.ToInt32(Session["IdEmpresa"]);

            ro_Parametros_Info model = new ro_Parametros_Info();

            model = bus_parametros.get_info(IdEmpresa);

            model.lst_cta_x_rubros = new List <ro_Config_Param_contable_Info>();
            lst_cta_rubro.set_list_cta_rubros(model.lst_cta_x_rubros);
            cargar_combos();
            cargar_combos_detalle();
            return(View(model));
        }
 public ActionResult Index(ro_Parametros_Info model)
 {
     model.IdEmpresa              = Convert.ToInt32(Session["IdEmpresa"]);
     model.lst_cta_x_rubros       = lst_cta_rubro.get_list_cta_rubros();
     model.lst_cta_x_sueldo_pagar = lst_cta_rubro.get_list_sueldo_x_pagar();
     if (!bus_parametros.guardarDB(model))
     {
         cargar_combos();
         return(View(model));
     }
     else
     {
         bus_parametros = new ro_Parametros_Bus();
         model          = bus_parametros.get_info(Convert.ToInt32(SessionFixed.IdEmpresa));
         lst_cta_rubro.set_list_cta_rubros(model.lst_cta_x_rubros);
         lst_cta_rubro.set_list_sueldo_x_pagar(model.lst_cta_x_sueldo_pagar);
         cargar_combos();
         return(View(model));
     }
 }
        public ActionResult Index(ro_Parametros_Info model)
        {
            model.lst_cta_x_rubros       = lst_cta_rubro.get_list_cta_rubros(model.IdTransaccionSession);
            model.lst_cta_x_sueldo_pagar = lst_cta_rubro.get_list_sueldo_x_pagar(model.IdTransaccionSession);

            if (!bus_parametros.guardarDB(model))
            {
                SessionFixed.IdTransaccionSessionActual = model.IdTransaccionSession.ToString();
                cargar_combos();
                return(View(model));
            }
            else
            {
                bus_parametros             = new ro_Parametros_Bus();
                model                      = bus_parametros.get_info(Convert.ToInt32(SessionFixed.IdEmpresa));
                model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual);
                lst_cta_rubro.set_list_cta_rubros(model.lst_cta_x_rubros, model.IdTransaccionSession);
                lst_cta_rubro.set_list_sueldo_x_pagar(model.lst_cta_x_sueldo_pagar, model.IdTransaccionSession);
                cargar_combos();
                return(View(model));
            }
        }