Beispiel #1
0
        protected void DetailsView5_ItemInserting(object sender, DetailsViewInsertEventArgs e)      //Problem表插入判断
        {
            AssignmentManager a = new AssignmentManager();

            if (e.Values["assignment"] == null)
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "msg1", "alert('插入失败!Problem表中assignment字段不能为空');", true);
                e.Cancel = true;
                return;
            }
            if (a.GetAssignmentByNum(int.Parse(e.Values["assignment"].ToString())) == null)
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "msg1", "alert('插入失败!Problem表中外键assignment字段不存在');", true);
                e.Cancel = true;
                return;
            }
        }
Beispiel #2
0
        //Problem表插入判断
        protected void DetailsView5_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            AssignmentManager a = new AssignmentManager();
            if (e.Values["assignment"] == null)
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "msg1", "alert('插入失败!Problem表中assignment字段不能为空');", true);
                e.Cancel = true;
                return;

            }
            if (a.GetAssignmentByNum(int.Parse(e.Values["assignment"].ToString())) == null)
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "msg1", "alert('插入失败!Problem表中外键assignment字段不存在');", true);
                e.Cancel = true;
                return;
            }
        }