Пример #1
0
        public string DBDeleleUnfinishedExaminee()
        {
            StringBuilder sb = new StringBuilder();
            int           n  = DBConnect.Count("sqz_nee_qsheet AS a,sqz_examinee AS b",
                                               "a.dt", "a.dt='" + mDt.ToString(DT._) +
                                               "' AND t='" + mDt.ToString(DT.hh) + "' AND a.dt=b.dt AND a.neeid=b.id");

            sb.AppendFormat(Txt.s._[(int)TxI.SLOT],mDt.ToString(DT.hh));
            if (0 < n)
            {
                sb.Append(Txt.s._[(int)TxI.SLOT_DEL_GRD] + '\n');
                return(sb.ToString());
            }
            else if (n < 0)
            {
                sb.Append(Txt.s._[(int)TxI.SLOT_DEL_ECPT]);
                return(sb.ToString());
            }
            n = DBConnect.Delete("sqz_examinee",
                                 "dt='" + mDt.ToString(DT._) + "' AND t='" + mDt.ToString(DT.hh) + "'");
            if (n < 0)
            {
                sb.Append(Txt.s._[(int)TxI.SLOT_DEL_ECPT]);
            }
            else
            {
                sb.AppendFormat(Txt.s._[(int)TxI.SLOT_DEL_N],n.ToString());
            }
            return(sb.ToString());
        }
Пример #2
0
        public static List <int[]> DBCountItemGroupByModule(Level lv)
        {
            IUx[] IUs_by_Lv        = MultiChoiceItem.GetIUs(lv);
            int[] n_difficultItems = new int[IUs_by_Lv.Length];
            int[] n_allItems       = new int[IUs_by_Lv.Length];
            int   j = -1;

            foreach (IUx i in IUs_by_Lv)
            {
                n_allItems[++j] = DBConnect.Count("sqz_question", "id",
                                                  "moid=" + (int)i + " AND del=0");
                if (n_allItems[j] < 0)
                {
                    n_allItems[++j] = 0;
                }
                n_difficultItems[j] = DBConnect.Count("sqz_question", "id",
                                                      "moid=" + (int)i + " AND diff=1 AND del=0");
                if (n_difficultItems[j] < 0)
                {
                    n_difficultItems[j] = 0;
                }
            }
            List <int[]> n = new List <int[]>();

            n.Add(n_allItems);
            n.Add(n_difficultItems);
            return(n);
        }
Пример #3
0
        public static int DBGetND(IUx iu)
        {
            int n = DBConnect.Count("sqz_question", "id",
                                    "moid=" + (int)iu + " AND diff=1 AND del=0");

            if (n < 0)
            {
                n = 0;
            }
            return(n);
        }