public List <vewOperatorReqChange_Groupby> Get_ApprovedDetailGroup()
        {
            List <vewOperatorReqChange_Groupby> Detail = new List <vewOperatorReqChange_Groupby>();


            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "SELECT       [DocNo]      ,[ReqOperatorID]     ,CONVERT(varchar, [ReqDate],120) as [ReqDate],count(*) as TotalJob FROM [SPTOSystem].[dbo].[vewOperatorReqChange]";
            strSQL += " where [ChangeOperatorID] is null   or [ChangeOperatorID] = ''    group by[DocNo],[ReqOperatorID], CONVERT(varchar, [ReqDate], 120) order by CONVERT(varchar, [ReqDate], 120) desc ";
            dt      = ObjRun.GetDatatables(strSQL);


            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Detail.Add(new vewOperatorReqChange_Groupby()
                    {
                        DocNo         = row["DocNo"].ToString(),
                        ReqOperatorID = row["ReqOperatorID"].ToString(),
                        ReqDate       = row["ReqDate"].ToString(),
                        TotalJob      = Convert.ToInt32(row["TotalJob"].ToString()),
                    });
                }
            }
            return(Detail);
        }
Пример #2
0
        public DataTable GetSectionCode(string strDivision, string strDepartment)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            dt     = new DataTable();
            strSQL = "";
            int Chk = 0;

            strSQL += "SELECT [SectionCode],[Section],[Department],[Division]";
            strSQL += "FROM [SPTOSystem].[dbo].[vewT_Section_Master] ";
            if (strDivision != "" && strDivision != null)
            {
                strSQL += Chk == 0 ? " Where  " : " and  ";

                strSQL += "Substring(sectionCode,1,1) = '" + strDivision + "'";
                Chk++;
            }
            if (strDepartment != "" && strDepartment != null)
            {
                strSQL += Chk == 0 ? " Where  " : " and  ";

                strSQL += "Substring(sectionCode,1,2) = '" + strDepartment + "'";
                Chk++;
            }
            strSQL += "group by  [SectionCode],[Section],[Department],[Division]  ";
            dt      = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
Пример #3
0
        public List <SelectListItem> GetItemDropDownList(string StrSQL, string TextDisplay)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            dt = ObjRun.GetDatatables(StrSQL);
            List <SelectListItem> listItems = new List <SelectListItem>();

            if (dt.Rows.Count != 0)
            {
                listItems.Add(new SelectListItem()
                {
                    Text  = "-- Choose " + TextDisplay + " --",
                    Value = "0"
                });
                foreach (DataRow row in dt.Rows)
                {
                    listItems.Add(new SelectListItem()
                    {
                        Text  = row[0].ToString().Trim(),
                        Value = row[1].ToString().Trim(),
                    });
                }
            }

            return(listItems);
        }
        public List <reqeustInquiry> GetRequestList()
        {
            List <reqeustInquiry> Detail = new List <reqeustInquiry>();


            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "SELECT    * FROM[SPTOSystem].[dbo].[vewOperatorReqChange]";
            strSQL += "  ";
            dt      = ObjRun.GetDatatables(strSQL);


            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Detail.Add(new reqeustInquiry()
                    {
                        DocNo            = row["DocNo"].ToString(),
                        OperatorID       = row["OperatorID"].ToString(),
                        SectionCode      = row["SectionCode"].ToString(),
                        SectionAttribute = row["SectionAttribute"].ToString(),
                        OperatorGroup    = row["OperatorGroup"].ToString(),
                        License          = row["License"].ToString(),
                        Active           = row["Active"].ToString(),
                        ReqOperatorID    = row["ReqOperatorID"].ToString(),
                        ReqDate          = row["ReqDate"].ToString(),
                        ChangeOperatorID = row["ChangeOperatorID"].ToString(),
                        ChangeDate       = row["ChangeDate"].ToString(),
                    });
                }
            }
            return(Detail);
        }
Пример #5
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);
        }
