public decimal?AddASPReprogrMessage(int inout, string source, string dest) { var oprice = GetPricesForLDU(dest); decimal?price = null; if (oprice != null) { price = oprice.PeriodicRateChange; } else { log.Error(string.Format("AddASPReprogrMessage: Unable to get price for {0}!", source)); } var m = new MsgInOut(); m.MsgType = 9999; m.MsgId = "ASPReprog"; m.TimeStamp = DateTime.UtcNow; m.Source = source; m.RefId = ""; m.InOut = inout; m.Price = price; m.Destination = dest; m.DDPVersion = ""; using (var dao = new MsgInOutDataAccess()) { dao.Create(m); } return(price); }
private void btnImport_Click(object sender, EventArgs e) { //try //{ // DDPImportHelper ddpImport = new DDPImportHelper(); // DataCenterDataAccess.DDPVersion v = new DataCenterDataAccess.DDPVersion(); // ddpImport.Import(txtDDPFile.Text, v ); //} //catch(Exception ex) //{ // MessageBox.Show( ex.ToString() ); //} //PricingManager pm = new PricingManager(); //var p = pm.GetMyCurrentPriceFor(DataCenterDataAccess.PricesDataAccess.PriceType.PositionReport); //p = p; DBDataContext c = new DBDataContext(DataCenterDataAccess.Config.ConnectionString); var m = new MsgInOut(); m.MsgType = 9999; m.MsgId = "ASPReprog"; m.TimeStamp = DateTime.UtcNow; m.Source = ""; m.RefId = ""; m.InOut = 1; m.Price = (decimal)44.4; m.Destination = ""; m.DDPVersion = ""; c.MsgInOuts.InsertOnSubmit(m); c.SubmitChanges(); c.Dispose(); }
public void Create(MsgInOut msg) { context.MsgInOuts.InsertOnSubmit(msg); context.SubmitChanges(); }