public string ReadBarkod()
        {
            string strReturn = "";

            try
            {
                int    iClassID      = Pv.Pint(Request["ClassID"]);
                string strCardNumber = Pv.Pstr(Request["CardNumber"]);

                if (iClassID == 0)
                {
                    return("-4");
                }


                RetCode oRet = Util.DB.RunTable("ReadBarcode",
                                                iClassID,
                                                strCardNumber);

                if (oRet.iRet == Back.Ok)
                {
                    strReturn = oRet.ToRow["Done"].ToString();
                }
            }
            catch (Exception eX)
            {
                Util.WriteLog(eX);
            }


            return(strReturn);
        }
        //[HttpPost]
        //public HttpResponseMessage PostOrder(HttpRequestMessage request)
        //{
        //    string body = request.Content.ReadAsStringAsync().Result;
        //    var siparisList = JsonConvert.DeserializeObject<List<JsSiparis>>(body);


        //}


        public string SaveClass()
        {
            string strReturn = "";

            try
            {
                int    iClassID     = Pv.Pint(Request["ClassID"]);
                int    iOperation   = Pv.Pint(Request["Operation"]);
                string strClassName = Pv.Pstr(Request["ClassName"]);

                int    iWorkDay     = Pv.Pint(Request["WorkDay"]);
                string strStartTime = Pv.Pstr(Request["StartTime"]);
                string strEndTime   = Pv.Pstr(Request["EndTime"]);


                if (iOperation == 1)//yeni
                {
                    RetCode oRet = Util.DB.RunTable("ClassInsert",
                                                    strClassName,
                                                    iWorkDay,
                                                    strStartTime,
                                                    strEndTime);

                    iClassID  = Pv.Pint(oRet.ToRow[0]);
                    strReturn = iClassID.ToString();
                }
                else if (iOperation == 2)//edit
                {
                    RetCode oRet = Util.DB.Run("ClassUpdate",
                                               iClassID,
                                               strClassName,
                                               iWorkDay,
                                               strStartTime,
                                               strEndTime);

                    strReturn = "1";
                }
            }
            catch (Exception eX)
            {
                Util.WriteLog(eX);
            }
            return(strReturn);
        }
        public string SaveStudent()
        {
            string strReturn = "";

            try
            {
                int    iOperation     = Pv.Pint(Request["Operation"]);
                int    iStudentID     = Pv.Pint(Request["StudentID"]);
                int    iClassID       = Pv.Pint(Request["ClassID"]);
                string strCardNumber  = Pv.Pstr(Request["CardNumber"]);
                string strStudentName = Pv.Pstr(Request["StudentName"]);


                if (iOperation == 1)//yeni
                {
                    RetCode oRet = Util.DB.RunTable("StudentInsert",
                                                    iClassID,
                                                    strCardNumber,
                                                    strStudentName);

                    iStudentID = Pv.Pint(oRet.ToRow[0]);
                    strReturn  = iStudentID.ToString();
                }
                else if (iOperation == 2)//edit
                {
                    RetCode oRet = Util.DB.Run("StudentUpdate",
                                               iStudentID,
                                               iClassID,
                                               strCardNumber,
                                               strStudentName);

                    strReturn = "1";
                }
            }
            catch (Exception eX)
            {
                Util.WriteLog(eX);
            }
            return(strReturn);
        }
        public string Entrance()
        {
            string strReturn = "";

            try
            {
                //https://attendance.tayeks.com.tr/Out/Entrance?SectionNumber=17&CardNumber=001
                //her bölümün cihaz no su var
                int    iClassID      = Pv.Pint(Request["SectionNumber"]);
                string strCardNumber = Pv.Pstr(Request["CardNumber"]);
                if (iClassID <= 0 || strCardNumber.Length == 0)
                {
                    return("-4");
                }

                RetCode oRet = Util.DB.RunTable("ReadBarcode",
                                                iClassID,
                                                strCardNumber);

                if (oRet.iRet == Back.Ok)
                {
                    strReturn = oRet.ToRow["Done"].ToString();
                    //-1 ise bölüme ait kart değil veya kart no hatalı
                    //-2 ise bu güne ait kayıt var
                    //-3 ise zaman bölüm sıkıntısı var bölüm de tanımlı zaman içinde değil giriş yapılan zaman

                    if (Pv.Pint(strReturn) > 0)
                    {
                        strReturn = "1";
                    }
                }
            }
            catch (Exception eX)
            {
                Util.WriteLog(eX);
            }
            return(strReturn);
        }