public ActionResult Search([Bind(Include = "TipoDocumento,Serie,Correlativo,FechaInicial,FechaFinal")] FilterDoc filter) { if (Session[HomeController.IdUser] == null) { return(RedirectToAction("", "Home")); } var idUser = Session[HomeController.IdUser].ToString(); var filters = new Dictionary <string, string>(); if (filter.TipoDocumento > 0) { filters.Add("i_IdTipoDocumento", filter.TipoDocumento.ToString()); } if (!string.IsNullOrEmpty(filter.Serie)) { filters.Add("v_SerieDocumento", $"'{filter.Serie}'"); } if (!string.IsNullOrEmpty(filter.Correlativo)) { filters.Add("v_CorrelativoDocumento", $"'{filter.Correlativo}'"); } var bl = new VentaBl(); var items = bl.SearchVentas(idUser, filter.FechaInicial, filter.FechaFinal, filters); if (!bl.LastResult.Success) { return(HttpNotFound(bl.LastResult.ErrorMessage)); } return(View(items)); }
// GET: Panel public ActionResult Index() { if (Session[HomeController.IdUser] == null) { return(RedirectToAction("", "Home")); } var idUser = Session[HomeController.IdUser].ToString(); var vbl = new VentaBl(); //var cbl = new ClienteBl(); //ViewBag.Cliente = cbl.GetClient(idUser); var items = vbl.SearchVentas(idUser, DateTime.Now.Date, DateTime.Now.Date, null); return(View(items)); }
public ActionResult LoginDoc([Bind(Include = "TipoDocumento,Serie, Correlativo, FechaEmision, Total")] VentaCredencial factura) { if (ModelState.IsValid) { var idVenta = new VentaBl() .GetIdVenta((int)factura.TipoDocumento, factura.Serie, factura.Correlativo, factura.FechaEmision, factura.Total); if (idVenta != null) { Session[IdDoc] = idVenta; return(RedirectToAction("OneDocument", "Panel")); } ViewBag.NoValid = true; } return(View()); }
public ActionResult OneDocument() { var idVenta = Session[HomeController.IdDoc]; if (idVenta == null) { return(RedirectToAction("Index", "Home")); } var vbl = new VentaBl(); var v = vbl.GetVenta(idVenta.ToString()); if (!vbl.LastResult.Success) { return(HttpNotFound("Error de Conexion")); } return(View(v)); }
public VentasController() { _ventaBl = new VentaBl(); }