public void PushRenwu (RenwuData renwu) { mEventAggregator.GetEvent<ReceivedRenwuEvent>().Publish(new ReceivedRenwuData() { RunningTime = renwu.RunningTime, BangpaiType = renwu.BangpaiType, SearchWord = renwu.SearchWord, Price = renwu.Price, BiaoshiName = renwu.SearchWord, ID = renwu.ID , Steps = renwu.Steps }); }
public void DoAllow (long[] ids) { using(var db = DbContextFactory.CreateDbContext()) { var xiake = db.Xiakes.FirstOrDefault(a => a.XiakeName == System.Threading.Thread.CurrentPrincipal.Identity.Name); if (xiake.UserType != XiakeType.Zhanggui) throw new FaultException("非掌柜不可以核准"); var vals = db.Validations .Include(a=>a.Biaoshi) .Include(a=>a.Zhanggui) .Include(a=>a.Biao ) .Include(a=>a.Biaoshi.Biaoju) .Where(a => ids.Contains(a.Id)) .ToArray(); var renwus = new List<RenwuData>(); foreach(var item in vals) { if(item.Zhanggui != xiake) throw new FaultException("别人的镖不可以核准"); var s = RunningStepsData.MakeDataWithString(item.Biao.Steps); var renwu = new Renwu() { RunTime = item.Biao.CreateTime , Biaoju = item.Biaoshi.Biaoju, Biao = item.Biao, Biaoshi = item.Biaoshi, Bangpai = item.Biaoshi.Bangpai, NextStep = s.JubenDayDatas[0].Juben, Steps = item.Biao.Steps, IsDisabled = false, DaysForCurStep = s.JubenDayDatas[0].Days }; db.Renwus.Add(renwu); var rendata = new RenwuData() { RunningTime = renwu.RunTime, BangpaiType = item.Biaoshi.Bangpai, SearchWord = item.Biao.SearchWord, Price = item.Biao.Price, BiaoshiName = item.Biaoshi.Title , ID = renwu.Id, BiaojuId = item.Biaoshi.Biaoju.Id, NextStep = renwu.NextStep }; renwus.Add(rendata); db.Validations.Remove(item); } db.SaveChanges(); mMasterServiceProxy.PushRenwu(renwus.ToArray()); } }
public void PushRenwu (RenwuData[] renwu) { Task.Run(() => { mService.Service.PushRenwu(renwu); }); }
public void PushRenwu (RenwuData[] renwu) { foreach (var dog in mService) { try { if(dog.CommunicationObject.State == CommunicationState.Opened) dog.Channel.PushRenwu(renwu); } catch(Exception e) {} } }