/* This method will do a Give out of products * this method contain the client business and */ public ActionResult DarSaida(OutPut outPut) { OutPutDao dao = OutPutDao.getInstance(); bool able = false; if (outPut != null) { dao.add(outPut); able = true; } return(Json(able)); }
/* This method will do a Give out of products * this method contain the client business and */ public ActionResult ProcessAddOutPut(int companyId, DateTime date) { OutPutDao dao = OutPutDao.getInstance(); Company company = CompanyDao.getInstance().getById(companyId); OutPut outPut = new OutPut(); outPut.Company = company; outPut.Date = date; // if ((outPut != null) && (dao.getOutPutByDate(date) == null)) if ((Session["outPut"] == null) && (outPut != null)) { dao.add(outPut); Session["outPut"] = dao.getOutPutByDate(date); } outPut = (OutPut)Session["outPut"]; List <Product> products = ProductDao.GetInstance().ListAll(); Object[] obj = new Object[2] { outPut, products }; return(View(obj)); }