Example #1
0
        public string MakingExam(string strItemCateg, string strItemCode)
        {
            dt = new DataTable();
            mgrSQLConnect             ObjRun        = new mgrSQLConnect(_configuration);
            ResultItemCateg           ResultOPcateg = new ResultItemCateg();
            List <_OperatorItemCateg> dataList      = new List <_OperatorItemCateg>();
            string Result = "";

            try
            {
                strSQL  = "";
                strSQL += "sprMakeHTMLExam";
                strSQL += " N'" + strItemCateg + "',";
                strSQL += " N'" + strItemCode + "'";
                dt      = ObjRun.GetDatatables(strSQL);
                if (dt.Rows.Count != 0)
                {
                    Result = dt.Rows[0][0].ToString();
                }
                else
                {
                    Result = "Error";
                }
            }
            catch (Exception e)
            {
                Result = e.Message;
            }
            return(Result);
        }
Example #2
0
        public DataTable GetItemCateg(string strItemCateg)
        {
            dt = new DataTable();
            mgrSQLConnect             ObjRun        = new mgrSQLConnect(_configuration);
            ResultItemCateg           ResultOPcateg = new ResultItemCateg();
            List <_OperatorItemCateg> dataList      = new List <_OperatorItemCateg>();

            try
            {
                strSQL  = "";
                strSQL += "SELECT * FROM [SPTOSystem].[dbo].[ItemCategory]";
                strSQL += "  where ItemCateg ='" + strItemCateg + "'";
                dt      = ObjRun.GetDatatables(strSQL);
                if (dt.Rows.Count != 0)
                {
                    strSQL = "XX";
                }
                else
                {
                    strSQL = "aaa";
                }
            }
            catch (Exception)
            {
                dt = null;
            }
            return(dt);
        }
Example #3
0
        public JsonResult GetInputItem(string itemCateg)
        {
            var UserName = User.Identity.Name;
            _OperatorItemCateg dataOperator = new _OperatorItemCateg();
            DataTable          dt           = new DataTable();
            mgrSQLcommand      ObjRun       = new mgrSQLcommand(_configuration);
            //List<_OperatorItemCateg> dataList = new List<_OperatorItemCateg>();
            ResultItemCateg ResultOPcateg = new ResultItemCateg();

            ResultOPcateg = ObjRun.GetInputItemList(itemCateg, UserName);


            var jsonResult = Json(new { data = ResultOPcateg._listOpCateg, _strResult = ResultOPcateg.strResult });

            return(jsonResult);
        }
Example #4
0
        public ResultItemCateg GetOperatorItemCateg(string Opid)
        {
            dt = new DataTable();
            mgrSQLConnect             ObjRun        = new mgrSQLConnect(_configuration);
            ResultItemCateg           ResultOPcateg = new ResultItemCateg();
            List <_OperatorItemCateg> dataList      = new List <_OperatorItemCateg>();

            try
            {
                strSQL = "";
                //strSQL += "SELECT * FROM [SPTOSystem].[dbo].[vewItemCategPlan]";
                //    strSQL += "  where OperatorID ='" + Opid + "'";



                strSQL += "sprGetExamMode";
                strSQL += "''";
                strSQL += ",'" + Opid + "'";
                strSQL += ",'Licence'";
                dt      = ObjRun.GetDatatables(strSQL);
                if (dt.Rows.Count != 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        dataList.Add(new _OperatorItemCateg()
                        {
                            ItemCateg     = row["ItemCateg"].ToString().Trim(),
                            ItemCategName = row["ItemCategName"].ToString().Trim(),
                            cntItemCateg  = row["cntItemCateg"].ToString().Trim(),
                        });
                    }

                    ResultOPcateg._listOpCateg = dataList;
                    ResultOPcateg.strResult    = "OK";
                }
                else
                {
                    ResultOPcateg.strResult = "No exam found <br/> ไม่พบข้อสอบ";
                }
            }
            catch (Exception e)
            {
                ResultOPcateg.strResult = e.Message + " :: " + strSQL;
            }

            return(ResultOPcateg);
        }
Example #5
0
        public ResultItemCateg GetInputItemList(string strItemCateg, string OPID)
        {
            dt = new DataTable();
            mgrSQLConnect             ObjRun        = new mgrSQLConnect(_configuration);
            ResultItemCateg           ResultOPcateg = new ResultItemCateg();
            List <_OperatorItemCateg> dataList      = new List <_OperatorItemCateg>();

            try
            {
                strSQL  = "";
                strSQL += "sprGetExamMode";
                strSQL += "'" + strItemCateg + "'";
                strSQL += ",'" + OPID + "'";
                strSQL += ",'Mode'";



                dt = ObjRun.GetDatatables(strSQL);
                if (dt.Rows.Count != 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        dataList.Add(new _OperatorItemCateg()
                        {
                            ItemCateg     = row["ItemCode"].ToString().Trim(),
                            ItemCategName = row["ItemName"].ToString().Trim(),
                            cntItemCateg  = row["TimeLimit"].ToString().Trim(),
                        });
                    }

                    ResultOPcateg._listOpCateg = dataList;
                    ResultOPcateg.strResult    = "OK";
                }
                else
                {
                    ResultOPcateg.strResult = "Err :" + strSQL;
                }
            }
            catch (Exception e)
            {
                ResultOPcateg.strResult = e.Message;
            }

            return(ResultOPcateg);
        }
Example #6
0
        public DataTable GetInputItems(string strItemCode)
        {
            dt = new DataTable();
            mgrSQLConnect             ObjRun        = new mgrSQLConnect(_configuration);
            ResultItemCateg           ResultOPcateg = new ResultItemCateg();
            List <_OperatorItemCateg> dataList      = new List <_OperatorItemCateg>();

            try
            {
                strSQL  = "";
                strSQL += "SELECT * FROM [SPTOSystem].[dbo].[InputItemList]";
                strSQL += "  where ItemCode ='" + strItemCode + "'";
                dt      = ObjRun.GetDatatables(strSQL);
            }
            catch (Exception)
            {
                dt = null;
            }
            return(dt);
        }