private void BindProfile(EHSProfile profile) { if (profile != null) { gvMetricList.DataSource = profile.Profile.EHS_PROFILE_MEASURE.OrderBy(l => l.EHS_MEASURE.MEASURE_CD); gvMetricList.DataBind(); SQMBasePage.SetGridViewDisplay(gvMetricList, lblMetricListEmpty, divMetricListGVScroll, -1, 0); ddlDayDue.SelectedValue = staticProfile.Profile.DAY_DUE.ToString(); ddlWarningDays.SelectedValue = staticProfile.Profile.REMINDER_DAYS.ToString(); ddlMetricCurrency.SelectedValue = staticProfile.Plant.CURRENCY_CODE; pnlMetricEdit.Enabled = btnMetricCancel.Enabled = btnMetricSave.Enabled = false; btnProfileMeasureNew.Enabled = true; } }
private void UpdateMetricList(EHSProfile profile) { if (profile != null) { switch (profile.Profile.DISPLAY_OPTION) { case 1: gvMetricList.DataSource = profile.Profile.EHS_PROFILE_MEASURE.OrderBy(l => l.EHS_MEASURE.MEASURE_CD); break; case 2: gvMetricList.DataSource = profile.Profile.EHS_PROFILE_MEASURE.OrderBy(l => l.EHS_MEASURE.MEASURE_NAME); break; default: gvMetricList.DataSource = profile.Profile.EHS_PROFILE_MEASURE.OrderBy(l => l.EHS_MEASURE.MEASURE_CATEGORY).ThenBy(l => l.EHS_MEASURE.MEASURE_CD); break; } gvMetricList.DataBind(); SQMBasePage.SetGridViewDisplay(gvMetricList, lblMetricListEmpty, divMetricListGVScroll, -1, 0); } }