Пример #1
0
        /// <summary>根据排序值重新设置排序</summary>
        public static void SetTableOrderNum(string pid)
        {
            _WebSpiderInfoTable = DataOften.GetSortTable(_WebSpiderInfoTable, "OrderNum asc");
            int sn = 1;

            for (int i = 0; i < _WebSpiderInfoTable.Rows.Count; i++)
            {
                if (pid != "")
                {
                    string spid = _WebSpiderInfoTable.Rows[i]["SpiderID"].ToString().Trim();
                    if (spid == pid)
                    {
                        _WebSpiderInfoTable.Rows[i]["OrderNum"] = sn;
                        sn++;
                    }
                }
                else
                {
                    _WebSpiderInfoTable.Rows[i]["OrderNum"] = sn;
                    sn++;
                }
            }
            string upath = wapp.AppList.SaveConfigPath + _WebSpiderInfoTable.TableName + ".xml";

            if (File.Exists(upath))
            {
                File.Delete(upath);
            }
            _WebSpiderInfoTable.WriteXml(upath, XmlWriteMode.WriteSchema);
        }
Пример #2
0
 private void btbuild_Click(object sender, EventArgs e)
 {
     if (listv.SelectedItems.Count > 0)
     {
         string ids = listv.SelectedItems[0].Name;
         if (ids != "")
         {
             DataTable dt   = wapp.SQLiteConn.Sqllite.GetDT("select * from tklb where zid=?", ids);
             int       yxsl = DataOften.GetInt(dt, "yxsl", "0");
             if (yxsl <= 0)
             {
                 wapp.MessageBoxEx.Show(this, "该题库至少需要一条有效的题目!", "系统提示");
                 return;
             }
             using (BuildTestPaper form = new BuildTestPaper())
             {
                 form.tkid          = ids;
                 form.StartPosition = FormStartPosition.CenterParent;
                 form.ShowDialog(this);
             }
         }
     }
     else
     {
         wapp.MessageBoxEx.Show(this, "请选择需要生成试卷的题库!", "系统提示");
     }
 }
Пример #3
0
        private void LoadInfo()
        {
            DataRow[] idrs = wapp.WebSpiderInfoList.WebSpiderInfoTable.Select("ListID='" + ids + "'");
            if (idrs.Length > 0)
            {
                infodt = DataOften.GetTable(idrs);
            }
            else
            {
                WinOften.MessShow("该信息不存在或已被删除!", 1);
                this.Close();
                return;
            }
            tbListTitle.Text             = DataOften.GetStr(infodt, "ListTitle");
            tbListCode.Text              = DataOften.GetStr(infodt, "ListCode");
            tbOrderNum.Text              = DataOften.GetStr(infodt, "OrderNum");
            rTBContentRule.Text          = DataOften.GetStr(infodt, "ContentRule");
            rTBContentRangeRule.Text     = DataOften.GetStr(infodt, "ContentRangeRule");
            tbContentRuleIndex.Text      = DataOften.GetStr(infodt, "ContentRuleIndex");
            tbContentRangeRuleIndex.Text = DataOften.GetStr(infodt, "ContentRangeRuleIndex");
            rTBContentRegFilt.Text       = DataOften.GetStr(infodt, "ContentRegFilt");
            wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "ContentType"), rbctype);
            wapp.AppPub.SelectComboBoxItems(cBContentCodeMode, DataOften.GetStr(infodt, "ContentCodeMode"));
            string cf = DataOften.GetStr(infodt, "ContentFilt");

            cflist = wapp.AppPub.GetIntList(cf, 4);
            wapp.AppPub.SetRadioListChecked(cflist[0].ToString(), rbcfilta);
            wapp.AppPub.SetRadioListChecked(cflist[1].ToString(), rbcfiltb);
            wapp.AppPub.SetRadioListChecked(cflist[2].ToString(), rbcfiltc);
            wapp.AppPub.SetRadioListChecked(cflist[3].ToString(), rbcfiltd);
        }
