コード例 #1
0
        public ActionResult Inicio()
        {
            EmpresaController emp = new EmpresaController();

            ViewBag.ApplicationActive  = true;
            ViewBag.ReferenciaInicio   = ModuleControlRetorno() + "/Oficio/Inicio";
            ViewBag.ReferenciaHome     = ModuleControlRetorno() + "/App/Inicio";
            ViewBag.ReferenciaRegistro = ModuleControlRetorno() + "/Auth/RegistroUsuario";
            ViewBag.ReferenciaOficio   = ModuleControlRetorno() + "/Oficios/Inicio";

            if (Session["IdUser"] != null && Session["IdUser"].ToString() != "")
            {
                ViewBag.ReferenciaIdUser = Session["IdUser"].ToString();
            }

            if (Session["UserName"] != null && Session["UserName"].ToString() != "")
            {
                ViewBag.ReferenciaUserName = Session["UserName"].ToString();
            }

            if (Session["UserType"] != null && Session["UserType"].ToString() != "")
            {
                ViewBag.ReferenciaUserType = Session["UserType"].ToString();
            }

            ViewBag.ReferenciaComuna          = GetComuna("");
            ViewBag.ReferenciaOficios         = GetOficios();
            ViewBag.referenciaUsuariosOficios = emp.GetUsuariosConOficio("1");
            return(View());
        }
コード例 #2
0
        public List <PlanesEmpresa> GetPlanSeleccionado(string idEmpresa = "", string idplan = "")
        {
            EmpresaController emp     = new EmpresaController();
            string            code    = string.Empty;
            string            mensaje = string.Empty;

            string[] parametros = new string[2];
            string[] valores    = new string[2];
            parametros[0] = "@IDL_EMPRESA";
            parametros[1] = "@ID_PLAN";
            valores[0]    = idEmpresa;
            valores[1]    = idplan;
            List <PlanesEmpresa> clDetallePlanEmpresa = new List <PlanesEmpresa>();
            DataSet data = new DataSet();

            try
            {
                data = svcEmpleos.GetPlanSeleccionadoEmpresa(parametros, valores).Table;
                foreach (DataRow rows in data.Tables[0].Rows)
                {
                    switch (rows["Code"].ToString())
                    {
                    case "200":
                        clDetallePlanEmpresa.Add(
                            new PlanesEmpresa
                        {
                            idPlan      = rows["IdPlan"].ToString(),
                            NombrePlan  = rows["NombrePlan"].ToString(),
                            PrecioPlan  = rows["Precio"].ToString(),
                            detallePlan = emp.GetDetallePlanes(rows["IdPlan"].ToString())
                        });

                        mensaje = "";
                        break;

                    case "400":
                        code    = rows["Code"].ToString();
                        mensaje = rows["Message"].ToString();
                        break;

                    case "500":
                        code    = rows["Code"].ToString();
                        mensaje = rows["Message"].ToString();
                        break;

                    default:
                        code    = "600";
                        mensaje = errorSistema;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                code    = "600";
                mensaje = errorSistema;
            }
            return(clDetallePlanEmpresa);
        }
コード例 #3
0
        // GET: Pagos
        public ActionResult Index(string idPlan)
        {
            var idEmpresa             = Session["EmpresaID"].ToString();
            EmpresaController empresa = new EmpresaController();

            ViewBag.Planes = empresa.GetPlanes("");
            ViewBag.referenciaPlanSeleccionado = GetPlanSeleccionado(idEmpresa, idPlan);
            ViewBag.referenciaPlanEmpresa      = empresa.GetPlanesContratadosEmpresa(idEmpresa);
            ViewBag.referenciaTarjetaEmpresa   = empresa.GetTarjetasEmpresa(idEmpresa);
            ViewBag.idPlan         = idPlan;
            ViewBag.idPlanAnterior = empresa.GetPlanAnteriorEmpresa(idEmpresa);
            return(View());
        }
コード例 #4
0
        public List <CandidatoUsuarioOficios> GetOficiosUsuarioFiltro(string hiddenNombreOficioB1, string hiddenOficioB1)
        {
            string code    = string.Empty;
            string mensaje = string.Empty;

            string[] parametros = new string[2];
            string[] valores    = new string[2];
            DataSet  datas      = new DataSet();
            List <CandidatoUsuarioOficios> clUsuariosOficios = new List <CandidatoUsuarioOficios>();
            EmpresaController emp = new EmpresaController();

            try
            {
                parametros[0] = "@NOMBRE_OFICIO";
                parametros[1] = "@OFICIO";
                valores[0]    = hiddenNombreOficioB1;
                valores[1]    = hiddenOficioB1;

                datas = svcEmpleosChile.GetOficiosUsuarioFiltro(parametros, valores).Table; // GetCandidatosEmpresa

                foreach (DataRow rows in datas.Tables[0].Rows)
                {
                    switch (rows["Code"].ToString())
                    {
                    case "200":
                        clUsuariosOficios.Add(
                            new CandidatoUsuarioOficios
                        {
                            IdUsuario        = rows["IdUsuario"].ToString(),
                            ApellidosUsuario = rows["ApellidosUsuario"].ToString(),
                            NombreUsuario    = rows["NombreUsuario"].ToString(),
                            RutUsuario       = rows["RutUsuario"].ToString(),
                            TagOficios       = emp.GetOficiosUsuario(rows["IdUsuario"].ToString())
                        });

                        mensaje = "";
                        break;

                    case "400":
                        code    = rows["Code"].ToString();
                        mensaje = rows["Message"].ToString();
                        break;

                    case "500":
                        code    = rows["Code"].ToString();
                        mensaje = rows["Message"].ToString();
                        break;

                    default:
                        code    = "600";
                        mensaje = errorSistema;
                        break;
                    }
                }
            }
            catch (Exception)
            {
                code    = "600";
                mensaje = errorSistema;
            }
            return(clUsuariosOficios);
        }