Exemple #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());
        }
Exemple #2
0
        public bool DBDelete()
        {
            string cond1 = "dt='" + mDt.ToString(DT._) +
                           "' AND lv='" + Lv.ToString() + "' AND qsid=";
            string cond2 = "dt='" + mDt.ToString(DT._) +
                           "' AND lv='" + Lv.ToString() + "' AND id=";

            foreach (QuestSheet qs in Sheets.Values)
            {
                //int n = DBConnect.Count(conn, "sqz_nee_qsheet", "qsid", cond1 + qs.uId, out eMsg);
                //if (0 < n)
                //    continue;
                if (DBConnect.Delete("sqz_qsheet_quest", cond1 + qs.uId) < 0)
                {
                    return(true);
                }
                if (DBConnect.Delete("sqz_qsheet", cond2 + qs.uId) < 0)
                {
                    return(true);
                }
            }
            return(false);
        }