Пример #4
0
        private void LoadList()
        {
            StringBuilder sb       = new StringBuilder();
            DataTable     dt       = null;
            int           s_rstyle = pub.GetInt(AppPub.GetDropDownValue(cBrstyle), "-1");

            if (s_rstyle > -1)
            {
                pub.StrAdd(ref sb, " rstyle=" + s_rstyle.ToString() + " ", " and ");
            }
            int s_lv = pub.GetInt(AppPub.GetDropDownValue(cBlv), "-1");

            if (s_lv > -1)
            {
                pub.StrAdd(ref sb, " level=" + s_lv.ToString() + " ", " and ");
            }
            int s_zt = pub.GetInt(AppPub.GetDropDownValue(cBzt), "-1");

            if (s_zt > -1)
            {
                pub.StrAdd(ref sb, " isuse=" + s_zt.ToString() + " ", " and ");
            }
            string sxm  = AppPub.GetDropDownValue(cBsxm);
            string skey = tBskey.Text.Trim();

            if (skey != "")
            {
                pub.StrAdd(ref sb, " " + sxm + " like '%" + skey + "%' ", " and ");
            }
            if (sb.Length > 0)
            {
                dt = App.DataOften.GetTable(App.MayorsPowers.MayorsPowerTable.Select(sb.ToString()));
            }
            else
            {
                dt = App.MayorsPowers.MayorsPowerTable;
            }
            vlist.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListViewItem itema = new ListViewItem((i + 1).ToString(), 0);
                string       level = WebOften.GetListVal(AppList.L_MayorsLevel(), DataOften.GetVal(dt, "level", i));
                itema.SubItems.Add(level);
                string rstyle = WebOften.GetListVal(AppList.L_MayorsRewardStyle(), DataOften.GetVal(dt, "rstyle", i));
                itema.SubItems.Add(rstyle);
                itema.SubItems.Add(DataOften.GetVal(dt, "depict", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "name", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "sign", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "min", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "max", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "dw", i));
                itema.SubItems.Add(DataOften.GetVal(dt, "mtype", i));
                string qy = WebOften.GetListVal(AppList.L_IsUser(), DataOften.GetVal(dt, "isuse", i));
                AppPub.SetSubItemsStyle(ref itema, qy, "已起用|已停用", "#69CE1F|#FF0000");
                itema.SubItems.Add(DataOften.GetVal(dt, "mid", i));
                vlist.Items.AddRange(new ListViewItem[] { itema });
            }
        }
Пример #5
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据表</param>
        /// <param name="cname">列名</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static int GetInt(DataTable dt, string cname, string defval)
        {
            string val = DataOften.GetStr(dt, cname);

            if (!Often.IsInt32(val))
            {
                val = defval;
            }
            return(Convert.ToInt32(val));
        }
Пример #6
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据表</param>
        /// <param name="cname">列名</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetDouble(DataTable dt, string cname, string defval)
        {
            string val = DataOften.GetStr(dt, cname);

            if (!Often.IsNum(val))
            {
                val = defval;
            }
            return(Convert.ToDouble(val));
        }
Пример #7
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dr">数据行集合</param>
        /// <param name="cname">列名</param>
        /// <param name="row">行索引</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetDouble(DataRow[] dr, string cname, int row, string defval)
        {
            string val = DataOften.GetStr(dr, cname, row);

            if (!Often.IsNum(val))
            {
                val = defval;
            }
            return(Convert.ToDouble(val));
        }
Пример #8
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据表</param>
        /// <param name="cname">列名</param>
        /// <param name="row">行索引</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static int GetInt(DataTable dt, string cname, int row)
        {
            string val = DataOften.GetStr(dt, cname, row);

            if (!Often.IsInt32(val))
            {
                val = "0";
            }
            return(Convert.ToInt32(val));
        }
Пример #9
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dr">数据行集合</param>
        /// <param name="cname">列名</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static int GetInt(DataRow[] dr, string cname)
        {
            string val = DataOften.GetStr(dr, cname);

            if (!Often.IsInt32(val))
            {
                val = "0";
            }
            return(Convert.ToInt32(val));
        }
Пример #10
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据行集合</param>
        /// <param name="cname">列名</param>
        /// <param name="row">行索引</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static int GetInt(DataRow[] dr, string cname, int row, string defval)
        {
            string val = DataOften.GetStr(dr, cname, row);

            if (!Often.IsInt32(val))
            {
                val = defval;
            }
            return(Convert.ToInt32(val));
        }
Пример #11
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据表</param>
        /// <param name="cname">列名</param>
        /// <param name="row">行索引</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetNumber(DataTable dt, string cname, int row, string defval)
        {
            string val = DataOften.GetStr(dt, cname, row);

            if (!Often.IsNum(val))
            {
                val = defval;
            }
            return(GetHoldDigit(Convert.ToDouble(val), 2));
        }
Пример #12
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dr">数据行集合</param>
        /// <param name="cname">列名</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetDouble(DataRow[] dr, string cname)
        {
            string val = DataOften.GetStr(dr, cname);

            if (!Often.IsNum(val))
            {
                val = "0";
            }
            return(Convert.ToDouble(val));
        }
Пример #13
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dr">数据行集合</param>
        /// <param name="cname">列名</param>
        /// <param name="defval">默认值</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetNumber(DataRow[] dr, string cname, string defval)
        {
            string val = DataOften.GetStr(dr, cname);

            if (!Often.IsNum(val))
            {
                val = defval;
            }
            return(GetHoldDigit(Convert.ToDouble(val), 2));
        }
Пример #14
0
        /// <summary>返回数据表字段的数字格式</summary>
        /// <param name="dt">数据表</param>
        /// <param name="cname">列名</param>
        /// <param name="row">行索引</param>
        /// <returns>返回数据表字段的数字格式</returns>
        public static double GetDouble(DataTable dt, string cname, int row)
        {
            string val = DataOften.GetStr(dt, cname, row);

            if (!Often.IsNum(val))
            {
                val = "0";
            }
            return(Convert.ToDouble(val));
        }
