public static void StdActionButton(MainAppForm mainapp, string _id, string status) { stdcollection.Update(Query.EQ("_id", ObjectId.Parse(_id)), MongoDB.Driver.Builders.Update.Set("status", status)); StdGridRefresh(mainapp); }
public static void StdGridRefresh(MainAppForm mainapp) { var query = Query.EQ("status", Properties.Settings.Default.StdFilterFlag); var stdresult = new BindingList<stdcolls>(stdcollection.Find(query).ToList()); mainapp.gridStudents.DataSource = stdresult; var count = Convert.ToInt16(stdresult.Count()); mainapp.ItemsCountStatusText.Caption = String.Format("{0} students count: {1}", Convert.ToString(Properties.Settings.Default.StdFilterFlag), Convert.ToString(count)); }
public static void MongoInitiate(MainAppForm mainapp) { connectionString = Properties.Settings.Default.ServerOne; client = new MongoClient(connectionString); server = client.GetServer(); gebase = server.GetDatabase("gebase"); stdcollection = gebase.GetCollection<stdcolls>("stds"); StdGridRefresh(mainapp); }
public static void GroupGridColHide(MainAppForm mainapp) { mainapp.bandedGroupGridView.Columns["_id"].Visible = false; mainapp.bandedGroupGridView.Columns["suntime"].Visible = false; mainapp.bandedGroupGridView.Columns["montime"].Visible = false; mainapp.bandedGroupGridView.Columns["tuetime"].Visible = false; mainapp.bandedGroupGridView.Columns["wedtime"].Visible = false; mainapp.bandedGroupGridView.Columns["thutime"].Visible = false; mainapp.bandedGroupGridView.Columns["fritime"].Visible = false; mainapp.bandedGroupGridView.Columns["sattime"].Visible = false; mainapp.bandedGroupGridView.Columns["start"].Visible = false; }
//public static void GroupGridUnsortedRefreshFilter(MainAppForm mainapp) //{ // MongoCollection<groupcolls> groupcollection = gebase.GetCollection<groupcolls>("groups"); // var query = Query.EQ("status", Properties.Settings.Default.GroupFilterFlag); // BindingList<groupcolls> groupresult = new BindingList<groupcolls>(groupcollection.Find(query).ToList()); // mainapp.gridGroup.DataSource = groupresult; // StatusTextRefresh(mainapp); //} //public static void StatusTextRefresh(MainAppForm mainapp) //{ // MongoCollection<groupcolls> groupcount = gebase.GetCollection<groupcolls>("groups"); // var query = Query.EQ("status", Properties.Settings.Default.GroupFilterFlag); // int count = Convert.ToInt16(groupcount.Find(query).Count()); // mainapp.ItemsCountStatusText.Caption = Convert.ToString(Properties.Settings.Default.GroupFilterFlag) + " groups count: " + Convert.ToString(count); //} public static void ActionButtonSwitch(MainAppForm mainapp, string groupstatus, int focusedrow) { switch (groupstatus) { case "active": mainapp.PauseGroupButton.Enabled = true; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = true; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; mainapp.bandedGroupGridView.FocusedRowHandle = focusedrow; stdcode.GroupDetails(mainapp); break; case "paused": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = true; mainapp.FinishGroupButton.Enabled = true; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; mainapp.bandedGroupGridView.Focus(); mainapp.bandedGroupGridView.FocusedRowHandle = focusedrow; stdcode.GroupDetails(mainapp); break; case "awaiting": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = false; mainapp.StartGroupButton.Enabled = true; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; mainapp.bandedGroupGridView.FocusedRowHandle = focusedrow; stdcode.GroupDetails(mainapp); break; case "finished": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = false; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; mainapp.bandedGroupGridView.FocusedRowHandle = focusedrow; stdcode.GroupDetails(mainapp); break; } }
public static void GroupGridColHide(MainAppForm mainapp) { mainapp.bandedGroupGridView.Columns["_id"].Visible = false; mainapp.bandedGroupGridView.Columns["suntime"].Visible = false; mainapp.bandedGroupGridView.Columns["montime"].Visible = false; mainapp.bandedGroupGridView.Columns["tuetime"].Visible = false; mainapp.bandedGroupGridView.Columns["wedtime"].Visible = false; mainapp.bandedGroupGridView.Columns["thutime"].Visible = false; mainapp.bandedGroupGridView.Columns["fritime"].Visible = false; mainapp.bandedGroupGridView.Columns["sattime"].Visible = false; mainapp.bandedGroupGridView.Columns["start"].Visible = false; mainapp.bandedGroupGridView.Columns["hours"].Visible = false; mainapp.bandedGroupGridView.Columns["kind"].Visible = false; mainapp.bandedGroupGridView.Columns["status"].Visible = false; mainapp.bandedGroupGridView.Columns["stdcount"].Width = 5; mainapp.bandedGroupGridView.Columns["stdcount"].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center; }
public static void StdGridRefresh(MainAppForm mainapp) { //if (mainapp.bandedStudentsGridView.RowCount > 0) //{ var query = Query.EQ("status", Properties.Settings.Default.StdFilterFlag); BindingList<stdcolls> stdresult = new BindingList<stdcolls>(stdcollection.Find(query).ToList()); mainapp.gridStudents.DataSource = stdresult; int count = Convert.ToInt16(stdresult.Count()); mainapp.ItemsCountStatusText.Caption = Convert.ToString(Properties.Settings.Default.StdFilterFlag) + " students count: " + Convert.ToString(count); //} //else //{ // int count = 0; // mainapp.ItemsCountStatusText.Caption = Convert.ToString(Properties.Settings.Default.StdFilterFlag) + " students count: " + Convert.ToString(count); //} }
public static void PayColHide(MainAppForm mainapp) { var i = 0; while (i <= 16) { mainapp.bandedPaymentsGridView.Columns[i].VisibleIndex = -1; i++; } var j = 19; while (j <= 22) { mainapp.bandedPaymentsGridView.Columns[j].VisibleIndex = -1; j++; } mainapp.bandedPaymentsGridView.Columns["group"].Width = 5; }
public static void ActionButtonSwitch(MainAppForm mainapp) { var groupstatus = Properties.Settings.Default.GroupFilterFlag; switch (groupstatus) { case "active": mainapp.PauseGroupButton.Enabled = true; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = true; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; break; case "paused": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = true; mainapp.FinishGroupButton.Enabled = true; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; break; case "awaiting": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = false; mainapp.StartGroupButton.Enabled = true; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; break; case "finished": mainapp.PauseGroupButton.Enabled = false; mainapp.ResumeGroupButton.Enabled = false; mainapp.FinishGroupButton.Enabled = false; mainapp.StartGroupButton.Enabled = false; mainapp.EditGroupButton.Enabled = true; mainapp.DeleteGroupButton.Enabled = true; break; } }
public static void StdGridColHide(MainAppForm mainapp) { var i = 0; while (i <= 16) { mainapp.bandedStudentsGridView.Columns[i].VisibleIndex = -1; i++; } }
public static void GroupDetails(MainAppForm mainapp) { MongoInitiate(mainapp); //client = new MongoClient(connectionString); //server = client.GetServer(); //gebase = server.GetDatabase("gebase"); //stddetailcollection = gebase.GetCollection<stdcolls>("stds"); string number = mainapp.bandedGroupGridView.GetRowCellValue(mainapp.bandedGroupGridView.FocusedRowHandle, "number").ToString(); mainapp.bandedDetailGroupGridView.GroupPanelText = "group " + number + " details"; var query = Query.EQ("group", number); try { BindingList<stdcolls> stddetails = new BindingList<stdcolls>(stdcollection.Find(query).ToList()); mainapp.gridGroupDetail.DataSource = stddetails; int i = 0; while (i <= 16) { mainapp.bandedDetailGroupGridView.Columns[i].VisibleIndex = -1; i++; } int j = 18; while (j <= mainapp.bandedDetailGroupGridView.Columns.Count) { mainapp.bandedDetailGroupGridView.Columns[j].VisibleIndex = -1; j++; } groupcode.GroupGridRefresh(mainapp); } catch { mainapp.gridGroup.DataSource = null; mainapp.bandedDetailGroupGridView.GroupPanelText = "..."; } //string status = mainapp.bandedGroupGridView.GetRowCellValue(mainapp.bandedGroupGridView.FocusedRowHandle, "status").ToString(); //ActionButtonSwitch(mainapp, status); }
public static void GroupStdCount(MainAppForm mainapp) { stdcode.MongoInitiate(mainapp); var query = from e in gebase.GetCollection<groupcolls>("groups").AsQueryable<groupcolls>() select e.number; foreach (var number in query) { var stdcount = Convert.ToInt16(stdcode.gebase.GetCollection<stdcolls>("stds").FindAs<stdcolls>(Query.EQ("group", number)).Count()); gebase.GetCollection<groupcolls>("groups").Update( Query.EQ("number", number), MongoDB.Driver.Builders.Update.Set("stdcount", stdcount)); } }
private void StdEditFormFill(MainAppForm mainapp, int rowindex) { fname.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "fname").ToString(); lname.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "lname").ToString(); email.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "email").ToString(); mphone.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "mphone").ToString(); hphone.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "hphone").ToString(); addphone.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "addphone").ToString(); stlevel.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "level").ToString(); stgroup.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "group").ToString(); cost.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "cost").ToString(); status.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "status").ToString(); if (Convert.ToBoolean(mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "isindividual"))) individualcheck.Checked = true; if (Convert.ToBoolean(mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "isintensive"))) intensivecheck.Checked = true; acceptdate.DateTime = Convert.ToDateTime(mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "accepted")); possdays.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "daysposs").ToString(); posstime.Text = mainapp.bandedStudentsGridView.GetRowCellValue(rowindex, "timeposs").ToString(); source.Text = mainapp.bandedStudentsGridView.GetRowCellValue(mainapp.bandedStudentsGridView.FocusedRowHandle, "source").ToString(); }
public studentform(MainAppForm mainform) { InitializeComponent(); mainapp = mainform; }
public static void GroupGridRefreshFilter(MainAppForm mainapp, string filter) { Properties.Settings.Default.GroupFilterFlag = filter; Properties.Settings.Default.Save(); MongoCollection<groupcolls> groupcollection = gebase.GetCollection<groupcolls>("groups"); var query = Query.EQ("status", Properties.Settings.Default.GroupFilterFlag); BindingList<groupcolls> groupresult = new BindingList<groupcolls>(groupcollection.Find(query).ToList()); mainapp.gridGroup.DataSource = groupresult; }
public static void GroupGridRefresh(MainAppForm mainapp) { var query = Query.EQ("status", Properties.Settings.Default.GroupFilterFlag); var groupresult = new BindingList<groupcolls>(gebase.GetCollection<groupcolls>("groups").Find(query).ToList()); mainapp.gridGroup.DataSource = groupresult; var count = Convert.ToInt16(groupresult.Count()); mainapp.ItemsCountStatusText.Caption = String.Format("{0} groups count: {1}", Convert.ToString(Properties.Settings.Default.GroupFilterFlag), Convert.ToString(count)); mainapp.bandedGroupGridView.GroupPanelText = Convert.ToString(Properties.Settings.Default.GroupFilterFlag) + " groups list"; }
public static void GroupDel(MainAppForm mainapp, string _id) { gebase.GetCollection<groupcolls>("groups").Remove( Query.EQ("_id", ObjectId.Parse(_id))); groupcode.GroupGridRefresh(mainapp); mainapp.bandedGroupGridView.FocusedRowHandle = Properties.Settings.Default.GroupSelectedRowIndex; }
public static void GroupTabShow(MainAppForm mainapp) { switch (Properties.Settings.Default.GroupFilterFlag) { case "active": mainapp.ActiveGroupButton.Down = true; break; case "paused": mainapp.PausedGroupButton.Down = true; break; case "awaiting": mainapp.AwaitingGroupButton.Down = true; break; case "finished": mainapp.FinishedGroupButton.Down = true; break; } switch (Properties.Settings.Default.GroupDetailsShow) { case true: mainapp.DetailGroupButton.Down = true; break; case false: mainapp.DetailGroupButton.Down = false; break; } mainapp.DetailGroupButton_DownChanged(null, null); GroupStdCount(mainapp); GroupGridRefresh(mainapp); }
public static void StdActionButtonsSwitch(MainAppForm mainapp, string status) { switch (status) { case "active": mainapp.PauseStudentButton.Enabled = true; mainapp.EditStudentButton.Enabled = true; mainapp.ResumeStudentButton.Enabled = false; mainapp.FinishStudentButton.Enabled = true; mainapp.StartStudentButton.Enabled = false; mainapp.DeleteStudentButton.Enabled = true; break; case "paused": mainapp.PauseStudentButton.Enabled = false; mainapp.EditStudentButton.Enabled = true; mainapp.ResumeStudentButton.Enabled = true; mainapp.FinishStudentButton.Enabled = false; mainapp.StartStudentButton.Enabled = false; mainapp.DeleteStudentButton.Enabled = true; break; case "awaiting": mainapp.PauseStudentButton.Enabled = false; mainapp.EditStudentButton.Enabled = true; mainapp.ResumeStudentButton.Enabled = false; mainapp.FinishStudentButton.Enabled = false; mainapp.StartStudentButton.Enabled = true; mainapp.DeleteStudentButton.Enabled = true; break; case "finished": mainapp.PauseStudentButton.Enabled = false; mainapp.EditStudentButton.Enabled = true; mainapp.ResumeStudentButton.Enabled = false; mainapp.FinishStudentButton.Enabled = false; mainapp.StartStudentButton.Enabled = false; mainapp.DeleteStudentButton.Enabled = true; break; } }
public static void GetCurrentGroupData(MainAppForm mainapp) { }
public static void GroupDetailView(MainAppForm mainapp) { switch (Properties.Settings.Default.GroupDetailsShow) { case true: mainapp.DetailGroupButton.Down = true; mainapp.DetailGroupButton_DownChanged(null, null); break; case false: mainapp.DetailGroupButton.Down = false; mainapp.DetailGroupButton_DownChanged(null, null); break; } }
public static void GroupDetails(MainAppForm mainapp) { connectionString = Properties.Settings.Default.ServerOne; client = new MongoClient(connectionString); server = client.GetServer(); gebase = server.GetDatabase("gebase"); string paneltext; try { var number = Properties.Settings.Default.CurrentGroupNumber; if (number == string.Empty) { paneltext = "nothing selected"; } else { paneltext = String.Format("group {0} details", number); } mainapp.bandedDetailGroupGridView.GroupPanelText = paneltext; stdcollection = gebase.GetCollection<stdcolls>("stds"); var query = Query.EQ("group", number); var stddetails = new BindingList<stdcolls>(stdcollection.Find(query).ToList()); mainapp.gridGroupDetail.DataSource = stddetails; } catch { return; } }
public static void StdRemove(MainAppForm mainapp, string _id) { stdcollection.Remove( Query.EQ("_id", ObjectId.Parse(_id))); StdGridRefresh(mainapp); }
public static void StdTabShow(MainAppForm mainapp) { switch (Properties.Settings.Default.StdFilterFlag) { case "active": mainapp.ActiveStudentsButton.Down = true; StdGridRefresh(mainapp); break; case "paused": mainapp.PausedStudentsButton.Down = true; StdGridRefresh(mainapp); break; case "awaiting": mainapp.AwaitingStudentsButton.Down = true; StdGridRefresh(mainapp); break; case "finished": mainapp.FinishedStudentsButton.Down = true; StdGridRefresh(mainapp); break; } }
public static void GroupTabShow(MainAppForm mainapp) { switch (Properties.Settings.Default.GroupFilterFlag) { case "active": mainapp.ActiveGroupButton.Down = true; GroupGridRefresh(mainapp); break; case "paused": mainapp.PausedGroupButton.Down = true; GroupGridRefresh(mainapp); break; case "awaiting": mainapp.AwaitingGroupButton.Down = true; GroupGridRefresh(mainapp); break; case "finished": mainapp.FinishedGroupButton.Down = true; GroupGridRefresh(mainapp); break; } }
public static void GroupAction(MainAppForm mainapp, string _id, string groupstatus, string number) { gebase.GetCollection<groupcolls>("groups").Update( Query.EQ("_id", ObjectId.Parse(_id)), MongoDB.Driver.Builders.Update.Set("status", groupstatus)); GroupGridRefresh(mainapp); mainapp.StatusEventsText.Caption = String.Format("Group {0} state changed to {1}", number, groupstatus.ToUpper()); mainapp.StatusEventsText.Visibility = BarItemVisibility.Always; }
public static void PayGridRefresh(MainAppForm mainapp) { var payresult = new BindingList<stdcolls>(stdcollection.FindAll().ToList()); mainapp.gridPayments.DataSource = payresult; PayColHide(mainapp); }
public groupform(MainAppForm mainform) { InitializeComponent(); mainapp = mainform; }
public static void GroupAction(MainAppForm mainapp, int rowhandle, string groupstatus) { BindingList<groupcolls> grouplist = mainapp.gridGroup.DataSource as BindingList<groupcolls>; groupcolls _groupentity = grouplist[rowhandle]; gebase.GetCollection<groupcolls>("groups").Update( Query.EQ("_id", _groupentity._id), MongoDB.Driver.Builders.Update.Set("status", groupstatus)); GroupGridRefresh(mainapp); mainapp.StatusEventsText.Caption = "Group " + _groupentity.number.ToString() + " state changed to " + groupstatus.ToUpper(); mainapp.StatusEventsText.Visibility = BarItemVisibility.Always; mainapp.bandedGroupGridView.FocusedRowHandle = Properties.Settings.Default.GroupSelectedRowIndex; //StatusTextRefresh(mainapp); }