BindingList <WeeklyReportDetails> StdList = new BindingList <WeeklyReportDetails>(); // Binding list of Weekly report details type. //Class holding the Binding list parameter. public ReportForm(BindingList <Student> formlist) { InitializeComponent(); this.StudentList = formlist; WeeklyReportPanel.SendToBack(); SortPanel.BringToFront(); }
//open weekly report form private void button2_Click(object sender, EventArgs e) { weeklyReportTable.DataSource = null; StdList.Clear(); WeeklyReportPanel.BringToFront(); ReportGeneration(); dateTimePicker1.Value = startDate.Value; dateTimePicker2.Value = endDate.Value; SortPanel.SendToBack(); }
public SortForm() { InitializeComponent(); int Height = this.Height - this.button1.Height; sortMethod = new Selection_Sort(this, " Selection_Sort", this.Width, Height); this.button1.Text = " " + sortMethod.Title; //Use Double Buffering this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); this.UpdateStyles(); }
private void CreateEllipsisRadio() { ellipsisRadio = new TextRadio(); SortPanel.SetDragEnabled(ellipsisRadio, false); ellipsisRadio.GroupName = "_ellipsisRadio"; ellipsisRadio.Content = "•••"; ellipsisRadio.FontSize = 14; ellipsisRadio.FontFamily = new System.Windows.Media.FontFamily("Consolas"); ellipsisRadio.Checked += ellipsis_Checked; textRadios.Items.Add(ellipsisRadio); ellipsisRadioImg = new ImageRadio(); SortPanel.SetDragEnabled(ellipsisRadioImg, false); ellipsisRadioImg.GroupName = "_ellipsisRadioImg"; ellipsisRadioImg.Content = "pack://application:,,,/Daytimer.Images;component/Images/ellipsis_black.png"; ellipsisRadioImg.Checked += ellipsisRadioImg_Checked; imageRadios.Items.Add(ellipsisRadioImg); }
/// <summary> /// OK /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnOK_Click(object sender, EventArgs e) { //Project var project = QueryFieldPicker.GetAggregation(); var supressAggr = project[0]; var projectAggr = project[1]; if (supressAggr[0].AsBsonDocument.ElementCount > 0) { Aggregation.Add(supressAggr); } //TODO:需要优化,全项目的时候,不用输出 if (projectAggr[0].AsBsonDocument.ElementCount > 0) { Aggregation.Add(projectAggr); } //match var match = ConditionPan.GetMatchDocument(); if (match != null) { Aggregation.Add(match); } //Sort var sort = SortPanel.GetSortDocument(); if (sort != null) { Aggregation.Add(sort); } //Group if (chkIdNull.Checked) { var id = new BsonDocument(); id.Add(new BsonElement("_id", BsonNull.Value)); id.AddRange(FieldsElement.Value.AsBsonDocument.Elements); var group = new BsonDocument("$group", id); Aggregation.Add(group); } else { if (!string.IsNullOrEmpty(GroupIdElement.Name)) { var id = new BsonDocument(); id.Add(new BsonElement("_id", GroupIdElement.Value)); id.AddRange(FieldsElement.Value.AsBsonDocument.Elements); var group = new BsonDocument("$group", id); Aggregation.Add(group); } } //Skip if (chkSkip.Checked && int.Parse(txtSkip.Text) > 0) { Aggregation.Add(new BsonDocument("$skip", int.Parse(txtSkip.Text))); } //Limit if (chkLimit.Checked && int.Parse(txtLimit.Text) > 0) { Aggregation.Add(new BsonDocument("$limit", int.Parse(txtLimit.Text))); } //IndexStats if (chkIndexStats.Checked) { Aggregation.Add(new BsonDocument("$indexStats", new BsonDocument())); } //sortByCount if (chkSortByCount.Checked) { Aggregation.Add(new BsonDocument("$sortByCount", cmbSortByCount.Text)); } //Sample if (chkSample.Checked) { var size = new BsonDocument("size", (int.Parse(txtSample.Text))); Aggregation.Add(new BsonDocument("$sample", size)); } //unwind if (chkUnwind.Checked) { if (!chkPreserveNullAndEmptyArrays.Checked && string.IsNullOrEmpty(txtincludeArrayIndex.Text)) { Aggregation.Add(new BsonDocument("$unwind", cmbUnwind.Text)); } else { var UnwindDoc = new BsonDocument(); var field = new BsonElement("path", cmbUnwind.Text); UnwindDoc.Add(field); if (chkPreserveNullAndEmptyArrays.Checked) { var preserveNullAndEmptyArrays = new BsonElement("preserveNullAndEmptyArrays", BsonBoolean.True); UnwindDoc.Add(preserveNullAndEmptyArrays); } if (!string.IsNullOrEmpty(txtincludeArrayIndex.Text)) { var includeArrayIndex = new BsonElement("includeArrayIndex", txtincludeArrayIndex.Text); UnwindDoc.Add(includeArrayIndex); } Aggregation.Add(new BsonDocument("$unwind", UnwindDoc)); } } Close(); }
private void btnCancel_Click(object sender, EventArgs e) { WeeklyReportPanel.SendToBack(); SortPanel.BringToFront(); }