Пример #15
0
 private void Form1_Load(object sender, EventArgs e)
 {
     App.Win.Utils.SetComboBoxItems(cBdc, "|全部||" + wapp.AppList.AnswerResult(), "");
     cBdc.SelectedIndex = 0;
     tkdt       = wapp.SQLiteConn.Sqllite.GetDT("select * from tklb where zid=?", tkid);
     ltkbt.Text = DataOften.GetStr(tkdt, "bt");
     tmdt       = wapp.SQLiteConn.Sqllite.GetDT("select * from tmlb where zid=?", tmid);
     ltmbt.Text = DataOften.GetStr(tmdt, "tm");
     LoadList();
     isLoad = true;
 }
Пример #16
0
        /// <summary>根据ArrayList返回SQLiteCommand(string类型List数组传递参数)</summary>
        /// <param name="dataTypes">对应索引数据参数操作类型数组,1 长字符串,2 日期型Null值,3 长整数型Null值,4 浮点Null值,其它 字符型</param>
        /// <param name="param">string类型List数组</param>
        /// <returns>返回一个SQLiteCommand</returns>
        public static SQLiteCommand GetSqlArrCom(List <int> dataTypes, List <string> param)
        {
            SQLiteCommand ArrayCom = new SQLiteCommand();

            if (param == null)
            {
                return(ArrayCom);
            }
            for (int i = 0; i < param.Count; i++)
            {
                ParametersAdd(ref ArrayCom, DataOften.GetIntListVal(dataTypes, i), "@Par" + i, param[i]);
            }
            return(ArrayCom);
        }
Пример #17
0
        /// <summary>根据排序值重新设置排序</summary>
        public static void SetTableOrderNum()
        {
            _WebSpiderTable = DataOften.GetSortTable(_WebSpiderTable, "OrderNum asc");
            for (int i = 0; i < _WebSpiderTable.Rows.Count; i++)
            {
                _WebSpiderTable.Rows[i]["OrderNum"] = i + 1;
            }
            string upath = wapp.AppList.SaveConfigPath + _WebSpiderTable.TableName + ".xml";

            if (File.Exists(upath))
            {
                File.Delete(upath);
            }
            _WebSpiderTable.WriteXml(upath, XmlWriteMode.WriteSchema);
        }
Пример #18
0
 private void LoadSpiderInfoList()
 {
     DataRow[] drs = wapp.WebSpiderInfoList.WebSpiderInfoTable.Select("SpiderID='" + pids + "'");
     cldt = DataOften.GetTable(drs);
     contentlist.Items.Clear();
     for (int i = 0; i < cldt.Rows.Count; i++)
     {
         ListViewItem itema = new ListViewItem(cldt.Rows[i]["OrderNum"].ToString().Trim(), 0);
         itema.SubItems.Add(cldt.Rows[i]["ListTitle"].ToString().Trim());
         itema.SubItems.Add(cldt.Rows[i]["ListCode"].ToString().Trim());
         itema.SubItems.Add(WebOften.GetListVal(wapp.AppList.ContentType(), cldt.Rows[i]["ContentType"].ToString().Trim()));
         itema.SubItems.Add(cldt.Rows[i]["ListID"].ToString().Trim());
         contentlist.Items.AddRange(new ListViewItem[] { itema });
     }
 }
Пример #19
0
        /// <summary>保存网络蜘蛛列表</summary>
        /// <param name="wsi">网络蜘蛛明细对象</param>
        public static void SaveWebSpiderInfoTable(WebSpiderInfo wsi)
        {
            string upath = wapp.AppList.SaveConfigPath + _WebSpiderInfoTable.TableName + ".xml";

            if (wsi != null)
            {
                DateTime  dqrq = DateTime.Now;
                DataRow[] dr   = _WebSpiderInfoTable.Select("ListTitle='" + wsi.ListTitle + "'");
                if (dr.Length > 0)
                {
                    dr[0]["ListTitle"]             = wsi.ListTitle;
                    dr[0]["ListCode"]              = wsi.ListCode;
                    dr[0]["ContentRangeRule"]      = wsi.ContentRangeRule;
                    dr[0]["ContentRule"]           = wsi.ContentRule;
                    dr[0]["ContentRangeRuleIndex"] = wsi.ContentRangeRuleIndex;
                    dr[0]["ContentRuleIndex"]      = wsi.ContentRuleIndex;
                    dr[0]["ContentFilt"]           = wsi.ContentFilt;
                    dr[0]["ContentRegFilt"]        = wsi.ContentRegFilt;
                    dr[0]["ContentType"]           = wsi.ContentType;
                    dr[0]["OrderNum"]              = wsi.OrderNum;
                    dr[0]["ContentCodeMode"]       = wsi.ContentCodeMode;
                }
                else
                {
                    DataRow newRow = _WebSpiderInfoTable.NewRow();
                    newRow["ListID"]                = wsi.ListID;
                    newRow["SpiderID"]              = wsi.SpiderID;
                    newRow["ListTitle"]             = wsi.ListTitle;
                    newRow["ListCode"]              = wsi.ListCode;
                    newRow["ContentRangeRule"]      = wsi.ContentRangeRule;
                    newRow["ContentRule"]           = wsi.ContentRule;
                    newRow["ContentRangeRuleIndex"] = wsi.ContentRangeRuleIndex;
                    newRow["ContentRuleIndex"]      = wsi.ContentRuleIndex;
                    newRow["ContentFilt"]           = wsi.ContentFilt;
                    newRow["ContentRegFilt"]        = wsi.ContentRegFilt;
                    newRow["ContentType"]           = wsi.ContentType;
                    newRow["OrderNum"]              = wsi.OrderNum;
                    newRow["ContentCodeMode"]       = wsi.ContentCodeMode;
                    _WebSpiderInfoTable.Rows.Add(newRow);
                }
            }
            if (File.Exists(upath))
            {
                File.Delete(upath);
            }
            _WebSpiderInfoTable = DataOften.GetSortTable(_WebSpiderInfoTable, "OrderNum asc");
            _WebSpiderInfoTable.WriteXml(upath, XmlWriteMode.WriteSchema);
        }
