public void BindDataInfo(bool isNeedToSetValue = true) { int baseDataIdByField = this.GetBaseDataIdByField("FSCHEMEID"); int num2 = this.GetBaseDataIdByField("FRULEID"); if ((baseDataIdByField != 0) && (num2 != 0)) { this.dyRule = BMCommonServiceHelper.LoadFormData(base.Context, "BM_BudgetCtrlRule", num2.ToString()); if (!this.CheckDyObjIsNull(this.dyRule, this.WARNNING_BUDGETCTRLRULEISNULL)) { this.dyScheme = BMCommonServiceHelper.LoadFormData(base.Context, "BM_SCHEME", baseDataIdByField.ToString()); if (!this.CheckDyObjIsNull(this.dyScheme, this.WARNNING_SCHEMEISNULL)) { int num3 = Convert.ToInt32(this.dyRule["patternScheme_Id"]); int ctrlPeriod = Convert.ToInt32(this.dyRule["CtrlPeriod"]); int summaryPeriod = Convert.ToInt32(this.dyRule["SummaryPeriod"]); this.dyRptScheme = BMCommonServiceHelper.LoadFormData(base.Context, "BM_RPTSCHEME", num3.ToString()); this.dyCanlendar = BMCommonServiceHelper.LoadFormData(base.Context, "BM_BUDGETCALENDAR", this.dyScheme["CalendarId_Id"].ToString()); if (isNeedToSetValue) { this.View.Model.SetValue("FIsSummaryCtrl", Convert.ToBoolean(this.dyRule["IsSummaryCtrl"])); this.View.Model.SetValue("FIsDimissionSumCtrl", Convert.ToBoolean(this.dyRule["IsDimissionSumCtrl"])); } this.BindCurrency(this.dyRule, isNeedToSetValue); this.BindBudgetPeriod(this.dyScheme, this.dyCanlendar, isNeedToSetValue, ctrlPeriod, summaryPeriod); this.BindItemDataTypes(this.dyRule, isNeedToSetValue); this.BindBusinessTypes(this.dyRule, isNeedToSetValue); this.BindDimessionEntry(this.dyRule, isNeedToSetValue); } } } }
public static void BuildCurrency(Context ctx, IDynamicFormView view, string controlName, bool isContianBWB = true) { if (!string.IsNullOrWhiteSpace(controlName) && (view != null)) { DynamicObjectCollection objects = BMCommonServiceHelper.QueryData(ctx, "BD_Currency", "FCurrencyId,FName", "FDocumentStatus='C' and FForbidStatus='A'"); if ((objects != null) && (objects.Count > 0)) { List <EnumItem> items = new List <EnumItem>(); List <string> list2 = new List <string>(); foreach (DynamicObject obj2 in objects) { items.Add(CreateEnumItem(view, obj2["FCurrencyId"], (obj2["FName"] == null) ? "" : obj2["FName"].ToString())); list2.Add(obj2["FCurrencyId"].ToString()); } if (isContianBWB) { items.Add(CreateEnumItem(view, 0, GetCurrencyName(ctx, 0L))); } object obj3 = view.Model.GetValue(controlName); if ((obj3 != null) && list2.Contains(obj3.ToString())) { obj3 = view.Model.GetValue(controlName); } else { obj3 = objects[0]["FCurrencyId"]; } view.GetControl <ComboFieldEditor>(controlName).SetComboItems(items); view.Model.SetValue(controlName, obj3); } } }
public string GetOrgFilter(string filter) { int baseDataIdByField = this.GetBaseDataIdByField("FSCHEMEID"); if ((this.GetBaseDataIdByField("FRULEID") == 0) || (baseDataIdByField == 0)) { filter = " 1=2 "; return(filter); } List <int> budgetOrgIdBySchemeId = BMCommonServiceHelper.GetBudgetOrgIdBySchemeId(base.Context, baseDataIdByField); if (budgetOrgIdBySchemeId.Count <int>() <= 0) { return("1=2"); } List <int> source = new List <int>(); if (Convert.ToInt32(this.View.Model.GetValue("FCURRENCYID")) == 0) { int currencyId = Convert.ToInt32(this.View.Model.GetValue("FBWBCURRENCYID")); source.AddRange(BMCommonServiceHelper.GetMainOrgUseDefAcctPLCYByCurrencyId(base.Context, currencyId)); source.AddRange(BMCommonServiceHelper.GetSubnOrgUseDefAcctPLCYByCurrencyId(base.Context, currencyId)); if (source.Count <= 0) { return("1=2"); } } if (source.Count > 0) { budgetOrgIdBySchemeId = new List <int>(budgetOrgIdBySchemeId.Intersect <int>(source.Distinct <int>())); } if (budgetOrgIdBySchemeId.Count <int>() <= 0) { return("1=2"); } string format = " FORGID IN ({0}) AND FISDEFAULT='1' "; if (string.IsNullOrWhiteSpace(filter) || string.IsNullOrEmpty(filter)) { filter = string.Format(format, string.Join <int>(",", budgetOrgIdBySchemeId)); return(filter); } filter = filter + " AND " + string.Format(format, string.Join <int>(",", budgetOrgIdBySchemeId)); return(filter); }
public static string GetCurrencyName(Context ctx, long currencyId) { if (currencyId == 0L) { return(ResManager.LoadKDString("综合本位币", "0032057000017645", SubSystemType.FIN, new object[0])); } DynamicObjectCollection objects = BMCommonServiceHelper.QueryData(ctx, "BD_Currency", "FCurrencyId,FName", string.Format("FDocumentStatus='C' and FForbidStatus='A' And FCURRENCYID={0} ", currencyId)); if (objects.Count <= 0) { return(string.Empty); } if (objects[0]["FName"] != null) { return(objects[0]["FName"].ToString()); } return(""); }
public override void AfterBindData(EventArgs e) { FilterParameter filterParameter = ((ISysReportView)this.View).Model.FilterParameter; int num = Convert.ToInt32(filterParameter.CustomFilter["SchemeId_Id"]); DynamicObject obj2 = BMCommonServiceHelper.LoadFormData(base.Context, "BM_SCHEME", num.ToString()); if (obj2 != null) { DynamicObject dyCanlendar = BMCommonServiceHelper.LoadFormData(base.Context, "BM_BUDGETCALENDAR", obj2["CalendarId_Id"].ToString()); if (dyCanlendar != null) { this.BindBudgetPeriod(dyCanlendar); int num2 = Convert.ToInt32(filterParameter.CustomFilter["FCtrlPeriod"]); this.View.Model.SetValue("FSCHEMEID", num); this.View.Model.SetValue("FCTRLPERIOD", num2); this.View.UpdateView("FSCHEMEID"); this.View.UpdateView("FCTRLPERIOD"); } } }