Пример #6
0
        public List <vewOperatorAdditionalDepTemp> GetUserDetail_Additional(string OPID)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "SELECT * FROM [SPTOSystem].[dbo].[vewOperatorAdditionalDepTemp] where [OperatorID] = '" + OPID + "'  order by  [SectionCode] asc ";
            dt     = ObjRun.GetDatatables(strSQL);

            List <vewOperatorAdditionalDepTemp> Temp = new List <vewOperatorAdditionalDepTemp>();

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Temp.Add(new vewOperatorAdditionalDepTemp()
                    {
                        OperatorID  = row["OperatorID"].ToString(),
                        SectionCode = row["SectionCode"].ToString(),
                        Section     = row["Section"].ToString(),
                        Department  = row["Department"].ToString(),
                        Division    = row["Division"].ToString(),
                    });
                }
            }


            return(Temp);
        }
Пример #7
0
        public List <ItemCode_Detail> Get_ItemCode_TableDetail(string ItemCateg)
        {
            var ObjRun = new mgrSQLConnect(_configuration);
            List <ItemCode_Detail> Detail = new List <ItemCode_Detail>();

            strSQL = " select * FROM [SPTOSystem].[dbo].[vewItemCodeList] where ItemCateg = '" + ItemCateg.Trim() + "' order by ItemCode asc ";
            dt     = ObjRun.GetDatatables(strSQL);

            if (dt.Rows.Count != 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Detail.Add(new ItemCode_Detail()
                    {
                        Nbr               = Convert.ToInt32(row["Nbr"].ToString()),
                        ItemCateg         = row["ItemCateg"].ToString(),
                        ItemCode          = row["ItemCode"].ToString(),
                        ItemName          = row["ItemName"].ToString(),
                        DisplayOrder      = Convert.ToInt32(row["DisplayOrder"].ToString()),
                        TimeLimit         = Convert.ToInt32(row["TimeLimit"].ToString()),
                        ValueCodeQuestion = row["ValueCodeQuestion"].ToString(),
                        ValueCodeAnswer   = row["ValueCodeAnswer"].ToString(),
                    });
                }
            }

            return(Detail);
        }
        public List <ExamApproved_Detail> Get_ExamDetail_Approved(string ValueCodeQuestion)
        {
            var ObjRun = new mgrSQLConnect(_configuration);
            List <ExamApproved_Detail> Detail = new List <ExamApproved_Detail>();

            strSQL = "SELECT  [Seq],[Question],count(*) as  Total_ANS ,[ValueStatus],Rewrite_Master FROM [SPTOSystem].[dbo].[vewQuestionAll]" +
                     " where [ValueCodeQuestion] ='" + ValueCodeQuestion + "' and[ValueStatus] != 'RUN'   group by[Seq] ,[Question] ,[ValueStatus],[Rewrite_Master]";
            dt = ObjRun.GetDatatables(strSQL);
            if (dt.Rows.Count != 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Detail.Add(new ExamApproved_Detail()
                    {
                        Seq = Convert.ToInt32(row["Seq"].ToString()),

                        Question       = row["Question"].ToString(),
                        Total_ANS      = Convert.ToInt32(row["Total_ANS"].ToString()),
                        ValueStatus    = row["ValueStatus"].ToString(),
                        Rewrite_Master = Convert.ToInt32(row["Rewrite_Master"].ToString()),
                    });
                }
            }
            return(Detail);
        }
