//public string Approved_Reject_Question(string Job,int seq, string ValueCodeQuestion, string ValueCodeAnswer, string ValueStatus,int Rewrite_Master)
        //{



        //    string MS = "";
        //    var ObjRun = new mgrSQLConnect(_configuration);



        //    strSQL = "[dbo].[srpApproved_Reject_Question] '"+ Job + "','"+ ValueStatus + "','"+ seq.ToString() + "','"+ ValueCodeQuestion + "','"+ ValueCodeAnswer + "','"+ Rewrite_Master.ToString() + "'";

        //    dt = ObjRun.GetDatatables(strSQL);
        //    MS = dt.Rows[0][1].ToString();
        //    return MS;


        //}
        public string Approved_Reject_Question_(string Job, string valueStatus_Array, string seq_Array, string ValueCodeQuestion, int Rewrite_Master)
        {
            var    ObjRun          = new mgrSQLConnect(_configuration);
            int    Intpro          = 0;
            string StrSql          = "";
            string MS              = "";
            string ValueCodeAnswer = Get_ValueCodeAnswer(ValueCodeQuestion);



            if (Job == "APP")
            {
                if (Rewrite_Master > 0)
                {
                    //------------------ Back up The last Exam -------

                    StrSql = @"insert into  [SPTOSystem].[dbo].[ValueList]  
	                            ([ValueCode],[DisplayOrder],[Value_HTML],[Value_TEXT],[Answer],[Need]
                                 ,[ValueStatus],[Rewrite],[AddDate],[UpdDate],[UserName],[ComputerName])
                                select [ValueCode],[DisplayOrder],[Value_HTML],[Value_TEXT],[Answer],[Need]
                                ,'OLD',[Rewrite],[AddDate],[UpdDate],[UserName],[ComputerName] from [SPTOSystem].[dbo].[ValueList]
                                 where(ValueCode = '" + ValueCodeQuestion + "' or ValueCode = '" + ValueCodeAnswer + "') and  [ValueStatus] != 'NEW'    and Rewrite = '" + Rewrite_Master.ToString() + "' ";
                    Intpro = ObjRun.ExecProc(StrSql);

                    if (Intpro < 0)
                    {
                        return("False");
                    }
                }


                //--------------- Update -----------------
                StrSql = strSQL = "[dbo].[sprApproved_Reject_Question] '" + Job + "','" + valueStatus_Array + "','" + seq_Array + "','" + ValueCodeQuestion + "','" + ValueCodeAnswer + "','" + Rewrite_Master.ToString() + "'";
                dt     = ObjRun.GetDatatables(strSQL);
                MS     = dt.Rows[0][1].ToString();



                if (MS != "OK")
                {
                    StrSql = @"delete [SPTOSystem].[dbo].[ValueList]  where
                         (ValueCode = '" + ValueCodeQuestion + "' or ValueCode = '" + ValueCodeAnswer + "') and ValueStatus ='OLD' and Rewrite = '" + Rewrite_Master.ToString() + "'  ";
                    Intpro = ObjRun.ExecProc(StrSql);

                    return("False");
                }
                else
                {
                    Rewrite_Master = Rewrite_Master + 1;
                    StrSql         = @" update [SPTOSystem].[dbo].[InputItem] set [Rewrite] = '" + Rewrite_Master.ToString() + "' ,  [UpdDate] = getdate() where [ValueCodeQuestion]='" + ValueCodeQuestion + "' and [ValueCodeAnswer] = '" + ValueCodeAnswer + "' ";
                    Intpro         = ObjRun.ExecProc(StrSql);
                }
            }

            else
            {
                //--------------- Update -----------------
                strSQL = "[dbo].[sprApproved_Reject_Question] '" + Job + "','" + valueStatus_Array + "','" + seq_Array + "','" + ValueCodeQuestion + "','" + ValueCodeAnswer + "','" + Rewrite_Master.ToString() + "'";
                dt     = ObjRun.GetDatatables(strSQL);
                MS     = dt.Rows[0][1].ToString();
            }


            return(MS);
        }