Пример #20
0
 private void Form_Load(object sender, EventArgs e)
 {
     bW.WorkerSupportsCancellation = true;
     App.Win.Utils.SetComboBoxItems(cBlx, "|全部||" + wapp.AppList.SubjectType(), "");
     cBlx.SelectedIndex = 0;
     App.Win.Utils.SetComboBoxItems(cBuse, "|全部||" + wapp.AppList.IsUser(), "");
     cBuse.SelectedIndex = 0;
     App.Win.Utils.SetComboBoxItems(cBmb, wapp.AppList.SearchTarget(), "");
     cBmb.SelectedIndex = 0;
     App.Win.Utils.SetComboBoxItems(cBhs, wapp.AppList.RowNumbers(), "");
     cBhs.SelectedIndex = 0;
     tkdt       = wapp.SQLiteConn.Sqllite.GetDT("select * from tklb where zid=?", tkid);
     ltkbt.Text = DataOften.GetStr(tkdt, "bt");
     LoadList(1);
     isLoad = true;
 }
Пример #21
0
 private void FrmAnswerInfo_Load(object sender, EventArgs e)
 {
     cBpx.Checked = false;
     ppx.Enabled  = false;
     tBpx.Text    = "";
     tkdt         = wapp.SQLiteConn.Sqllite.GetDT("select * from tklb where zid=?", tkid);
     ltkbt.Text   = DataOften.GetStr(tkdt, "bt");
     tmdt         = wapp.SQLiteConn.Sqllite.GetDT("select * from tmlb where zid=?", tmid);
     ltmbt.Text   = DataOften.GetStr(tmdt, "tm");
     if (daid != "")
     {
         DataTable dadt = wapp.SQLiteConn.Sqllite.GetDT("select * from dalb where zid=?", daid);
         if (dadt != null && dadt.Rows.Count > 0)
         {
             rTextName.Text = App.DataOften.GetStr(dadt, "dan");
             string dc = App.DataOften.GetStr(dadt, "dc");
             if (dc == "1")
             {
                 rB1.Checked = true;
             }
             else
             {
                 rB2.Checked = true;
             }
             gB.Enabled = false;
             int px = App.Often.GetInt(App.DataOften.GetStr(dadt, "px"), "0");
             if (px > 0)
             {
                 cBpx.Checked = true;
                 ppx.Enabled  = true;
                 tBpx.Text    = px.ToString();
             }
             IsEdit = true;
         }
     }
     if (IsEdit)
     {
         this.Text = "编辑答案";
     }
     else
     {
         this.Text = "新增答案";
     }
 }
Пример #22
0
 private void LoadUserInfo()
 {
     DataRow[] udrs = wapp.UserList.UsersTable.Select("UserName='******'");
     if (udrs.Length > 0)
     {
         userdt = DataOften.GetTable(udrs);
     }
     else
     {
         WinOften.MessShow("该用户不存在或已被删除!", 1);
         this.Close();
         return;
     }
     tbfPwd.Enabled  = false;
     tbName.Text     = DataOften.GetStr(userdt, "UserName");
     tbrealName.Text = DataOften.GetStr(userdt, "RealName");
     tbphone.Text    = DataOften.GetStr(userdt, "Phones");
     tbPwd.Text      = "      ";
     tbName.Enabled  = false;
 }
