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>");
 }