/// <summary> /// save agenda /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button8_Click(object sender,EventArgs e) { if (DoingAgenda()) { AgendaBind ab = FromAgenda(Session[SelectedAgenda] as string); if (ab != null) { Agenda a = new Agenda(); a.AGENDA_TYPE = RadioButtonList1.SelectedValue; if (a.AGENDA_TYPE == "W") { a.DOW = RadioButtonList2.SelectedValue; } a.NICKNAME = txtNickName.Text; a.SLOT = TextBox7.Text; a.Parameters = new List <Parameter>(); a.PKY = ab.UUID; AgendaResult agenda = Model.UserSetAgenda(a); SetMessage("Schedule " + a.NICKNAME + " changed successfully"); } } else // new agenda item .. { Agenda a = new Agenda(); a.NICKNAME = txtNickName.Text; a.AGENDA_TYPE = RadioButtonList1.SelectedValue; if (a.AGENDA_TYPE == "W") { a.DOW = RadioButtonList2.SelectedValue; } a.SLOT = TextBox7.Text; if (RadioButtonList3.SelectedValue == "N") { a.WithMetadata = "X"; } else { a.ColumnsNamed = "X"; } Scheduler s = DoWork(true); a.Name = TextBox1.Text; a.USERID = s.Username; if (IsValid(TextBox4.Text)) { a.Variant = TextBox4.Text; } else { a.Variant = Session[VarNameSaved] as string; } a.Parameters = new List <Parameter>(); foreach (var item in s.Parameters) { a.Parameters.Add(item); } AgendaResult agenda = Model.UserSetAgenda(a); SetMessage("Schedule " + a.NICKNAME + " created successfully"); } }
protected void CheckBox2_CheckedChanged(object sender,EventArgs e) { if (CheckBox2.Checked == true) { Agenda a = Session[SavedAgendaForUpdate] as Agenda; if (a != null) { CheckBox2.Visible = false; CheckBox2.Checked = false; Button9.Visible = false; AgendaResult agenda = Model.UserSetAgenda(a); SetMessage("Schedule deleted"); Grid3.Visible = false; BeforeB2.Visible = false; DOWs.Visible = false; showAgenda = false; Thread.Sleep(100); Button7_Click(Button7,null); } } }