Пример #23
0
 private void LoadInfo()
 {
     DataRow[] idrs = wapp.WebSpiderList.WebSpiderTable.Select("SpiderID='" + ids + "'");
     if (idrs.Length > 0)
     {
         infodt = DataOften.GetTable(idrs);
     }
     else
     {
         WinOften.MessShow("该信息不存在或已被删除!", 1);
         this.Close();
         return;
     }
     btset.Visible                = true;
     tbSpiderName.Text            = DataOften.GetStr(infodt, "SpiderName");
     tbOrderNum.Text              = DataOften.GetStr(infodt, "OrderNum");
     rTBUrlList.Text              = DataOften.GetStr(infodt, "UrlList");
     rTBUrlRule.Text              = DataOften.GetStr(infodt, "UrlRule");
     rTBUrlRangeRule.Text         = DataOften.GetStr(infodt, "UrlRangeRule");
     tbUrlRuleIndex.Text          = DataOften.GetStr(infodt, "UrlRuleIndex");
     tbUrlRangeRuleIndex.Text     = DataOften.GetStr(infodt, "UrlRangeRuleIndex");
     tbExcelSavePath.Text         = DataOften.GetStr(infodt, "ExcelSavePath");
     tbHtmlSavePath.Text          = DataOften.GetStr(infodt, "HtmlSavePath");
     tbGatherMaxNum.Text          = DataOften.GetStr(infodt, "GatherMaxNum");
     cBPageCoding.Text            = DataOften.GetStr(infodt, "PageCoding");
     rTBNextRangeRule.Text        = DataOften.GetStr(infodt, "NextRangeRule");
     rTBNextRule.Text             = DataOften.GetStr(infodt, "NextRule");
     rTBConNextRangeRule.Text     = DataOften.GetStr(infodt, "ConNextRangeRule");
     rTBConNextRule.Text          = DataOften.GetStr(infodt, "ConNextRule");
     tbNextRangeRuleIndex.Text    = DataOften.GetStr(infodt, "NextRangeRuleIndex");
     tbNextRuleIndex.Text         = DataOften.GetStr(infodt, "NextRuleIndex");
     tbConNextRangeRuleIndex.Text = DataOften.GetStr(infodt, "ConNextRangeRuleIndex");
     tbConNextRuleIndex.Text      = DataOften.GetStr(infodt, "ConNextRuleIndex");
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "IsSaveHtml"), rbishtml);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "CodingMode"), rbcmode);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "IsEcho"), rbisecho);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "IsNext"), rbisnext);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "ConIsNext"), rbcisnext);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "NextMode"), rbnmode);
     wapp.AppPub.SetRadioListChecked(DataOften.GetStr(infodt, "ConNextMode"), rbcnmode);
 }
Пример #24
0
        public void LoadList()
        {
            StringBuilder sb = new StringBuilder();
            List <string> li = new List <string>();

            DataOften.SqlAddArr("tmid=?", tmid, ref sb, ref li);
            string cname = tBName.Text.Trim();

            if (cname != "")
            {
                DataOften.SqlAddArr("dan like ?", "%" + cname + "%", ref sb, ref li);
            }
            string dc = App.Win.Utils.GetComboBoxValue(cBdc);

            if (dc != "")
            {
                DataOften.SqlAddArr("dc = ?", dc, ref sb, ref li);
            }
            DataOften.SqlAddWhere(ref sb);
            string sql = "select * from dalb " + sb.ToString();

            dadt = wapp.SQLiteConn.Sqllite.GetDT(sql, li);
            int xh = 1;

            listv.Items.Clear();
            for (int i = 0; i < dadt.Rows.Count; i++)
            {
                string       zid   = dadt.Rows[i]["zid"].ToString().Trim();
                ListViewItem itema = new ListViewItem("", 0);
                itema.UseItemStyleForSubItems = false;
                itema.Name = zid;
                itema.SubItems.Add((xh + i).ToString());
                itema.SubItems.Add(dadt.Rows[i]["dan"].ToString().Trim());
                string dcs = dadt.Rows[i]["dc"].ToString().Trim();
                itema.SubItems.Add(App.Web.WebOften.GetListVal(wapp.AppList.AnswerResult(), dcs));
                wapp.pub.setResultColor(itema.SubItems[itema.SubItems.Count - 1], dcs);
                itema.SubItems.Add(dadt.Rows[i]["px"].ToString().Trim());
                listv.Items.AddRange(new ListViewItem[] { itema });
            }
            cBallsel.Checked = false;
        }
Пример #25
0
        private void btsave_Click(object sender, EventArgs e)
        {
            if (!IsRunOper())
            {
                return;
            }
            string name = tbName.Text.Trim();

            if (OpMode == 0)
            {
                DataRow[] udrs = wapp.UserList.UsersTable.Select("UserName='******'");
                if (udrs.Length > 0)
                {
                    WinOften.MessShow("用户名已存在!", 1);
                    return;
                }
            }
            int mv = 60;

            wapp.SysUser su = new wapp.SysUser();
            su.UserName = name;
            su.UserPwd  = tbPwd.Text.Trim();
            su.ManageLv = mv;
            su.RealName = tbrealName.Text.Trim();
            su.Phones   = tbphone.Text.Trim();
            if (OpMode == 1)
            {
                su.LoginDate = Convert.ToDateTime(DataOften.GetStr(userdt, "LoginDate"));
            }
            else
            {
                su.LoginDate = Convert.ToDateTime("1990-01-01");
            }
            wapp.UserList.SaveUsersTable(su);
            WinOften.MessShow("保存成功!", 0);
            IsOper = true;
            this.Close();
        }
