//public JsonResult TallasProducto(string Cod_Prod) //{ // var bussingLogic = new GestionPlanilla.BusinessLogic.BLProducto(); // var response = bussingLogic.TallasProducto(Cod_Prod); // var result = new Response<IEnumerable<Tallas>>(response.Data.Where(x => x.Cantidad > 0)); // return Json(result); //} //public JsonResult TallasVenta(string Cod_Venta) //{ // var bussingLogic = new GestionPlanilla.BusinessLogic.BLVentas(); // var response = bussingLogic.TallasVenta(Cod_Venta); // return Json(response); //} public JsonResult DeleteVentas(Ventas obj) { var bussingLogic = new GP.BusinessLogic.BLVentas(); obj.Auditoria = new Auditoria { UsuarioModificacion = User.Identity.Name }; var response = bussingLogic.DeleteVentas(obj); return(Json(response)); }
public JsonResult GetAllVentas(Ventas obj) { try { Session["ReporteVenta"] = null; var bussingLogic = new GP.BusinessLogic.BLVentas(); var response = bussingLogic.GetAllVentas(obj); Session["ReporteVenta"] = response.Data.ToList(); return(Json(response)); } catch (Exception ex) { var result = new Response <List <GP.Entities.Ventas> >(ex); return(Json(result)); } }
public JsonResult GetVentas(Ventas obj) { try { var ctx = HttpContext.GetOwinContext(); var tipoUsuario = ctx.Authentication.User.Claims.FirstOrDefault().Value; string draw = Request.Form.GetValues("draw")[0]; int inicio = Convert.ToInt32(Request.Form.GetValues("start").FirstOrDefault()); int fin = Convert.ToInt32(Request.Form.GetValues("length").FirstOrDefault()); obj.Auditoria = new Auditoria { TipoUsuario = tipoUsuario }; obj.Operacion = new Operacion { Inicio = (inicio / fin), Fin = fin }; var bussingLogic = new GP.BusinessLogic.BLVentas(); var response = bussingLogic.GetVentas(obj); var Datos = response.Data; int totalRecords = Datos.Any() ? Datos.FirstOrDefault().Operacion.TotalRows : 0; int recFilter = totalRecords; var result = (new { draw = Convert.ToInt32(draw), recordsTotal = totalRecords, recordsFiltered = recFilter, data = Datos }); return(Json(result)); } catch (Exception ex) { return(Json(ConfigurationUtilities.ErrorCatchDataTable(ex))); } }
public JsonResult InsertUpdateVentas(Ventas obj) { var bussingLogic = new GP.BusinessLogic.BLVentas(); obj.Auditoria = new Auditoria { UsuarioCreacion = User.Identity.Name }; //var tallasxml = obj.Tallas_Venta.Select(i => new XElement("TallaVenta", // new XElement("Talla", i.Talla), // new XElement("Cod_prod", i.Cod_Prod), // new XElement("Cantidad", i.Cantidad), // new XElement("Precio", i.Precio_Prod))); //obj.Talla_Ventas = new XDocument(new XDeclaration("1.0", "utf-8", "yes"), new XElement("TallasVenta", tallasxml)); var response = bussingLogic.InsertUpdateVentas(obj); return(Json(response)); }