public async Task <ActionResult <FillModel> > PostFillModel(FillModel fillModel) { _context.FillModel.Add(fillModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFillModel", new { id = fillModel.FillId }, fillModel)); }
public async Task <IActionResult> PutFillModel(int id, FillModel fillModel) { if (id != fillModel.FillId) { return(BadRequest()); } _context.Entry(fillModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FillModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task PostFill(FillModel fill) { using (HttpResponseMessage response = await _apiHelper.ApiClient.PostAsJsonAsync("/api/Fill", fill)) { if (response.IsSuccessStatusCode) { // log successfull call? } else { throw new Exception(response.ReasonPhrase); } } }
public JsonResult GetAllFilledPrescriptions() { using (var service = new EventService()) { var test = service.GetWhere(EventService.StatusCol == EventStatus.Fill).Where(x => x.Patient.Pharmacy.Code == User.Pharmacy.Code); List <FillModel> result = new List <FillModel>(); foreach (var t in test) { //if(t.Prescription.Patient.Pharmacy == User.Pharmacy) var temp = new FillModel(t.Refills.FirstOrDefault()); if (temp != null) { result.Add(temp); } } return(Json(result)); } }
public void OnMessage(QuickFix.FIX44.ExecutionReport m, SessionID s) { FillModel fill = new FillModel { AvgPx = m.Price.getValue(), ClOrderId = m.ClOrdID.getValue(), CumQty = (int)m.CumQty.getValue(), LastQty = (int)m.LastQty.getValue(), LeavesQty = (int)m.LeavesQty.getValue(), OrderQty = (int)m.OrderQty.getValue(), Side = m.Side.getValue(), OrdStatus = m.OrdStatus.getValue(), TickerSymbol = m.Symbol.getValue(), ExecId = m.ExecID.getValue(), ExecType = m.ExecType.getValue() - '0', OrderId = m.OrderID.getValue(), }; FillReceived?.Invoke(this, fill); }
/// <summary> /// Create brokerage model for internal usage /// </summary> /// <param name="accounttype"></param> /// <param name="feemodel"></param> /// <param name="fillmodel"></param> /// <param name="latencymodel"></param> /// <param name="margincallmodel"></param> /// <param name="marginmodel"></param> /// <param name="settlementmodel"></param> /// <param name="slippagemodel"></param> /// <param name="spreadmodel"></param> protected GenericBrokerModel( AccountType accounttype, FeeModel feemodel, FillModel fillmodel, LatencyModel latencymodel, MarginCallModel margincallmodel, MarginModel marginmodel, SettlementModel settlementmodel, SlippageModel slippagemodel, SpreadModel spreadmodel) { //Set given values AccountType = accounttype; FeeModel = feemodel; FillModel = fillmodel; LatencyModel = latencymodel; MarginCallModel = margincallmodel; SettlementModel = settlementmodel; SlippageModel = slippagemodel; MarginModel = marginmodel; SpreadModel = spreadmodel; }
public void SaveOrder(OrderModel orderInfo) { orderInfo.ClOrderId = _fix.GetNewClOrderID(); orderInfo.OrigClOrderId = orderInfo.ClOrderId; _sql.StartTransaction("RAMData"); try { switch (orderInfo.InternalOrderType) { case 1: { OrderModel stage = CloneHelper.ShallowClone(orderInfo); stage.InternalOrderType = 0; stage.ClOrderId = _fix.GetNewClOrderID(); stage.OrigClOrderId = stage.ClOrderId; orderInfo.StageOrderId = stage.ClOrderId; FillModel fill = new FillModel { AvgPx = orderInfo.AvgPrice, ClOrderId = orderInfo.ClOrderId, CumQty = orderInfo.Quantity, LastQty = orderInfo.Quantity, LeavesQty = 0, OrderQty = orderInfo.Quantity, Side = orderInfo.Side, OrdStatus = orderInfo.OrderStatus, TickerSymbol = orderInfo.TickerSymbol, ExecId = _fix.GetNewClOrderID(), ExecType = 2, OrderId = _fix.GetNewClOrderID(), }; _sql.SaveDataInTransaction("dbo.spOrder_Insert", stage); _sql.SaveDataInTransaction("dbo.spOrder_Insert", orderInfo); _sql.SaveDataInTransaction("dbo.spFill_Insert", fill); } break; case 2: { _fix.SendOrder(orderInfo); OrderModel stage = CloneHelper.ShallowClone(orderInfo); stage.InternalOrderType = 0; stage.ClOrderId = _fix.GetNewClOrderID(); stage.OrigClOrderId = stage.ClOrderId; orderInfo.StageOrderId = stage.ClOrderId; _sql.SaveDataInTransaction("dbo.spOrder_Insert", stage); _sql.SaveDataInTransaction("dbo.spOrder_Insert", orderInfo); } break; default: _sql.SaveDataInTransaction("dbo.spOrder_Insert", orderInfo); break; } _sql.CommitTransaction(); } catch (Exception) { _sql.RollbackTransaction(); throw; } }
/// <summary> /// 插入标题 /// </summary> /// <param name="Inner_objlist">标题填充内容List</param> /// <param name="Style">标题单元格样式</param> /// <param name="TitleType">标题类型 1列标题 2行标题</param> /// <param name="FillModel">(0,0)单元格填充模式</param> public void InsertTitle(IList <object> Inner_objlist, CellStyle Style = null, TitleType TitleType = TitleType.列标题, FillModel FillModel = FillModel.空出第一个单元格) { if (FillModel == FillModel.没有标题) { return; } for (int i = 0; i < Inner_objlist.Count; i++) { SCell scell = new SCell { CStyle = Style ?? new CellStyle(), Txt_Obj = Inner_objlist[i] }; if (TitleType == ExcelFormat.TitleType.列标题) { if (FillModel == FillModel.列标题填充) { scell.Y = i; } else { scell.Y = i + 1; } this.SCells.Add(scell); } else if (TitleType == ExcelFormat.TitleType.行标题) { if (FillModel == FillModel.行标题填充) { scell.X = i; } else { scell.X = i + 1; } this.SCells.Add(scell); } } }
private void FixApp_FillReceived(object sender, FillModel fill) { _ = _sql.SaveData("dbo.spFill_Insert", fill, "RAMData"); }
public void Post(FillModel fill) { _fillData.SaveFill(fill); }
public void SaveFill(FillModel fillInfo) { _ = _sql.SaveData("dbo.spFill_Insert", fillInfo, "RAMData"); }