Пример #26
0
 private void FrmSubjectInfo_Load(object sender, EventArgs e)
 {
     tkdt       = wapp.SQLiteConn.Sqllite.GetDT("select * from tklb where zid=?", tkid);
     ltkbt.Text = DataOften.GetStr(tkdt, "bt");
     if (tmid != "")
     {
         tmdt = wapp.SQLiteConn.Sqllite.GetDT("select * from tmlb where zid=?", tmid);
         if (tmdt != null && tmdt.Rows.Count > 0)
         {
             rTextName.Text = App.DataOften.GetStr(tmdt, "tm");
             rTBdajx.Text   = App.DataOften.GetStr(tmdt, "dajx");
             string lx = App.DataOften.GetStr(tmdt, "lx");
             if (lx == "1")
             {
                 rB2.Checked = true;
             }
             else if (lx == "2")
             {
                 rB3.Checked = true;
             }
             else
             {
                 rB1.Checked = true;
             }
             gB.Enabled = false;
             IsEdit     = true;
         }
     }
     if (IsEdit)
     {
         this.Text = "编辑题目";
     }
     else
     {
         this.Text = "新增题目";
     }
 }
Пример #27
0
        public void LoadList(int pageNum)
        {
            centPage.PageNum   = pageNum;
            centPage.DataCount = 0;
            centPage.EachCount = App.Often.GetInt(App.Win.Utils.GetComboBoxValue(cBhs));
            StringBuilder sb    = new StringBuilder();
            List <string> li    = new List <string>();
            string        cname = tBName.Text.Trim();

            if (cname != "")
            {
                DataOften.SqlAddArr("bt like ?", "%" + cname + "%", ref sb, ref li);
            }
            DataOften.SqlAddWhere(ref sb);
            centPage.DataCount = App.Often.GetInt(wapp.SQLiteConn.Sqllite.GetES("select count(0) from tklb " + sb.ToString(), li));
            centPage.SetCent();
            string    sql = "select * from tklb " + sb.ToString() + " limit " + centPage.EachCount.ToString() + " offset " + centPage.StartData.ToString();
            DataTable dt  = wapp.SQLiteConn.Sqllite.GetDT(sql, li);
            int       xh  = centPage.StartData + 1;

            listv.Items.Clear();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string       zid   = dt.Rows[i]["zid"].ToString().Trim();
                ListViewItem itema = new ListViewItem("", 0);
                itema.Name = zid;
                itema.SubItems.Add((xh + i).ToString());
                itema.SubItems.Add(dt.Rows[i]["bt"].ToString().Trim());
                itema.SubItems.Add(dt.Rows[i]["sl"].ToString().Trim());
                itema.SubItems.Add(dt.Rows[i]["yxsl"].ToString().Trim());
                itema.SubItems.Add(dt.Rows[i]["wxsl"].ToString().Trim());
                itema.SubItems.Add(dt.Rows[i]["ms"].ToString().Trim());
                listv.Items.AddRange(new ListViewItem[] { itema });
            }
            cBallsel.Checked = false;
        }
Пример #28
0
        private void LoadInfo()
        {
            rBsign1.Enabled = false;
            rBsign2.Enabled = false;
            rBsign3.Enabled = false;
            rBdw1.Enabled   = false;
            rBdw2.Enabled   = false;
            DataRow[] drs = App.MayorsPowers.MayorsPowerTable.Select("mid='" + ids + "'");
            if (drs.Length > 0)
            {
                dt = DataOften.GetTable(drs);
            }
            else
            {
                MessageBox.Show("信息不存在或已被删除!");
                this.Close();
                return;
            }
            string level = DataOften.GetVal(dt, "level");

            llevel.Text = WebOften.GetListVal(AppList.L_MayorsLevel(), level);
            string rstyle = DataOften.GetVal(dt, "rstyle");

            lstyle.Text   = WebOften.GetListVal(AppList.L_MayorsRewardStyle(), rstyle);
            tBname.Text   = DataOften.GetVal(dt, "name");
            tBdepict.Text = DataOften.GetVal(dt, "depict");
            tBmin.Text    = DataOften.GetVal(dt, "min");
            tBmax.Text    = DataOften.GetVal(dt, "max");
            string sign = DataOften.GetVal(dt, "sign");

            if (sign == "+")
            {
                rBsign1.Checked = true;
            }
            else if (sign == "-")
            {
                rBsign2.Checked = true;
            }
            else if (sign == "=")
            {
                rBsign3.Checked = true;
            }
            string dw = DataOften.GetVal(dt, "dw");

            if (dw == "%")
            {
                rBdw2.Checked = true;
            }
            else
            {
                rBdw1.Checked = true;
            }
            tBmtype.Text = DataOften.GetVal(dt, "mtype");
            string sign_limit = DataOften.GetVal(dt, "sign_limit");
            string dw_limit   = DataOften.GetVal(dt, "dw_limit");

            if (sign_limit.IndexOf("+") > -1)
            {
                rBsign1.Enabled = true;
            }
            else
            {
                rBsign1.Checked = false;
            }
            if (sign_limit.IndexOf("-") > -1)
            {
                rBsign2.Enabled = true;
            }
            else
            {
                rBsign2.Checked = false;
            }
            if (sign_limit.IndexOf("=") > -1)
            {
                rBsign3.Enabled = true;
            }
            else
            {
                rBsign3.Checked = false;
            }
            if (dw_limit == "")
            {
                rBdw1.Enabled = true;
                rBdw2.Enabled = false;
                rBdw2.Checked = false;
            }
            else if (dw_limit == "%")
            {
                rBdw1.Enabled = false;
                rBdw1.Checked = false;
                rBdw2.Enabled = true;
            }
            else if (dw_limit == ",%")
            {
                rBdw1.Enabled = true;
                rBdw2.Enabled = true;
            }
        }