Пример #9
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);
        }
        public List <vewOperatorReqChangeCompare> Get_ApprovedDetail(string DocNO)
        {
            List <vewOperatorReqChangeCompare> Detail = new List <vewOperatorReqChangeCompare>();


            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "SELECT  [DocNo],[Nbr],[Seq],[OperatorID],[New_SectionCode],[New_Section],[New_SectionAttribute],[New_OperatorGroup],[New_GroupName],REPLACE([New_License], ';', ',') as [New_License]";
            strSQL += " ,[New_Active],[ReqOperatorID],[GroupName],[SectionCode],[Section],[SectionAttribute]      ,[License]      ,[Active]   ,CONVERT(varchar, [ReqDate],120) as [ReqDate]  ,ChangeOperatorID   ";
            strSQL += "  FROM[SPTOSystem].[dbo].[vewOperatorReqChangeCompare]  where [DocNo] = '" + DocNO + "'  and ([ChangeOperatorID] is null   or [ChangeOperatorID] = '' ) ";
            dt      = ObjRun.GetDatatables(strSQL);


            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    Detail.Add(new vewOperatorReqChangeCompare()
                    {
                        DocNo                = row["DocNo"].ToString(),
                        Nbr                  = Convert.ToInt32(row["Nbr"].ToString()),
                        Seq                  = row["Seq"].ToString(),
                        OperatorID           = row["OperatorID"].ToString(),
                        New_SectionCode      = row["New_SectionCode"].ToString(),
                        New_Section          = row["New_Section"].ToString(),
                        New_SectionAttribute = row["New_SectionAttribute"].ToString(),
                        New_OperatorGroup    = row["New_OperatorGroup"].ToString(),
                        New_GroupName        = row["New_GroupName"].ToString(),
                        New_License          = row["New_License"].ToString(),
                        New_Active           = row["New_Active"].ToString(),
                        ReqOperatorID        = row["ReqOperatorID"].ToString(),
                        GroupName            = row["GroupName"].ToString(),
                        SectionCode          = row["SectionCode"].ToString(),
                        Section              = row["Section"].ToString(),
                        SectionAttribute     = row["SectionAttribute"].ToString(),
                        License              = row["License"].ToString(),
                        Active               = row["Active"].ToString(),
                        ReqDate              = row["ReqDate"].ToString(),
                        ChangeOperatorID     = row["ChangeOperatorID"].ToString(),


                        //Nbr = Convert.ToInt32(row["Nbr"].ToString()),
                        //DocNo = row["DocNo"].ToString(),
                        //Seq = Convert.ToInt32(row["Seq"].ToString()),
                        //OperatorID = row["OperatorID"].ToString(),
                        //SectionCode = row["SectionCode"].ToString(),
                        //SectionAttribute = row["SectionAttribute"].ToString(),
                        //OperatorGroup = row["OperatorGroup"].ToString(),
                        //License = row["License"].ToString(),
                        //Active = row["Active"].ToString(),
                        //ReqOperatorID = row["ReqOperatorID"].ToString(),
                        //ReqDate = row["ReqDate"].ToString(),
                        //ChangeOperatorID = row["ChangeOperatorID"].ToString(),
                        //ChangeDate = row["ChangeDate"].ToString(),
                    });
                }
            }
            return(Detail);
        }
