Exemple #1
0
 // GET: api/Supercuentas/5
 public HttpResponseMessage Get(string id)
 {
     using (var service = new FormasPagoService(ContextService))
     {
         var list     = service.get(id) as FormasPagoModel;
         var response = Request.CreateResponse(HttpStatusCode.OK);
         response.Content = new StringContent(JsonConvert.SerializeObject(list), Encoding.UTF8,
                                              "application/json");
         return(response);
     }
 }
 public frmCrearOrden(Empleado empleadoSesion)
 {
     InitializeComponent();
     InitializeDataGridView();
     oOTService          = new OrdenTrabajoService();
     this.empleadoSesion = empleadoSesion;
     sDetalle            = new DetalleOTService();
     sFormasPago         = new FormasPagoService();
     sEstado             = new EstadoService();
     sCliente            = new ClienteService();
     sVehiculo           = new VehiculoService();
     listadoDetalleOT    = new BindingList <DetalleOT>();
 }
Exemple #3
0
        public HttpResponseMessage Get()
        {
            using (var service = new FormasPagoService(ContextService))
            {
                var listformaspago = appService.GetListGruposFormasPago();
                var result         = new ResultBusquedas <FormasPagoModel>()
                {
                    values  = service.getAll().Select(f => (FormasPagoModel)f).ToList(),
                    columns = new[]
                    {
                        new ColumnDefinition()
                        {
                            field = "Id", displayName = "Id", visible = true, filter = new  Filter()
                            {
                                condition = ColumnDefinition.STARTS_WITH
                            }
                        },
                        new ColumnDefinition()
                        {
                            field = "Nombre", displayName = "Nombre", visible = true
                        },
                        new ColumnDefinition()
                        {
                            field = "Gruposformaspago", displayName = "Grupo", visible = true, filter = new Filter()
                            {
                                selectOptions = listformaspago.Select(f => new ComboListItem()
                                {
                                    value = f.Descripcion, label = f.Descripcion
                                }).ToList(), type = "select"
                            }
                        }
                    }
                };

                foreach (var item in result.values)
                {
                    item.Gruposformaspago =
                        listformaspago.FirstOrDefault(f => f.Valor == item.FkGruposformaspago)?.Descripcion;
                }

                var response = Request.CreateResponse(HttpStatusCode.OK);
                response.Content = new StringContent(JsonConvert.SerializeObject(result), Encoding.UTF8, "application/json");
                return(response);
            }
        }
        public override ActionResult Create()
        {
            if (TempData["errors"] != null)
            {
                ModelState.AddModelError("", TempData["errors"].ToString());
            }
            var model = TempData["model"] == null?Helper.fModel.GetModel <FormasPagoModel>(ContextService) : TempData["model"] as FormasPagoModel;

            using (var service = new FormasPagoService(ContextService))
            {
                if (TempData["model"] == null)
                {
                    model.Id         = service.NextId();
                    Session[session] = model.Lineas;
                }
                ((IToolbar)model).Toolbar = GenerateToolbar(service, TipoOperacion.Alta, model);
            }

            return(View(model));
        }