Пример #29
0
        /// <summary>保存网络蜘蛛列表</summary>
        /// <param name="ws">网络蜘蛛对象</param>
        public static void SaveWebSpiderTable(WebSpider ws)
        {
            string upath = wapp.AppList.SaveConfigPath + _WebSpiderTable.TableName + ".xml";

            if (ws != null)
            {
                DateTime  dqrq = DateTime.Now;
                DataRow[] dr   = _WebSpiderTable.Select("SpiderName='" + ws.SpiderName + "'");
                if (dr.Length > 0)
                {
                    dr[0]["UrlList"]               = ws.UrlList;
                    dr[0]["UrlRangeRule"]          = ws.UrlRangeRule;
                    dr[0]["UrlRule"]               = ws.UrlRule;
                    dr[0]["UrlRangeRuleIndex"]     = ws.UrlRangeRuleIndex;
                    dr[0]["UrlRuleIndex"]          = ws.UrlRuleIndex;
                    dr[0]["IsSaveHtml"]            = ws.IsSaveHtml;
                    dr[0]["HtmlSavePath"]          = ws.HtmlSavePath;
                    dr[0]["ExcelSavePath"]         = ws.ExcelSavePath;
                    dr[0]["OrderNum"]              = ws.OrderNum;
                    dr[0]["OperDate"]              = dqrq;
                    dr[0]["NextRangeRule"]         = ws.NextRangeRule;
                    dr[0]["NextRule"]              = ws.NextRule;
                    dr[0]["NextRangeRuleIndex"]    = ws.NextRangeRuleIndex;
                    dr[0]["NextRuleIndex"]         = ws.NextRuleIndex;
                    dr[0]["CodingMode"]            = ws.CodingMode;
                    dr[0]["UrlRangeRule"]          = ws.UrlRangeRule;
                    dr[0]["PageCoding"]            = ws.PageCoding;
                    dr[0]["GatherMaxNum"]          = ws.GatherMaxNum;
                    dr[0]["IsEcho"]                = ws.IsEcho;
                    dr[0]["IsNext"]                = ws.IsNext;
                    dr[0]["NextMode"]              = ws.NextMode;
                    dr[0]["ConNextRangeRule"]      = ws.ConNextRangeRule;
                    dr[0]["ConNextRule"]           = ws.ConNextRule;
                    dr[0]["ConNextRangeRuleIndex"] = ws.ConNextRangeRuleIndex;
                    dr[0]["ConNextRuleIndex"]      = ws.ConNextRuleIndex;
                    dr[0]["ConIsNext"]             = ws.ConIsNext;
                    dr[0]["ConNextMode"]           = ws.ConNextMode;
                    dr[0]["ConIsNext"]             = ws.ConIsNext;
                    dr[0]["ConNextMode"]           = ws.ConNextMode;
                }
                else
                {
                    DataRow newRow = _WebSpiderTable.NewRow();
                    newRow["SpiderID"]              = ws.SpiderID;
                    newRow["SpiderName"]            = ws.SpiderName;
                    newRow["UrlList"]               = ws.UrlList;
                    newRow["UrlRangeRule"]          = ws.UrlRangeRule;
                    newRow["UrlRule"]               = ws.UrlRule;
                    newRow["UrlRangeRuleIndex"]     = ws.UrlRangeRuleIndex;
                    newRow["UrlRuleIndex"]          = ws.UrlRuleIndex;
                    newRow["IsSaveHtml"]            = ws.IsSaveHtml;
                    newRow["HtmlSavePath"]          = ws.HtmlSavePath;
                    newRow["ExcelSavePath"]         = ws.ExcelSavePath;
                    newRow["OrderNum"]              = ws.OrderNum;
                    newRow["AddDate"]               = dqrq;
                    newRow["OperDate"]              = dqrq;
                    newRow["NextRangeRule"]         = ws.NextRangeRule;
                    newRow["NextRule"]              = ws.NextRule;
                    newRow["NextRangeRuleIndex"]    = ws.NextRangeRuleIndex;
                    newRow["NextRuleIndex"]         = ws.NextRuleIndex;
                    newRow["CodingMode"]            = ws.CodingMode;
                    newRow["UrlRangeRule"]          = ws.UrlRangeRule;
                    newRow["PageCoding"]            = ws.PageCoding;
                    newRow["GatherMaxNum"]          = ws.GatherMaxNum;
                    newRow["IsEcho"]                = ws.IsEcho;
                    newRow["IsNext"]                = ws.IsNext;
                    newRow["NextMode"]              = ws.NextMode;
                    newRow["ConNextRangeRule"]      = ws.ConNextRangeRule;
                    newRow["ConNextRule"]           = ws.ConNextRule;
                    newRow["ConNextRangeRuleIndex"] = ws.ConNextRangeRuleIndex;
                    newRow["ConNextRuleIndex"]      = ws.ConNextRuleIndex;
                    newRow["ConIsNext"]             = ws.ConIsNext;
                    newRow["ConNextMode"]           = ws.ConNextMode;
                    _WebSpiderTable.Rows.Add(newRow);
                }
            }
            _WebSpiderTable = DataOften.GetSortTable(_WebSpiderTable, "OrderNum asc");
            if (File.Exists(upath))
            {
                File.Delete(upath);
            }
            _WebSpiderTable.WriteXml(upath, XmlWriteMode.WriteSchema);
        }
