protected void Save_B_Click(object sender, EventArgs e) { M_EDU_Subject model = !string.IsNullOrEmpty(SubID_Hid.Value) ? subll.SelReturnModel(DataConverter.CLng(SubID_Hid.Value)) : new M_EDU_Subject(); model.Name = SubName_T.Text; model.Subject = GroName_T.Text; model.MaxCount = DataConverter.CLng(MaxCount_T.Text); model.Flag = Flag_T.Text; if (!string.IsNullOrEmpty(SubID_Hid.Value)) { subll.UpdateByID(model); } else { subll.Insert(model); } SubID_Hid.Value = ""; MyBind(); }
protected void Sub_RPT_ItemCommand(object source, RepeaterCommandEventArgs e) { int ID = DataConverter.CLng(e.CommandArgument); switch (e.CommandName) { case "Edit": M_EDU_Subject model = subll.SelReturnModel(ID); SubName_T.Text = model.Name; GroName_T.Text = model.Subject; SubID_Hid.Value = model.ID.ToString(); Flag_T.Text = model.Flag; break; case "Del": subll.Del(ID); MyBind(); break; default: break; } }