//public void AddColumns(String[] columns) //{ // foreach (string column in columns) // { // int indexColumn = mDataGridViewWithRecordNumber1.Columns.Add(column, column); // mDataGridViewWithRecordNumber1.Columns[indexColumn].DataPropertyName = column; // } //} public void InitPaging() { txtSoBanGhi.Text = ListCount.ToString(); cbPhanTrang.Items.Clear(); for (int i = 1; i <= TotalPage; i++) { cbPhanTrang.Items.Add(i); } if (list != null && list.Count > 0) { if (list.Count > PageCount) { subList = list.GetRange(0, PageCount); btnNext.Enabled = true; } else { subList = list.GetRange(0, list.Count); } var source = new BindingSource(); source.DataSource = subList; DataGridViewWithRecordNumber.DataSource = source; DataGridViewWithRecordNumber.Refresh(); cbPhanTrang.Text = "1"; cbPhanTrang.Invalidate(); } }
public ListCount GetDataListCountWithProperties(int portalId, int moduleId, string typeCode, string sqlSearchFilter = "", string typeCodeLang = "", string lang = "", Boolean debugMode = false, Boolean visibleOnly = true) { // get cache data var strCacheKey = portalId.ToString("") + "*ListCount*" + moduleId.ToString("") + "*" + typeCode + "*" + "*filter:" + sqlSearchFilter.Replace(" ", "") + "*" + lang + "*" + visibleOnly.ToString(CultureInfo.InvariantCulture); ListCount listCount = null; if (debugMode == false) { var obj = Utils.GetCache(strCacheKey); if (obj != null) { listCount = (ListCount)obj; } } if (listCount == null) { if (visibleOnly) { sqlSearchFilter += " and (NB3.Visible = 1) "; } listCount = CBO.FillObject <ListCount>(DataProvider.Instance().GetListCountWithProperties(portalId, moduleId, typeCode, sqlSearchFilter, typeCodeLang, lang)); if (debugMode == false) { NBrightBuyUtils.SetModCache(moduleId, strCacheKey, listCount); } } return(listCount); }
public void GetListCount(ListCount listCount) { if (Items != null) { listCount.Count = Items.Count; } }
private void OnDrag(object sender, DragEventArgs args) { ListView listView = sender as ListView; if (listView == null) { return; } switch (args.Event.Action) { case DragAction.Drop: if (endIndex == -1) { ListCount listCount = new ListCount(); GetListCount?.Invoke(listCount); endIndex = listView.PointToPosition((int)args.Event.GetX(), (int)args.Event.GetY()) - 1; if (endIndex >= listCount.Count) { endIndex = listCount.Count - 1; } } if (startIndex >= 0 && endIndex >= 0) { ItemDroppedEvent?.Invoke(this, new DragAndDropEventArgs(startIndex, endIndex)); } startIndex = -1; endIndex = -1; break; case DragAction.Ended: isScrolling = false; break; case DragAction.Entered: if (startIndex == -1) { startIndex = int.Parse(args.Event.ClipDescription.Label); startIndex--; } break; case DragAction.Exited: break; case DragAction.Location: lastY = args.Event.GetY(); ScrollUpdate(lastY); break; case DragAction.Started: break; default: break; } }
/// <summary> /// 3.4 获取三大目录 /// </summary> /// <param name="param"></param> /// <returns></returns> public string GetCatalog(UserInfoDto user, CatalogParam param) { var time = _hisSqlRepository.GetTime(Convert.ToInt16(param.CatalogType)); _hisSqlRepository.DeleteCatalog(user, Convert.ToInt16(param.CatalogType)); var timeNew = Convert.ToDateTime(time).ToString("yyyy-MM-dd HH:ss:mm") ?? DateTime.Now.AddYears(-40).ToString("yyyy-MM-dd HH:ss:mm"); var oCatalogInfo = new CatalogInfoDto { 目录类型 = Convert.ToInt16(param.CatalogType).ToString(), 目录名称 = "", 开始时间 = timeNew, 结束时间 = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"), 验证码 = param.AuthCode, 机构编码 = param.OrganizationCode, }; var data = _webServiceBasic.HIS_InterfaceList("06", JsonConvert.SerializeObject(oCatalogInfo)); List <ListCount> nums; var init = new ListCount(); nums = GetResultData(init, data); var cnt = Convert.ToInt32(nums?.FirstOrDefault()?.行数); var resultCatalogDtoList = new List <CatalogDto>(); var i = 0; while (i < cnt) { oCatalogInfo.开始行数 = i; oCatalogInfo.结束行数 = i + param.Nums; var catalogDtoData = _webServiceBasic.HIS_InterfaceList("05", JsonConvert.SerializeObject(oCatalogInfo)); List <CatalogDto> resultCatalogDto; var initCatalogDto = new CatalogDto(); resultCatalogDto = GetResultData(initCatalogDto, catalogDtoData); if (resultCatalogDto.Any()) { resultCatalogDtoList.AddRange(resultCatalogDto); } if (resultCatalogDto.Count > 1) //排除单条更新 { _hisSqlRepository.AddCatalog(user, resultCatalogDto, param.CatalogType); } i = i + param.Nums; } Int64 allNum = resultCatalogDtoList.Count() == 1 ? 0 : resultCatalogDtoList.Count(); return("下载【" + param.CatalogType + "】成功 共" + allNum.ToString() + "条记录"); }
/// <summary> /// 获取ICD-10 /// </summary> /// <param name="verCode"></param> /// <param name="code"></param> /// <param name="num"></param> /// <returns></returns> public string GetIcd10(UserInfoDto user, CatalogParam param) { var time = _hisSqlRepository.GetICD10Time(); var timeNew = Convert.ToDateTime(time).ToString("yyyy-MM-dd HH:ss:mm") ?? DateTime.Now.AddYears(-40).ToString("yyyy-MM-dd HH:ss:mm"); var rowParam = new ICD10InfoRowParam { 开始时间 = timeNew, 结束时间 = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"), 验证码 = param.AuthCode, 疾病类别 = 0, 病种名称 = "" }; var oICD10Info = new ICD10InfoParam { 开始时间 = timeNew, 结束时间 = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"), 验证码 = param.AuthCode, 疾病类别 = 0, 病种名称 = "" }; var data = _webServiceBasic.HIS_InterfaceList("08", Newtonsoft.Json.JsonConvert.SerializeObject(rowParam)); List <ListCount> nums; var init = new ListCount(); nums = GetResultData(init, data); var cnt = Convert.ToInt32(nums?.FirstOrDefault()?.行数); var resultCatalogDtoList = new List <ICD10InfoDto>(); var i = 0; while (i < cnt) { oICD10Info.开始行数 = i; oICD10Info.结束行数 = i + param.Nums; var catalogDtoData = _webServiceBasic.HIS_InterfaceList("07", JsonConvert.SerializeObject(oICD10Info)); List <ICD10InfoDto> resultCatalogDto; var initCatalogDto = new ICD10InfoDto(); resultCatalogDto = GetResultData(initCatalogDto, catalogDtoData); if (resultCatalogDto.Any()) { resultCatalogDtoList.AddRange(resultCatalogDto); _hisSqlRepository.AddICD10(resultCatalogDto, user); i = i + param.Nums; } } return("下载【ICD10】成功 共" + resultCatalogDtoList.Count() + "条记录"); }
private void ClearLists() { ListCount.Clear(); ListDepositPayed.Clear(); ListContractTotalPrice.Clear(); ListContractTotalPriceInclVAT.Clear(); ListTotalCount.Clear(); ListTotalDepositPayed.Clear(); ListTotalContractTotalPrice.Clear(); ListTotalContractTotalPriceInclVAT.Clear(); ListDates.Clear(); }
public static int Main() { ListCount ListCount = new ListCount(); TestLibrary.TestFramework.BeginTestCase("ListCount"); if (ListCount.RunTests()) { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("PASS"); return 100; } else { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("FAIL"); return 0; } }
public static int Main() { ListCount ListCount = new ListCount(); TestLibrary.TestFramework.BeginTestCase("ListCount"); if (ListCount.RunTests()) { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("PASS"); return(100); } else { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("FAIL"); return(0); } }
/// <summary> /// 获取ktuple链表 /// </summary> /// <param name="k"></param> public void GetKtupleList() { int count = 1; for (int i = 0; i < k; i++) { count *= 4; } int[] arrKtuple = new int[count]; for (int i = 0; i < listSeq.Count; i++) { if (listSeq[i].Count >= k) { total += (listSeq[i].Count - k + 1); GetKtupleCount(k, listSeq[i], arrKtuple); } } ListCount.AddRange(arrKtuple); }
/// <summary> /// 3.4 获取三大目录 /// </summary> /// <param name="param"></param> /// <returns></returns> public async Task <string> GetCatalog(UserInfoDto user, CatalogParam param) { var time = await _dataBaseHelpService.GetTime(Convert.ToInt16(param.CatalogType)); var timeNew = Convert.ToDateTime(time).ToString("yyyy-MM-dd HH:ss:mm") ?? DateTime.Now.AddYears(-40).ToString("yyyy-MM-dd HH:ss:mm"); var oCatalogInfo = new CatalogInfoDto { 目录类型 = Convert.ToInt16(param.CatalogType).ToString(), 目录名称 = "", 开始时间 = timeNew, 结束时间 = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"), 验证码 = param.验证码, 机构编码 = param.机构编码, }; var data = await _webServiceBasic.HIS_InterfaceListAsync("06", JsonConvert.SerializeObject(oCatalogInfo), user.职员ID); List <ListCount> nums; var init = new ListCount(); nums = GetResultData(init, data); var cnt = Convert.ToInt32(nums?.FirstOrDefault()?.行数); var resultCatalogDtoList = new List <CatalogDto>(); var i = 0; while (i < cnt) { oCatalogInfo.开始行数 = i; oCatalogInfo.结束行数 = i + param.条数; var catalogDtoData = await _webServiceBasic.HIS_InterfaceListAsync("05", JsonConvert.SerializeObject(oCatalogInfo), user.职员ID); List <CatalogDto> resultCatalogDto; var initCatalogDto = new CatalogDto(); resultCatalogDto = GetResultData(initCatalogDto, catalogDtoData); if (resultCatalogDto.Any()) { resultCatalogDtoList.AddRange(resultCatalogDto); } await _dataBaseHelpService.AddCatalog(user, resultCatalogDto, param.CatalogType); i = i + param.条数; } return("下载【" + param.CatalogType + "】成功 共" + resultCatalogDtoList.Count() + "条记录"); }
/// <summary> /// 获取ICD-10 /// </summary> /// <param name="verCode"></param> /// <param name="code"></param> /// <param name="num"></param> /// <returns></returns> public async Task <string> GetICD10(UserInfoDto user, CatalogParam param) { var time = await _dataBaseHelpService.GetICD10Time(); var timeNew = Convert.ToDateTime(time).ToString("yyyy-MM-dd HH:ss:mm") ?? DateTime.Now.AddYears(-40).ToString("yyyy-MM-dd HH:ss:mm"); var oICD10Info = new ICD10InfoParam { 开始时间 = timeNew, 结束时间 = DateTime.Now.ToString("yyyy-MM-dd HH:ss:mm"), 验证码 = param.验证码, 病种名称 = "" }; var data = await _webServiceBasic.HIS_InterfaceListAsync("08", Newtonsoft.Json.JsonConvert.SerializeObject(oICD10Info), user.职员ID); List <ListCount> nums; var init = new ListCount(); nums = GetResultData(init, data); var cnt = Convert.ToInt32(nums?.FirstOrDefault()?.行数); var resultCatalogDtoList = new List <ICD10InfoDto>(); var i = 0; while (i < cnt) { oICD10Info.开始行数 = i; oICD10Info.结束行数 = i + param.条数; var catalogDtoData = await _webServiceBasic.HIS_InterfaceListAsync("07", JsonConvert.SerializeObject(oICD10Info), user.职员ID); List <ICD10InfoDto> resultCatalogDto; var initCatalogDto = new ICD10InfoDto(); resultCatalogDto = GetResultData(initCatalogDto, catalogDtoData); if (resultCatalogDto.Any()) { resultCatalogDtoList.AddRange(resultCatalogDto); await _dataBaseHelpService.AddICD10(resultCatalogDto); i = i + param.条数; } } return("下载【ICD10】成功 共" + resultCatalogDtoList.Count() + "条记录"); }
private void GettingAndFillData() { switch (TypeReport) { case "Группировка по дням": { DailyEconomicReport = _eF.GetDetailDailyEconomicReport(new Range <DateTime>(BeginValueDate, EndValueDate)); DailyEconomicReport.ForEach(r => { ListCount.Add((int)r.Count); ListDepositPayed.Add((decimal)r.DepositPayed); ListContractTotalPrice.Add((decimal)r.ContractTotalPrice); ListContractTotalPriceInclVAT.Add((decimal)r.ContractTotalPriceInclVAT); ListTotalCount.Add((int)r.TotalCount); ListTotalDepositPayed.Add((decimal)r.TotalDepositPayed); ListTotalContractTotalPrice.Add((decimal)r.TotalContractTotalPrice); ListTotalContractTotalPriceInclVAT.Add((decimal)r.TotalContractTotalPriceInclVAT); ListDates.Add(((DateTime)r.Date).ToString("yyyy-MM-dd")); }); } break; case "Группировка по неделям": { WeeklyEconomicReport = _eF.GetDetailWeeklyEconomicReport(new Date(BeginValueDate), new Date(EndValueDate)); WeeklyEconomicReport.ForEach(r => { ListCount.Add((int)r.Count); ListDepositPayed.Add((decimal)r.DepositPayed); ListContractTotalPrice.Add((decimal)r.ContractTotalPrice); ListContractTotalPriceInclVAT.Add((decimal)r.ContractTotalPriceInclVAT); ListTotalCount.Add((int)r.TotalCount); ListTotalDepositPayed.Add((decimal)r.TotalDepositPayed); ListTotalContractTotalPrice.Add((decimal)r.TotalContractTotalPrice); ListTotalContractTotalPriceInclVAT.Add((decimal)r.TotalContractTotalPriceInclVAT); ListDates.Add(r.Date); }); } break; case "Группировка по месяцам": { MonthlyEconomicReport = _eF.GetDetailMonthlyEconomicReport(new Date(BeginValueDate), new Date(EndValueDate)); MonthlyEconomicReport.ForEach(r => { ListCount.Add((int)r.Count); ListDepositPayed.Add((decimal)r.DepositPayed); ListContractTotalPrice.Add((decimal)r.ContractTotalPrice); ListContractTotalPriceInclVAT.Add((decimal)r.ContractTotalPriceInclVAT); ListTotalCount.Add((int)r.TotalCount); ListTotalDepositPayed.Add((decimal)r.TotalDepositPayed); ListTotalContractTotalPrice.Add((decimal)r.TotalContractTotalPrice); ListTotalContractTotalPriceInclVAT.Add((decimal)r.TotalContractTotalPriceInclVAT); ListDates.Add(r.Date); }); } break; case "Группировка по кварталам": { QuarterlyEconomicReport = _eF.GetDetailQuarterlyEconomicReport(new Date(BeginValueDate), new Date(EndValueDate)); QuarterlyEconomicReport.ForEach(r => { ListCount.Add((int)r.Count); ListDepositPayed.Add((decimal)r.DepositPayed); ListContractTotalPrice.Add((decimal)r.ContractTotalPrice); ListContractTotalPriceInclVAT.Add((decimal)r.ContractTotalPriceInclVAT); ListTotalCount.Add((int)r.TotalCount); ListTotalDepositPayed.Add((decimal)r.TotalDepositPayed); ListTotalContractTotalPrice.Add((decimal)r.TotalContractTotalPrice); ListTotalContractTotalPriceInclVAT.Add((decimal)r.TotalContractTotalPriceInclVAT); ListDates.Add(r.Date); }); } break; case "Группировка по годам": { YearlyEconomicReport = _eF.GetDetailYearlyEconomicReport(new Date(BeginValueDate), new Date(EndValueDate)); YearlyEconomicReport.ForEach(r => { ListCount.Add((int)r.Count); ListDepositPayed.Add((decimal)r.DepositPayed); ListContractTotalPrice.Add((decimal)r.ContractTotalPrice); ListContractTotalPriceInclVAT.Add((decimal)r.ContractTotalPriceInclVAT); ListTotalCount.Add((int)r.TotalCount); ListTotalDepositPayed.Add((decimal)r.TotalDepositPayed); ListTotalContractTotalPrice.Add((decimal)r.TotalContractTotalPrice); ListTotalContractTotalPriceInclVAT.Add((decimal)r.TotalContractTotalPriceInclVAT); ListDates.Add(r.Date); }); } break; } }