Ejemplo n.º 1
0
        private void getAllPackInList()
        {
            string moduleid = this.comboBox1.SelectedValue.ToString();
            string manageid = this.comboBox2.SelectedValue.ToString();
            string state    = this.treeView1.SelectedNode.Text;

            string begin = this.dateTimePicker1.Value.ToShortDateString() + " 00:00:00";
            string end   = this.dateTimePicker2.Value.ToShortDateString() + " 23:59:59";

            if (this.dateTimePicker1.IsDisposed && this.dateTimePicker2.IsDisposed)
            {
                begin = null;
                end   = null;
            }

            this.count = PackageDao.queryPackageInfoCount(moduleid, manageid, state, begin, end);
            int countpage = (count % pagesize == 0)?count / pagesize:count / pagesize + 1;

            if (this.currentpage > countpage)
            {
                this.currentpage = 1;
            }
            this.label3.Text = string.Format(currentstr, this.currentpage);
            this.label5.Text = string.Format(pagestr, this.pagesize);
            this.label4.Text = string.Format(countstr, countpage, this.count);
            List <PackageInfo> ls = PackageDao.queryPackageInfo(moduleid, manageid, state, begin, end,
                                                                (currentpage > 1)?((this.currentpage - 1) * pagesize):0
                                                                , pagesize);

            this.listView1.Items.Clear();
            foreach (PackageInfo pack in ls)
            {
                ListViewBing(pack);
            }
        }
Ejemplo n.º 2
0
//处理提醒框
//效果:当一个人更新了 另一个人不能通过提醒框进入修改

        void Button1Click(object sender, EventArgs e)
        {
            //查数据库
            //select * from PackageInfo where packpath='msgstr'
            //有记录的提示并返回,没记录就
            //insert packpath,packtime  into PackageInfo values(msgstr,datetime)
            PackageInfo   pack = PackageDao.getPackageInfoBypath(msgstr)[0];
            BussinessForm bf   = new BussinessForm(pack);

            bf.StartPosition = FormStartPosition.CenterParent;
            this.Close();
            this.Dispose();
            bf.ShowDialog();
        }