/// <summary> /// 判断是否处于封盘期 /// </summary> public bool IsClosed(PK pk) { using (var db = new RacingDbContext()) { return(pk.BeginTime.AddSeconds(pk.OpeningSeconds) <= DateTime.Now && DateTime.Now <= pk.BeginTime.AddSeconds(pk.OpeningSeconds + pk.CloseSeconds)); } }
public SampleModel() { FkRef = new PK(Unique1); Name.SetDefaultValue("DEFAULT NAME", null, null); AddDbUniqueConstraint("UQ_Temp", null, false, Unique1, Unique2.Desc()); AddDbCheckConstraint("CK_Temp", null, Name.IsNotNull()); }
public bool Quit() { try { //app.Quit(); System.Runtime.InteropServices.Marshal.ReleaseComObject(app); app = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(wb); wb = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(ws); ws = null; System.GC.Collect(); System.GC.WaitForPendingFinalizers(); System.GC.Collect(); System.GC.WaitForPendingFinalizers(); System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { /// Process로 실행되고 타이틀이 없는 것을 이용하여 현재 EXCEL.EXE Process를 끝낸다. if (PK.MainWindowTitle.Length == 0) { PK.Kill(); } } } catch { return(false); } return(true); }
//[System.Runtime.InteropServices.DllImport("user32.dll")]///, SetLastError = true)] //static extern int GetWindowThreadProcessId(int hWnd, out int ProcessId); /// <summary> /// 엑셀과 관련된 변수들을 해제한다. /// </summary> /// <param name="excelApp"></param> /// <param name="wb"></param> /// <param name="ws"></param> private void QuitExcel(Application xlApp, _Workbook wb, Worksheet ws) { GC.Collect(); GC.WaitForPendingFinalizers(); wb.Close(false); xlApp.Quit(); // Clean up System.Runtime.InteropServices.Marshal.ReleaseComObject(ws); app = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(wb); wb = null; System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApp); ws = null; System.GC.Collect(); System.GC.WaitForPendingFinalizers(); System.GC.Collect(); System.GC.WaitForPendingFinalizers(); System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { /// Process로 실행되고 타이틀이 없는 것을 이용하여 현재 EXCEL.EXE Process를 끝낸다. if (PK.MainWindowTitle.Length == 0) { PK.Kill(); } } }
public TempModel() { FkRef = new PK(Unique1); Name.SetDefaultValue("DEFAULT NAME", null, null); AddDbUniqueConstraint("UQ_Temp", null, false, Unique1, Unique2.Desc()); AddDbCheckConstraint("CK_Temp", null, Name.IsNotNull()); this.AddDbTableConstraint(CreateForeignKeyConstraint(null, null, FkRef, this, ForeignKeyRule.None, ForeignKeyRule.None), false); }
private PrevPKTicker(IHubConnectionContext <dynamic> clients) { Clients = clients; _pk = GetPrevPK(); _timer = new Timer(UpdatePK, null, _updateInterval, _updateInterval); }
public PKInfoModel ConvertToPKModel(PK currentPK) { var now = DateTime.Now; var passedSeconds = (int)(now - currentPK.BeginTime).TotalSeconds; var remainSeconds = (int)(currentPK.EndTime - currentPK.BeginTime).TotalSeconds - passedSeconds; // 距离封盘的秒数, 负:已封盘, 正:距离封盘的秒数 var openingRemainSeconds = (int)(currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds) - now).TotalSeconds; //// 距离开奖的秒数, 负:已封盘, 正:距离封盘的秒数 var toLotterySeconds = (int)(currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds + currentPK.GameSeconds) - now).TotalSeconds; //var toLotterySeconds = (int)(currentPK.BeginTime.AddSeconds(AppConfigCache.Racing_Total_Seconds) - now).TotalSeconds; // 距离比赛开始的秒数, 负:未开始, 正:已开始 var gamingSeconds = (int)(now - currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds)).TotalSeconds; // 比赛已经开始n秒 var gamePassedSeconds = gamingSeconds > 0 ? gamingSeconds : 0; // 比赛剩余n秒 var gameRemainSeconds = currentPK.GameSeconds - gamePassedSeconds; gameRemainSeconds = gameRemainSeconds > 0 ? gameRemainSeconds : 0; return(new PKInfoModel { PK = new PKModel { PKId = currentPK.PKId, Ranks = null }, Now = now, PassedSeconds = passedSeconds, RemainSeconds = remainSeconds, OpeningRemainSeconds = openingRemainSeconds, ToLotterySeconds = Math.Abs(toLotterySeconds) + AppConfigCache.Racing_Lottery_Seconds, //延后10s CloseBeginTime = currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds), GameBeginTime = currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds), GamingSeconds = gamingSeconds, GamePassedSeconds = gamePassedSeconds, GameRemainSeconds = gameRemainSeconds, PKRooms = currentPK.PKRooms.Select(r => new PKRoomModel { PKRoomId = r.PKRoomId, PKRoomLevel = r.PKRoomLevel, PKId = r.PKId, PKRoomDesks = r.PKRoomDesks.Select(d => new PKRoomDeskModel { PKRoomDeskId = d.PKRoomDeskId, DeskNo = d.DeskNo, Ranks = d.Ranks, PKRoomId = d.PKRoomId }).ToList() }).ToList() }); }
} // makeBatchOp() private JArray _pkArrayToJArray(IEnumerable <CswPrimaryKey> PkArray) { JArray ReturnVal = new JArray(); foreach (CswPrimaryKey PK in PkArray) { ReturnVal.Add(PK.ToString()); } return(ReturnVal); } //_pkArrayToJArray()
private static void KillExcel() { System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { if (PK.MainWindowTitle.Length == 0) { PK.Kill(); } } }
public void Set(Preferences data) { var encoding = new UTF8Encoding(); string keyper = JsonConvert.SerializeObject(data); var iv = Iu.IV; var key = "hexdiez822443idx"; PK pk = new PK(encoding.GetBytes(iv)); string ms = pk.Eside(keyper, key); string final = tobase64(ms); File.WriteAllText(DATA_FILENAME, final, Encoding.ASCII); }
/// <summary> /// 生成奖金 /// </summary> /// <param name="pk"></param> public void GenerateBonus(PK pk) { using (var db = new RacingDbContext()) { var betService = new BetService(); var bets = betService.ConvertRanksToBets(pk.Ranks); var pkRates = new PKRateService().GetPKRates(pk.PKId); // 按 名次/大小单双+车号 循环 foreach (var bet in bets) { // 奖金 var bonuses = new List <PKBonus>(); // 名次+车号 的下注数据 var dbBets = betService.GetBets(pk.PKId, bet.Rank, bet.Num); foreach (var dbBet in dbBets) { var pkRate = pkRates.Where(r => r.Rank == dbBet.Rank && r.Num == dbBet.Num).First(); bonuses.Add(new PKBonus { BetId = dbBet.BetId, PKId = pk.PKId, UserId = dbBet.UserId, Rank = dbBet.Rank, Num = dbBet.Num, BonusType = Data.Enums.BonusType.Bonus, Amount = Math.Round(dbBet.Amount * pkRate.Rate, 4), IsSettlementDone = true // 直接设置成已结算 }); } if (bonuses.Count > 0) { // 保存奖金 db.PKBonus.AddRange(bonuses); db.SaveChanges(); // 奖金加到余额 var userExtensionService = new UserExtensionService(); foreach (var bonus in bonuses) { userExtensionService.AddAmount(bonus.UserId, bonus.Amount); } } } } }
public static void killProcess(string nameOfProcess) { try { System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName(nameOfProcess); foreach (System.Diagnostics.Process PK in PROC) { PK.Kill(); } } catch (Exception ex) { logger.logException(ex); } }
public static void killExcel() { try { System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { PK.Kill(); } } catch (Exception ex) { logger.logException(ex); } }
public PK AddPK() { using (var db = new RacingDbContext()) { // 生成PK PK pk = db.Database.SqlQuery <PK>(string.Format("EXEC {0}", DBConst.SP_PK_GeneratePK)).FirstOrDefault(); if (pk != null) { // 生成赔率 db.Database.ExecuteSqlCommand(string.Format("EXEC {0} {1}", DBConst.SP_PK_GeneratePKRate, pk.PKId)); } return(pk); } }
public void UpdatePK(object state) { lock (_updatePKLock) { if (!_updatingPK) { _updatingPK = true; // 获取最新数据 _pk = GetPrevPK(); BroadcastPK(_pk); _updatingPK = false; } } }
private static void CloseExcel(Microsoft.Office.Interop.Excel.Application ExcelApplication = null) { if (ExcelApplication != null) { ExcelApplication.Workbooks.Close(); ExcelApplication.Quit(); } System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { if (PK.MainWindowTitle.Length == 0) { PK.Kill(); } } }
public override bool Equals(object o) { if (this == o) { return(true); } if (o == null || GetType() != o.GetType()) { return(false); } PK pk = (PK)o; return /*sequenceNumber == pk.sequenceNumber &&*/ (Equals(_aggregateIdentifier, pk._aggregateIdentifier) && Equals(_type, pk._type)); }
/// <summary> /// Initializes a new instance of <see cref="KeyOutput"/> class. /// </summary> /// <param name="model">The source model.</param> public KeyOutput(Model model) { model.VerifyNotNull(nameof(model)); var primaryKey = model.PrimaryKey; if (primaryKey == null) { throw new ArgumentException(DiagnosticMessages.DbTable_NoPrimaryKey(model), nameof(model)); } _sourceDbAlias = model.DbAlias; _primaryKey = new PK(this, primaryKey); var sortKeys = new ColumnSort[primaryKey.Count]; for (int i = 0; i < sortKeys.Length; i++) { sortKeys[i] = primaryKey[i]; } AddDbTableConstraint(new DbPrimaryKey(this, null, null, false, () => { return(sortKeys); }), true); }
public PKModel ConvertToPKModel(PK currentPK) { var now = DateTime.Now; var passedSeconds = (int)(now - currentPK.BeginTime).TotalSeconds; var remainSeconds = (int)(currentPK.EndTime - currentPK.BeginTime).TotalSeconds - passedSeconds; // 距离封盘的秒数, 负:已封盘, 正:距离封盘的秒数 var openingRemainSeconds = (int)(currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds) - now).TotalSeconds; //// 距离开奖的秒数, 负:已封盘, 正:距离封盘的秒数 var toLotterySeconds = (int)(currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds + currentPK.GameSeconds) - now).TotalSeconds; //var toLotterySeconds = (int)(currentPK.BeginTime.AddSeconds(AppConfigCache.Racing_Total_Seconds) - now).TotalSeconds; // 距离比赛开始的秒数, 负:未开始, 正:已开始 var gamingSeconds = (int)(now - currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds)).TotalSeconds; // 比赛已经开始n秒 var gamePassedSeconds = gamingSeconds > 0 ? gamingSeconds : 0; // 比赛剩余n秒 var gameRemainSeconds = currentPK.GameSeconds - gamePassedSeconds; gameRemainSeconds = gameRemainSeconds > 0 ? gameRemainSeconds : 0; return(new PKModel { PK = currentPK, Now = now, PassedSeconds = passedSeconds, RemainSeconds = remainSeconds, OpeningRemainSeconds = openingRemainSeconds, ToLotterySeconds = Math.Abs(toLotterySeconds) + AppConfigCache.Racing_Lottery_Seconds, //延后10s CloseBeginTime = currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds), GameBeginTime = currentPK.BeginTime.AddSeconds(currentPK.OpeningSeconds + currentPK.CloseSeconds), GamingSeconds = gamingSeconds, GamePassedSeconds = gamePassedSeconds, GameRemainSeconds = gameRemainSeconds }); }
public PK AddPK(DateTime beginTime) { using (var db = new RacingDbContext()) { var pk = new PK { CreateTime = DateTime.Now, BeginTime = beginTime, EndTime = DateTime.Now.AddSeconds(AppConfigCache.Racing_Total_Seconds), OpeningSeconds = AppConfigCache.Racing_Opening_Seconds, CloseSeconds = AppConfigCache.Racing_Close_Seconds, GameSeconds = AppConfigCache.Racing_Game_Seconds, LotterySeconds = AppConfigCache.Racing_Lottery_Seconds, //PKRates = pkRates //pkRates 过多, 插入时间很长, 必须和PK新增分开 }; db.PK.Add(pk); db.SaveChanges(); // pkRates 过多, 插入时间很长, 必须和PK新增分开 var pkRates = new List <PKRate>(); foreach (var rate in RateCache.GetRatesByType(Data.Enums.RateType.Arena)) { for (var num = 1; num <= 14; num++) { pkRates.Add(new PKRate { PKId = pk.PKId, Rank = rate.Rank, Num = num, Rate = RateService.GetRate(rate, num) }); } } db.PKRate.AddRange(pkRates); db.SaveChanges(); return(pk); } }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.PageCommentID.Value)); }
/// <summary> /// 从api获得当前用户, 生成Bonus /// </summary> /// <returns></returns> private List <PKBonus> GetBonus(PK pk) { var bonus = new List <PKBonus>(); try { var onlieUsers = GetOnlineUsers(); if (onlieUsers.Count == 0) { return(bonus); } /* * 游戏结束后,结算如果是用户得了第一名,就获得50分奖励 * 初级中级高级 * 0-5000分可以在初级玩 * 5000-50000分,在中级玩 * 50000-500000分,可以在高级玩 */ var bunusAmouts = new List <int> { 50 }; //目前只有第一名有奖励, 只有第一名50分 //房间(初中高级) for (var roomLevel = 1; roomLevel <= 3; roomLevel++) { var room = pk.PKRooms.Where(r => r.PKId == pk.PKId && r.PKRoomLevel == roomLevel).First(); //桌子 for (var deskNo = 1; deskNo <= 8; deskNo++) { var users = onlieUsers.Where(u => u.UniqueID < _minDummyUserId && u.RoomLevel == roomLevel && u.DeskNo == deskNo).ToList(); if (users.Count > 0) { var desk = room.PKRoomDesks.Where(d => d.DeskNo == deskNo).First(); var rankList = desk.Ranks.Split(','); //6,7,4,10,2,8,3,1,9,5 int rank = 1; //名次 foreach (var amount in bunusAmouts) { var num = Convert.ToInt32(rankList[rank - 1]);//车号 //存在第n名的车号 var user = users.Where(u => u.Num == num).FirstOrDefault(); if (user != null) { bonus.Add(new PKBonus { Rank = rank, Num = num, Amount = amount, UserId = user.UniqueID, PKRoomDeskId = desk.PKRoomDeskId, PKRoomId = room.PKRoomId, PKId = pk.PKId }); } rank++; } } } } } catch (Exception ex) { _logger.Info(ex); } return(bonus); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.JobID.Value)); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.MemberPhotoID.Value)); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.UserID.Value, pk.RoleID.Value)); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.MarketingGroupID.Value)); }
public static void GenerateDemoUsingNetOffice(object[][] data, int demoNum = 0, string fileName = "xl12345.xlsx") { string worksheetName = "Demo NetOffice"; Console.WriteLine("Building excel report using NetOffice."); Console.WriteLine("Launching background Excel process."); var excelType = Type.GetTypeFromCLSID(new Guid(@"{00020812-0000-0000-C000-000000000046}")); var excel = Activator.CreateInstance(excelType); var xlApp = new Application(new NetOffice.COMObject(excel)); xlApp.Application.DisplayAlerts = false; xlApp.Workbooks.Add(); (xlApp.Workbooks.Last() as Workbook).Activate(); var wb = xlApp.ActiveWorkbook; Console.WriteLine("Workbook created, creating worksheet."); wb.Worksheets.Add(); var WORK_SHEET = (wb.Worksheets.Last() as Worksheet); if (WORK_SHEET != null) { for (int i = 0; i <= wb.Worksheets.Count; i++) { (wb.Worksheets.ElementAt(0) as Worksheet).Delete(); } WORK_SHEET.Name = worksheetName; Console.WriteLine("Worksheet's ready. Building report."); if (demoNum == 0) { CreateDemoHeadersTableWithNetOffice(ref WORK_SHEET); } if (demoNum == 1) { CreateSCTableWithNetOffice(ref WORK_SHEET); WORK_SHEET.UsedRange.Columns.AutoFit(); } } Console.WriteLine("Report filled. Saving and closing background excel process."); wb.SaveAs(Utilities.Get_Full_Output_Path(fileName), XlFileFormat.xlOpenXMLWorkbook, null, null, false, false, XlSaveAsAccessMode.xlNoChange, XlSaveConflictResolution.xlUserResolution, true, null, null, null); wb.Close(); xlApp.Application.Quit(); //BRUTEFORCE System.Diagnostics.Process[] PROC = System.Diagnostics.Process.GetProcessesByName("EXCEL"); foreach (System.Diagnostics.Process PK in PROC) { if (PK.MainWindowTitle.Length == 0) { PK.Kill(); } } Console.WriteLine("Job's done. Press any key."); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.SubjectTypeID.Value)); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.SurveyQuestionID.Value)); }
/// <summary> /// Fills the member variables of the Object from the DB based On the primary key, returns true if success. /// </summary> /// <param name="pk">PK struct</param> /// <returns>true member variables filled.</returns> public bool Load(PK pk) { return(Load(pk.PageCategoryID.Value)); }
public string GetData(Model.DTO.PatientDiagnose_list_F model) { Model.DTO.JsonModel jsonmodel = new Model.DTO.JsonModel() { Statu = "err", Msg = "无数据", Data = "" }; List<string> requestStr = new List<string>(); #region 返回卡号 if (model.codeType == "0") { requestStr = GetRequestStr(model); //保存记录(查询记录数据,更新或添加) string.IsNullOrEmpty(requestStr)存在值 修改修!string.IsNullOrEmpty(requestStr) kaka if (requestStr != null && requestStr.Count > 0) { List<Model.PatientDiagnose> patientDiagnoseList = new List<Model.PatientDiagnose>(); StringBuilder msg = new StringBuilder(); //调用接口获取数据 foreach (var item in requestStr) { string xmlStr = GetWebServiceData(item); string _Msg = ""; //返回数据缺少结束标记 if (!xmlStr.Contains("</Response>")) { xmlStr += "</Response>"; } Model.DTO.PatientDiagnoseResuest request = XmlStrToPatientDiagnoseResuest(item); if (request != null) { List<Model.PatientDiagnose> patientDiagnoses = StrTObject(xmlStr, out _Msg, request); if (patientDiagnoses != null) { foreach (Model.PatientDiagnose patientDiagnose in patientDiagnoses) { if (!patientDiagnoseList.Contains(patientDiagnose)) { bool check = CheckData(patientDiagnose); if (!check) { patientDiagnoseList.Add(patientDiagnose); } } if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } } //nnn.Add(model.Code); else { if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } if (patientDiagnoseList != null && patientDiagnoseList.Count > 0) { //有数据 jsonmodel = CreatJsonMode("ok", msg.ToString(), patientDiagnoseList); // ChangeQueryRecordStatu(cq, msg.ToString()); } else { //无数据 jsonmodel = CreatJsonMode("err", msg.ToString(), patientDiagnoseList); ///ChangeQueryRecordStatu(cq, msg.ToString()); } } } #endregion #region 返回住院号 else if (model.codeType == "1") { RuRo.BLL.PK pk = new PK(); //获取住院入参 List<string> requestStrAdmissionDate = new List<string>(); requestStrAdmissionDate = pk.GetRequestStr(model,"AdmissionDate"); //获取出院入参 List<string> requestStrDischargeDate = new List<string>(); requestStrDischargeDate = pk.GetRequestStr(model,"DischargeDate"); List<Model.PatientDiagnose> patientDiagnoseList = new List<Model.PatientDiagnose>();//最终数据存放处 StringBuilder msg = new StringBuilder(); #region 获取住院日期数据 //判断返回数据是否成功 if (requestStrAdmissionDate != null && requestStrAdmissionDate.Count > 0) { foreach (var item in requestStrAdmissionDate) { string _Msg = ""; List<Model.PatientDiagnose> patientDiagnoses = pk.GetHTTPWebServiceData(item); if (patientDiagnoses != null && patientDiagnoses.Count > 0) { foreach (Model.PatientDiagnose patientDiagnose in patientDiagnoses) { if (!patientDiagnoseList.Contains(patientDiagnose)) { bool check = CheckData(patientDiagnose); if (!check) { patientDiagnoseList.Add(patientDiagnose); } } if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } else { if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } } #endregion #region 获取出院日期数据 if (requestStrDischargeDate != null && requestStrDischargeDate.Count > 0) { foreach (var item in requestStrDischargeDate) { string _Msg = ""; List<Model.PatientDiagnose> patientDiagnoses = pk.GetHTTPWebServiceData(item); if (patientDiagnoses != null && patientDiagnoses.Count > 0) { foreach (Model.PatientDiagnose patientDiagnose in patientDiagnoses) { if (!patientDiagnoseList.Contains(patientDiagnose)) { bool check = CheckData(patientDiagnose); if (!check) { patientDiagnoseList.Add(patientDiagnose); } } if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } else { if (!string.IsNullOrEmpty(_Msg)) { msg.Replace(_Msg, ""); msg.Replace(" ", ""); msg.Replace(" ", ""); msg.Append("   " + _Msg); } } } } #endregion if (patientDiagnoseList != null && patientDiagnoseList.Count > 0) { //有数据 jsonmodel = CreatJsonMode("ok", msg.ToString(), patientDiagnoseList); // ChangeQueryRecordStatu(cq, msg.ToString()); } else { //无数据 jsonmodel = CreatJsonMode("err", msg.ToString(), patientDiagnoseList); ///ChangeQueryRecordStatu(cq, msg.ToString()); } } #endregion return JsonConvert.SerializeObject(jsonmodel); }