Exemple #1
0
        public ActionResult Crear()
        {
            cierreBLL         = new CierreBLLImp();
            productoCierreBLL = new CierreProductoBLLImp();
            string idMedidasString = fb.ConsecutivoModifica("CIR");
            Cierre cierre          = new Cierre()
            {
                idCierre        = idMedidasString,
                fecha           = DateTime.Now,
                usuario         = Session["usuario"].ToString(),
                idNombreEmpresa = Session["empresa"].ToString()
            };
            bool a = cierreBLL.Agregar(cierre);
            bool b = productoCierreBLL.Crear(Session["empresa"].ToString(), idMedidasString);

            return(Json(new { result = a, result2 = b }, JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public ActionResult Tabla()
        {
            cierreBLL = new CierreBLLImp();
            List <Cierre> resultado = cierreBLL.BuscarTodos(Session["empresa"].ToString());
            String        htmlCode  = String.Empty;

            foreach (Cierre per in resultado)
            {
                htmlCode += "<tr>" +
                            "<td>" + per.idCierre + "</td>" +
                            "<td>" + per.fecha.Value.ToString("MM/dd/yyyy") + "</td>" +
                            "<td>" + per.usuario + "</td>" +
                            "<td class=\"text - right\" > " +
                            "<a href=\"#\" class=\"btn btn-simple btn-info btn-icon\" data-toggle=\"modal\" data-target=\"#myModal\" onclick=\"cargarTabla('" + per.idCierre + "')\"><i class=\"fa fa-shopping-basket\" ></i></a>" +
                            "</td>" +
                            "<tr>";
            }
            return(Json(new { result = htmlCode }, JsonRequestBehavior.AllowGet));
        }