Пример #11
0
        public _ExamResultList GetDataExamResultList(_excamResultCtrl strCtrl)
        {
            _ExamResultList          resultList = new _ExamResultList();
            mgrSQLConnect            ObjRun     = new mgrSQLConnect(_configuration);
            List <_ExamResultDetail> listItems  = new List <_ExamResultDetail>();

            dt     = new DataTable();
            strSQL = "";
            try
            {
                strSQL  = "sprExamResultInquiry ";
                strSQL += " '" + strCtrl.PlanRefID + "',";
                strSQL += " '" + strCtrl.ItemCateg + "',";
                strSQL += " '" + strCtrl.ItemCode + "',";
                strSQL += " '" + strCtrl.OperatorID + "',";
                strSQL += " '" + strCtrl.StartTime + "',";
                strSQL += " '" + strCtrl.EndTime + "'";


                dt = ObjRun.GetDatatables(strSQL);
                if (dt.Rows.Count != 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        listItems.Add(new _ExamResultDetail()
                        {
                            PlanRefID     = row["PlanRefID"].ToString().Trim(),
                            ItemCateg     = row["ItemCateg"].ToString().Trim(),
                            ItemCategName = row["ItemCategName"].ToString().Trim(),
                            ItemCode      = row["ItemCode"].ToString().Trim(),
                            ItemName      = row["ItemName"].ToString().Trim(),
                            OperatorID    = row["OperatorID"].ToString().Trim(),
                            OperatorName  = row["OperatorName"].ToString().Trim(),
                            Minutes       = row["Minutes"].ToString().Trim(),
                            StartTime     = row["StartTime"].ToString().Trim(),
                            EndTime       = row["EndTime"].ToString().Trim(),
                            Level         = row["Level"].ToString().Trim(),
                            Correct       = row["Correct"].ToString().Trim(),
                            Wrong         = row["Wrong"].ToString().Trim(),
                            Total         = row["Total"].ToString().Trim(),
                            Results       = row["Results"].ToString().Trim(),
                            AddDate       = row["AddDate"].ToString().Trim(),
                        });
                    }
                    resultList.DataExamReultList = listItems;
                    resultList.strResult         = "OK";
                }
                else
                {
                    resultList.strResult = "Data not found";
                }
            }
            catch (Exception e)
            {
                resultList.strResult = "Error : " + e.Message;
            }

            return(resultList);
        }
        public DataTable Get_ValueCode(string Itemcode)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "SELECT [ValueCodeQuestion] ,[ValueCodeAnswer] FROM[SPTOSystem].[dbo].[InputItem] where ItemCode  = '" + Itemcode.Trim() + "'";
            dt     = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
        public DataTable Get_ValueCount(string ValueCodeQuestion)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "SELECT [ValueCodeQuestion] ,ISNULL([Seq],0)  as [Seq],ItemName FROM[SPTOSystem].[dbo].[vewQuestionAll] where[ValueCodeQuestion] ='" + ValueCodeQuestion + "' group by[ValueCodeQuestion], [Seq],ItemName order by[Seq]  desc";
            dt     = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
Пример #14
0
        public DataTable GetDivision_Additional()
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "SELECT [Division]  FROM[SPTOSystem].[dbo].[vewT_Section_Master] with(nolock) group by[Division] order by[Division] asc";
            dt     = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
        public DataTable InputItem_Detail(string Itemcode)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "  select  top 1 [ItemCode],[ValueCodeQuestion], [ValueCodeAnswer],[Rewrite]  ,Convert(nvarchar(16),[UpdDate],120) as [UpdDate]   FROM [SPTOSystem].[dbo].[InputItem] where [ItemCode] = '" + Itemcode.Trim() + "' order by [UpdDate] desc";
            dt     = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
Пример #16
0
        public DataTable GetSection_Additional(string DIV, string DEP)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "SELECT [Section],SectionCode FROM [SPTOSystem].[dbo].[vewT_Section_Master] with(nolock) ";
            strSQL += "where Division = '" + DIV.Trim() + "' and [Department] = '" + DEP.Trim() + "' order by[Section] asc";
            dt      = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
        public string Get_ValueCodeAnswer(string valueCodeQuestion)
        {
            string valueCodeAnswer;
            var    ObjRun = new mgrSQLConnect(_configuration);

            strSQL          = "  select top 1  [ValueCodeAnswer]  FROM [SPTOSystem].[dbo].[vewQuestionAll] where  [ValueCodeQuestion] = '" + valueCodeQuestion.Trim() + "'";
            dt              = ObjRun.GetDatatables(strSQL);
            valueCodeAnswer = dt.Rows[0][0].ToString();
            return(valueCodeAnswer);
        }
        public string HTML_Question_Detail(string ValueQuestion, string ValueAnswer, int Seq, string Job)
        {
            string HTML_Test;
            var    ObjRun = new mgrSQLConnect(_configuration);

            strSQL    = "[dbo].[sprEditQuestion_SelectHTML] '" + ValueQuestion.Trim() + "','" + ValueAnswer.Trim() + "','" + Seq.ToString() + "','0','" + Job + "' ";
            dt        = ObjRun.GetDatatables(strSQL);
            HTML_Test = dt.Rows[0][0].ToString();
            return(HTML_Test);
        }
