private void LoadActualSales_Async() { CD_DomainContext context = new CD_DomainContext(); string cdIds = DBUtils.Get_CD_ProductIDs(Utils.GetBrandCode(_productBrand)); if (GetDosageSaCodes() != "") cdIds = DBUtils.GetCdProductIds(GetDosageSaCodes()); LoadOperation<TotalActualPerProvincePerMonth> loadOp = context.Load(context.GetTotalActual_PerProvince_PerMonthQuery(cdIds, new DateTime(_startYear - 1,_startMonth,1),new DateTime(_endYear,_endMonth,1).AddMonths(1).AddMinutes(-1)),TotalActualPerProvincePerMonth_ResultCallBack,null); }
public void TotalActualPerProvincePerMonth_ThisYear_ResultCallBack(LoadOperation<TotalActualPerProvincePerMonth> result) { if (Utils.LoadOperation_Error_Handled(result.Error, "CD")) { _loadedDataThisYear = new List<TotalActualPerProvincePerMonth>(); foreach (TotalActualPerProvincePerMonth dataItem in result.Entities) { _loadedDataThisYear.Add(dataItem); if (!DBUtils.Null_Handled(dataItem)) continue; Add_to_Province_ThisYear_Actual_Dictionaries((int)dataItem.QTY, (int)dataItem.ProductID, new DateTime((int)dataItem.YearT,(int)dataItem.MonthT,1).AddMonths(1).AddSeconds(-1), (int)dataItem.ProvinceID); Add_to_Provinces_With_Actual((int)dataItem.ProvinceID); } CD_DomainContext context = new CD_DomainContext(); context.Load<TotalActualPerProvincePerMonth>(context.GetTotalActual_PerProvince_PerMonthQuery(DBUtils.Get_CD_ProductIDs(Utils.GetBrandCode(_productBrand)), _startDate.AddYears(-1), _endDate.AddYears(-1)), TotalActualPerProvincePerMonth_LastYear_ResultCallBack, null); } }
private void LoadActual_Async() { _provinceActualQty = new Dictionary<int, double>(); _provinceActualVal = new Dictionary<int, double>(); _provinceLastYearActualQty = new Dictionary<int, double>(); _provinceLastYearActualVal = new Dictionary<int, double>(); CD_DomainContext context = new CD_DomainContext(); string cdIds = DBUtils.Get_CD_ProductIDs(Utils.GetBrandCode(_productBrand)); if (GetDosageSaCodes() != "") cdIds = DBUtils.GetCdProductIds(GetDosageSaCodes()); context.Load<TotalActualPerProvincePerMonth>(context.GetTotalActual_PerProvince_PerMonthQuery(cdIds, _startDate, _endDate), TotalActualPerProvincePerMonth_ThisYear_ResultCallBack, null); }
private void LoadProvinceResult(SanofiProductBrands product, int startM, int startY, int endM, int endY) { object[] state = { product, startM, startY, endM, endY }; if (!IsLoading("GetTotalActual_PerProvince_PerMonthQuery", state)) { CD_DomainContext context = new CD_DomainContext(); AddtoLoadingList("GetTotalActual_PerProvince_PerMonthQuery", state); DateTime start = new DateTime(startY, startM, 1); DateTime end = new DateTime(endY, endM, 1).AddMonths(1).AddSeconds(-1); context.Load(context.GetTotalActual_PerProvince_PerMonthQuery(DBUtils.Get_CD_ProductIDs(Utils.GetBrandCode(product)), start, end ), TotalActualPerProvincePerMonth_ResultCallback, state); } }