Пример #30
0
        public void LoadList(int pageNum)
        {
            if (bW.IsBusy)
            {
                bW.CancelAsync();
            }
            centPage.PageNum   = pageNum;
            centPage.DataCount = 0;
            centPage.EachCount = App.Often.GetInt(App.Win.Utils.GetComboBoxValue(cBhs));
            StringBuilder sb = new StringBuilder();
            List <string> li = new List <string>();

            DataOften.SqlAddArr("tkid=?", tkid, ref sb, ref li);
            string cname = tBName.Text.Trim();

            if (cname != "")
            {
                string mb = App.Win.Utils.GetComboBoxValue(cBmb);
                if (mb == "0")
                {
                    DataOften.SqlAddArr("(tm like ? or zid in (select tmid from dalb where dan like ?) or dajx like ?)", ref sb, ref li, "%" + cname + "%", "%" + cname + "%", "%" + cname + "%");
                }
                else if (mb == "1")
                {
                    DataOften.SqlAddArr("tm like ?", "%" + cname + "%", ref sb, ref li);
                }
                else if (mb == "2")
                {
                    DataOften.SqlAddArr("zid in (select tmid from dalb where dan like ?)", ref sb, ref li, "%" + cname + "%");
                }
                else if (mb == "3")
                {
                    DataOften.SqlAddArr("tm like ? or dajx like ?", ref sb, ref li, "%" + cname + "%", "%" + cname + "%");
                }
            }
            string lx = App.Win.Utils.GetComboBoxValue(cBlx);

            if (lx != "")
            {
                DataOften.SqlAddArr("lx = ?", lx, ref sb, ref li);
            }
            string qy = App.Win.Utils.GetComboBoxValue(cBuse);

            if (qy != "")
            {
                DataOften.SqlAddArr("qy = ?", qy, ref sb, ref li);
            }
            DataOften.SqlAddWhere(ref sb);
            centPage.DataCount = App.Often.GetInt(wapp.SQLiteConn.Sqllite.GetES("select count(0) from tmlb " + sb.ToString(), li));
            centPage.SetCent();
            string sql = "select * from tmlb " + sb.ToString() + " limit " + centPage.EachCount.ToString() + " offset " + centPage.StartData.ToString();

            tmdt = wapp.SQLiteConn.Sqllite.GetDT(sql, li);
            int xh = centPage.StartData + 1;

            listv.Items.Clear();
            if (tmdt.Rows.Count > 0)
            {
                for (int i = 0; i < tmdt.Rows.Count; i++)
                {
                    string       zid   = tmdt.Rows[i]["zid"].ToString().Trim();
                    ListViewItem itema = new ListViewItem("", 0);
                    itema.UseItemStyleForSubItems = false;
                    itema.Name = zid;
                    itema.SubItems.Add((xh + i).ToString());
                    itema.SubItems.Add(tmdt.Rows[i]["tm"].ToString().Trim());
                    itema.SubItems.Add(tmdt.Rows[i]["dajx"].ToString().Trim());

                    string qys = tmdt.Rows[i]["qy"].ToString().Trim();
                    itema.SubItems.Add(App.Web.WebOften.GetListVal(wapp.AppList.IsUser(), qys));
                    wapp.pub.setUseColor(itema.SubItems[itema.SubItems.Count - 1], qys);

                    string lxs = tmdt.Rows[i]["lx"].ToString().Trim();
                    itema.SubItems.Add(App.Web.WebOften.GetListVal(wapp.AppList.SubjectType(), lxs));
                    wapp.pub.setSubjectTypeColor(itema.SubItems[itema.SubItems.Count - 1], lxs);

                    itema.SubItems.Add(tmdt.Rows[i]["sl"].ToString().Trim());
                    listv.Items.AddRange(new ListViewItem[] { itema });
                }
                index = listv.Items[0].SubItems.Count - 1;
                bW.RunWorkerAsync();
            }
            cBallsel.Checked = false;
        }