Ejemplo n.º 1
0
        /// <summary>
        /// 绑定存在问题的序号
        /// </summary>
        private void ProblemIndexDataBind()
        {
            ProbIndex prob = new ProbIndex();

            prob.StrTabeleName = ViewState["str_table"].ToString();
            prob.TaskID        = ViewState["TaskId"].ToString();
            DataTable dt = this.ExecRetProbTable(prob);

            grvProb.DataSource = dt;
            grvProb.DataBind();
            if (grvProb.Rows.Count > 0)
            {
                NoDataPanel.Visible = false;
            }
            else
            {
                NoDataPanel.Visible = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 执行存储过程验证序号(保存时)
        /// </summary>
        /// <param name="psv"></param>
        private DataTable ExecRetProbTable(ProbIndex probindex)
        {
            DataTable dt;

            try
            {
                SqlConnection sqlConn = new SqlConnection();
                SqlCommand    sqlCmd  = new SqlCommand();
                sqlConn.ConnectionString = DBCallCommon.GetStringValue("connectionStrings");
                DBCallCommon.PrepareStoredProc(sqlConn, sqlCmd, "[PRO_TM_FindNoFatherIndex]");
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@StrTable", probindex.StrTabeleName, SqlDbType.Text, 1000);
                DBCallCommon.AddParameterToStoredProc(sqlCmd, "@BM_ENGID", probindex.TaskID, SqlDbType.Text, 1000);
                sqlConn.Open();
                dt = DBCallCommon.GetDataTableUsingCmd(sqlCmd);
                sqlConn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            return(dt);
        }