📄 timeplans.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class TimePlans : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (this.ListBox1.SelectedIndex == -1)
{
this.lblErr.Text = "请选择一个时间安排";
return;
}
int id = int.Parse(this.ListBox1.SelectedValue);
BLL.BTimePlan bTimePlan = new BLL.BTimePlan();
bTimePlan.Delete(id);
this.ListBox1.DataBind();
this.lblErr.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
if (this.TextBox1.Text != "")
{
string name = this.TextBox1.Text.Trim();
BLL.BTimePlan bTimePlan = new BLL.BTimePlan();
bTimePlan.Insert(name);
this.ListBox1.DataBind();
this.TextBox1.Text = null;
this.lblErr.Text = "";
}
else
{
this.lblErr.Text = "请为时间安排取名";
}
}
protected void Button3_Click(object sender, EventArgs e)
{
Entities.TimePlan eTimePlan = new Entities.TimePlan();
eTimePlan.TimePlanID = int.Parse(this.ListBox1.SelectedValue);
eTimePlan.TimePlanName = this.ListBox1.SelectedItem.Text;
eTimePlan.FridayAm = this.ckbFridayAm.Checked;
eTimePlan.FridayPm = this.ckbFridayPm.Checked;
eTimePlan.MondayAm = this.ckbMondayAm.Checked;
eTimePlan.MondayPm = this.ckbMondayPm.Checked;
eTimePlan.SaturdayAm = this.ckbSaturdayAm.Checked;
eTimePlan.SaturdayPm = this.ckbSaturdayPm.Checked;
eTimePlan.SundayAm = this.ckbSundayAm.Checked;
eTimePlan.SundayPm = this.ckbSundayPM.Checked;
eTimePlan.ThursdayAm = this.ckbThursdayAm.Checked;
eTimePlan.ThursdayPm = this.ckbThursdayPm.Checked;
eTimePlan.TuesdayAm = this.ckbTuesdayAm.Checked;
eTimePlan.TuesdayPm = this.ckbTuesdayPm.Checked;
eTimePlan.WednesdayAm = this.ckbWednesdayAm.Checked;
eTimePlan.WednesdayPm = this.ckbWednesdayPm.Checked;
BLL.BTimePlan bTimePlan = new BLL.BTimePlan();
bTimePlan.Update(eTimePlan);
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
int id = int.Parse(this.ListBox1.SelectedValue);
BLL.BTimePlan bTimePlan = new BLL.BTimePlan();
Entities.TimePlan eTimePlan = bTimePlan.Select(id);
this.ckbFridayAm.Checked = eTimePlan.FridayAm;
this.ckbFridayAm.Checked = eTimePlan.FridayPm;
this.ckbMondayAm.Checked = eTimePlan.MondayAm;
this.ckbMondayPm.Checked = eTimePlan.MondayPm;
this.ckbSaturdayAm.Checked = eTimePlan.SaturdayAm;
this.ckbSaturdayPm.Checked = eTimePlan.SaturdayPm;
this.ckbSundayAm.Checked = eTimePlan.SundayAm;
this.ckbSundayPM.Checked = eTimePlan.SundayPm;
this.ckbThursdayAm.Checked = eTimePlan.ThursdayAm;
this.ckbThursdayPm.Checked = eTimePlan.ThursdayPm;
this.ckbTuesdayAm.Checked = eTimePlan.TuesdayAm;
this.ckbTuesdayPm.Checked = eTimePlan.TuesdayPm;
this.ckbWednesdayAm.Checked = eTimePlan.WednesdayAm;
this.ckbWednesdayPm.Checked = eTimePlan.WednesdayPm;
this.lblErr.Text = "";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -