protected void Button6_Click(object sender, EventArgs e)
{
if (DatePicker4.Text == "")
{
Alert.ShowInTop("请添入作业日期");
}
else
{
string deleteScript = GetDeleteScript();
JObject defaultObj = new JObject();
defaultObj.ToString(Newtonsoft.Json.Formatting.None);
defaultObj.Add("flrq", this.DatePicker1.Text);
defaultObj.Add("mlh", this.TextBox6.Text);
defaultObj.Add("cc", this.DropDownList2.SelectedText);
defaultObj.Add("zdz", this.TextBox7.Text);
defaultObj.Add("zyrq", this.DatePicker4.Text);
defaultObj.Add("zylb", this.DropDownList3.SelectedValue);
defaultObj.Add("zycz", this.DropDownList4.SelectedValue);
defaultObj.Add("zycl", this.DropDownList5.SelectedValue);
defaultObj.Add("zyc", this.DropDownList6.SelectedValue);
defaultObj.Add("bz", this.TextBox9.Text);
// defaultObj.Add("Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)));
defaultObj.Add("Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", deleteScript, IconHelper.GetResolvedIconUrl(Icon.Delete)));
// Button6.OnClientClick=Grid1.GetAddNewRecordReference(defaultObj, false);
this.Grid1.AddNewRecord(defaultObj, false);
DataTable table = GetDataTable();
Grid1.DataSource = table;
Grid1.DataBind();
// DatePicker4.Text = "";
}
//List<Dictionary<string, string>> newAddedList = Grid1.GetNewAddedList();
//for (int i = newAddedList.Count - 1; i >= 0; i--)
//{
// TextBox8.Text = TextBox8.Text + newAddedList.Count.ToString();
//}
} |