Пример #19
0
        public string GetStroeTemp_Additional(string OPID, string MakerID, string SectionCode, string Job)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "EXEC [dbo].[sprOperatorSectionAttributeTemp] ";
            strSQL += " '" + Job + "', '" + MakerID + "','" + OPID + "','" + SectionCode.Trim() + "'   ";
            DataTable dt    = ObjRun.GetDatatables(strSQL);
            string    check = dt.Rows[0][0].ToString();

            return(check);
        }
        public DataTable Get_ExamDetail(string Itemcode)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = " select [ItemCode],ItemCategName,[ValueCodeQuestion],[ValueCodeAnswer],ISNULL(Seq,0) as Seq  ,ISNULL([Question],'') as [Question]  ,[InputItemName] ,count(*) as Ans_Count  ";
            strSQL += ",ISNULL((select max(Seq)    FROM   [SPTOSystem].[dbo].[vewQuestionAll]   where[ItemCode] = '" + Itemcode.Trim() + "' and (Rewrite_ValueList = Rewrite_Master or Rewrite_ValueList = 0)),0)  As Max_Seq ,[ValueStatus],Rewrite_Master,[Rewrite_ValueList],Convert(nvarchar(16),[UpdDate],120) as [UpdDate]  FROM[SPTOSystem].[dbo].[vewQuestionAll] where[ItemCode] = '" + Itemcode.Trim() + "' ";
            strSQL += "  and (Rewrite_ValueList = Rewrite_Master or Rewrite_ValueList = 0)   group by[ItemCode], ItemCategName,[ValueCodeQuestion],[ValueCodeAnswer],[Question],[Seq],[InputItemName] ,[ValueStatus],Rewrite_Master,[Rewrite_ValueList],Convert(nvarchar(16),[UpdDate],120)  order by[ValueStatus],[ValueCodeQuestion], Seq";

            dt = ObjRun.GetDatatables(strSQL);
            return(dt);
        }
Пример #21
0
        public DataTable GetGroupName()
        {
            mgrSQLConnect ObjRun = new mgrSQLConnect(_configuration);

            dt     = new DataTable();
            strSQL = "";

            strSQL += "SELECT [OperatorGroup] ,[GroupName] FROM [SPTOSystem].[dbo].[OperatorGroup]";

            dt = ObjRun.GetDatatables(strSQL);

            return(dt);
        }
        public string View_Question(int seq, string ValueCodeQuestion, string ValueCodeAnswer, string ValueStatus)
        {
            string MS     = "";
            var    ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "[dbo].[sprMakeHTMLQuestion] '" + seq.ToString() + "','" + ValueCodeQuestion + "','" + ValueCodeAnswer + "','" + ValueStatus + "'";

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


            return(MS);
        }
        public string Valueslist_Management(string Job, string ValueCode, int Seq, string Value_HTML, string Value_TEXT, string Answer, string Need, string ComputerName, string OPID, string ValueQuestion, string ValueAnswer, int Rewrite)
        {
            string MS;
            var    ObjRun = new mgrSQLConnect(_configuration);

            strSQL = " [dbo].[sprValueList_Management] '" + Job + "', '" + ValueCode + "', '" + Seq + "', N'" + Value_HTML + "', N'" + Value_TEXT + "', " +
                     "'" + Answer + "', '" + Need + "', '" + ComputerName + "', '" + OPID + "', '" + ValueQuestion + "', '" + ValueAnswer + "','" + Rewrite.ToString() + "'  ";

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

            return(MS);
        }
        public string OperatorReqChange(string Flag, string DocNo, string OperatorID, string SectionCode, string SectionAttribute, string OperatorGroup,
                                        string License, string Active, string ReqOperatorID, string ChangeOperatorID)
        {
            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL  = "EXEC [dbo].[sprOperatorReqChange] ";
            strSQL += " '" + Flag + "' ,'" + DocNo + "' ,'" + OperatorID + "','" + SectionCode + "' ,'" + SectionAttribute + "' ,'" + OperatorGroup + "'    ,";
            strSQL += "'" + License + "','" + Active + "'    ,'" + ReqOperatorID + "'    ,'" + ChangeOperatorID + "'     ";

            DataTable dt    = ObjRun.GetDatatables(strSQL);
            string    check = dt.Rows[0][1].ToString();

            return(check);
        }
