Ejemplo n.º 1
0
        public JsonResult agregar_fase(Fase_Tiempo fase)
        {
            var    t          = fase;
            string validacion = "fail";
            Fecha  fecha      = new Fecha();

            Fase_Tiempo fase_tiempo = new Fase_Tiempo();

            fase_tiempo.DESCRIPCION      = t.DESCRIPCION;
            fase_tiempo.TIEMPO           = t.TIEMPO;
            fase_tiempo.FECHA_CREACION   = fecha.fecha();
            fase_tiempo.USUARIO_CREACION = (string)(Session["User"]);
            fase_tiempo.FK_ID_PROYECTO   = t.FK_ID_PROYECTO;

            int result = dao_fase.AgregarFase_Tiempo(fase_tiempo);

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(Json(validacion, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public string agregar_fases(List <Fase_Tiempo> fases, int id_proyecto, string user)
        {
            if (fases == null)
            {
                return("sucess");
            }

            string validacion = "fail";
            Fecha  fecha      = new Fecha();
            string date       = fecha.fecha();
            int    result     = 0;

            foreach (Fase_Tiempo dato in fases)
            {
                result = dao_fase.AgregarFase_Tiempo(dato, id_proyecto, user, date);
            }

            if (result == 1)
            {
                validacion = "sucess";
            }
            return(validacion);
        }