Exemplo n.º 1
0
        //删除
        protected void Delete_OnClick(object sender, EventArgs e)
        {
            ExtendBLL.LabEvaluation labEva = new ExtendBLL.LabEvaluation();

            string ID = IDHF.Value;
            List<string> strID = new List<string>();
            List<string> strTable = new List<string>();
            List<string> strColName = new List<string>();
            #region 评估标准
            strID.Add(ID);
            strTable.Add("Standard");
            strColName.Add("ID");
            #endregion
            #region 自评结果
            strID.Add(ID);
            strTable.Add("Evaluation");
            strColName.Add("StandarID");
            #endregion
            try
            {
                labEva.DeleteStandard(strID, strTable, strColName);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('删除成功!');refreshParent();wincolse();</script>");
            }
            catch
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('删除失败!');refreshParent();wincolse();</script>");
                return;
            }
        }
Exemplo n.º 2
0
        protected void Delete_OnClick(object sender, EventArgs e)
        {
            ExtendBLL.LabEvaluation labEva = new ExtendBLL.LabEvaluation();
            int count = EvalTitleGridView.Rows.Count;
            bool IsDel = false;

            for (int i = 0; i < count; i++)
            {
                string ID=EvalTitleGridView.DataKeys[i].Value.ToString();
                CheckBox cb = (CheckBox)EvalTitleGridView.Rows[i].FindControl("SelectCB");
                if (cb.Checked == true)
                {
                    IsDel = true;
                    List<string> strID = new List<string>();
                    List<string> strTable = new List<string>();
                    List<string> strColName = new List<string>();
                    #region ��������
                    strID.Add(ID);
                    strTable.Add("EvaluationTitle");
                    strColName.Add("ID");
                    #endregion
                    #region ������׼
                    strID.Add(ID);
                    strTable.Add("Standard");
                    strColName.Add("EvTitleID");
                    #endregion
                    try
                    {
                        labEva.DeleteEval(strID, strTable, strColName);
                    }
                    catch
                    {
                        Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('ɾ��ʧ��!')</script>");
                        return;
                    }
                }
            }
            if (IsDel)
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type='text/javascript'>alert('ɾ���ɹ�!')</script>");
                EvalTitleGV_DataBind(int.Parse(KindDDL.SelectedValue));
            }
        }