Пример #25
0
        //public List<SelectListItem> GetCategory(string ItemCategType) {

        //    var ObjRun = new mgrSQLConnect(_configuration);
        //    strSQL = "    SELECT[ItemCateg],[ItemCateg]+' - '+[ItemCategName]  as [ItemCategName] FROM[SPTOSystem].[dbo].[ItemCategory] where ItemCategType ='"+ItemCategType.Trim()+"'group by[ItemCateg],[ItemCategName] order by ItemCateg asc";

        //    dt = ObjRun.GetDatatables(strSQL);
        //    List<SelectListItem> listItems = new List<SelectListItem>();

        //    if (dt.Rows.Count != 0)
        //    {
        //        listItems.Add(new SelectListItem()
        //        {
        //            Text = "--- Choose Category ---",
        //            Value = "0"
        //        });
        //        foreach (DataRow row in dt.Rows)
        //        {
        //            listItems.Add(new SelectListItem()
        //            {
        //                Text =  row["ItemCategName"].ToString().Trim(),
        //                Value = row["ItemCateg"].ToString().Trim(),

        //            });
        //        }
        //    }

        //    return listItems;
        //}

        //public List<SelectListItem> GetCategType()
        //{

        //    var ObjRun = new mgrSQLConnect(_configuration);
        //    strSQL = "    SELECT ItemCategType FROM [SPTOSystem].[dbo].[ItemCategory]  group by ItemCategType order by ItemCategType asc";

        //    dt = ObjRun.GetDatatables(strSQL);
        //    List<SelectListItem> listItems = new List<SelectListItem>();

        //    if (dt.Rows.Count != 0)
        //    {
        //        listItems.Add(new SelectListItem()
        //        {
        //            Text = "--- Choose Type ---",
        //            Value = ""
        //        });
        //        foreach (DataRow row in dt.Rows)
        //        {
        //            listItems.Add(new SelectListItem()
        //            {
        //                Text = row["ItemCategType"].ToString().Trim(),
        //                Value = row["ItemCategType"].ToString().Trim(),

        //            });
        //        }
        //    }

        //    return listItems;
        //}



        public string Itemcode_Management(string Job, string ItemCateg, string ItemCode, string ItemName, int time, int Nbr, string IP, string OPID, string ValueCodeQuestion, string ValueCodeAnswer)
        {
            string MS;
            var    ObjRun = new mgrSQLConnect(_configuration);

            strSQL = "EXEC [dbo].[sprItemCode_Management] '" + Job + "', '" + ItemCateg + "','" + ItemCode + "','" + ItemName + "','" + Nbr + "','" + time + "','" + OPID + "','" + IP + "' ,'" + ValueCodeQuestion + "'  ,'" + ValueCodeAnswer + "'   ";

            dt = ObjRun.GetDatatables(strSQL);

            MS = dt.Rows[0][0].ToString();


            return(MS);
        }
Пример #26
0
        public DataTable GetDivision()
        {
            mgrSQLConnect ObjRun = new mgrSQLConnect(_configuration);

            dt     = new DataTable();
            strSQL = "";

            strSQL += "SELECT Substring(sectionCode,1,1) as sectionCode  ,[Division] " +
                      "FROM [SPTOSystem].[dbo].[vewT_Section_Master] ";
            strSQL += " group by Substring(sectionCode,1,1) ,[Division]  ";

            dt = ObjRun.GetDatatables(strSQL);

            return(dt);
        }
Пример #27
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);
        }
Пример #28
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);
        }
        public string GetExamHTML(string ItemCateg, string ItemCode)
        {
            string HTMLTEXT = "";

            var ObjRun = new mgrSQLConnect(_configuration);

            strSQL = " [dbo].[sprMakeHTMLExam]	'"+ ItemCateg + "', '" + ItemCode + " '";

            dt = ObjRun.GetDatatables(strSQL);

            if (dt.Rows.Count > 0)
            {
                HTMLTEXT = dt.Rows[0][0].ToString();
            }


            return(HTMLTEXT);
        }
Пример #30
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);
        }