protected void btnSave_Click(object sender, EventArgs e) { int idChannel; if (!Int32.TryParse(cbChannel.SelectedValue,out idChannel)) { lChanError.Visible=true; return; } ServiceInterface server = new ServiceInterface(); if (Request.QueryString["idSchedule"]!=null) server.DeleteSchedule(Int32.Parse(Request.QueryString["idSchedule"])); server.AddSchedule(idChannel, edTitle.Text, DateTime.Parse(edStart.Text), DateTime.Parse(edEnd.Text), Int32.Parse(cbScheduleType.SelectedValue)); RegisterStartupScript("close", "<script>window.close();</script>"); }
protected void gridSchedules_RowDeleting(object sender, GridViewDeleteEventArgs e) { int idx = (int)gridSchedules.DataKeys[e.RowIndex].Value; ServiceInterface server = new ServiceInterface(); server.DeleteSchedule(idx); e.Cancel = true; RefreshSchedules(); }