public void Save() { ControlPropertiesBase properties = ControlProperties.Provider; properties.SaveValue(this.ID, keyShowActive, buttonActive.Checked); properties.SaveValue(this.ID, keyType, listType.SelectedValue); if (listType.SelectedValue == "0") { properties.SaveValue(this.ID, keyFrom, dateFrom.SelectedDate); properties.SaveValue(this.ID, keyTo, dateTo.SelectedDate); } }
/// <summary> /// Binds the data grid. /// </summary> /// <param name="dataBind">if set to <c>true</c> [data bind].</param> void BindDataGrid(bool dataBind) { ControlPropertiesBase properties = ControlProperties.Provider; if (properties.GetValue(this.ID, keyShowActive) == null) { properties.SaveValue(this.ID, keyShowActive, true); } if (properties.GetValue(this.ID, keyType) == null) { properties.SaveValue(this.ID, keyType, "365"); // week } if ((string)properties.GetValue(this.ID, keyType) == "0" && (properties.GetValue(this.ID, keyFrom) == null || properties.GetValue(this.ID, keyTo) == null)) { properties.SaveValue(this.ID, keyType, "365"); // week } DateTime fromDate = DateTime.Now; DateTime toDate = DateTime.Now; if ((string)properties.GetValue(this.ID, keyType) != "0") // period { int days = int.Parse((string)properties.GetValue(this.ID, keyType), CultureInfo.InvariantCulture); fromDate = fromDate.AddDays(-days); } else { fromDate = (DateTime)properties.GetValue(this.ID, keyFrom); toDate = (DateTime)properties.GetValue(this.ID, keyTo); } DataTable dt = Mediachase.IBN.Business.ToDo.GetListToDoAndTasksAssignedByUserDataTable((bool)properties.GetValue(this.ID, keyShowActive), fromDate, toDate); DataView dv = dt.DefaultView; ctrlGrid.DataSource = dv; divNoObjects.Visible = false; if (dv.Count == 0) { ctrlGrid.Visible = false; lblNoObjects.Text = String.Format("{0} <a href='{1}'>{2}</a>", GetGlobalResourceObject("IbnFramework.Global", "NoToDos").ToString(), this.Page.ResolveUrl("~/ToDo/ToDoEdit.aspx"), GetGlobalResourceObject("IbnFramework.Global", "CreateToDo").ToString()); divNoObjects.Visible = true; } BindLegend(); }
public void Save() { if (ReportList.Items.Count > 0) { ControlPropertiesBase properties = ControlProperties.Provider; properties.SaveValue(this.ID, keyReport, ReportList.SelectedValue); } }
private void BindValues() { ControlPropertiesBase properties = ControlProperties.Provider; // Active/All if (properties.GetValue(this.ID, keyShowActive) == null) { properties.SaveValue(this.ID, keyShowActive, true); } if ((bool)properties.GetValue(this.ID, keyShowActive)) { buttonActive.Checked = true; } else { buttonAll.Checked = true; } // Period if (properties.GetValue(this.ID, keyType) == null) { properties.SaveValue(this.ID, keyType, "365"); // week } if ((string)properties.GetValue(this.ID, keyType) == "0" && (properties.GetValue(this.ID, keyFrom) == null || properties.GetValue(this.ID, keyTo) == null)) { properties.SaveValue(this.ID, keyType, "365"); // week } if ((string)properties.GetValue(this.ID, keyType) != "0") { rowFrom.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); rowTo.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); dateFrom.SelectedDate = DateTime.Now.Date.AddDays(-7); dateTo.SelectedDate = DateTime.Now.Date; } else { dateFrom.SelectedDate = (DateTime)properties.GetValue(this.ID, keyFrom); dateTo.SelectedDate = (DateTime)properties.GetValue(this.ID, keyTo); } CommonHelper.SafeSelect(listType, (string)properties.GetValue(this.ID, keyType)); }