Ejemplo n.º 1
0
        private void EquSe_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“eMSDS.equiptype”中。您可以根据需要移动或移除它。
            this.equiptypeTableAdapter.Fill(this.eMSDS.equiptype);
            // TODO: 这行代码将数据加载到表“eMSDS.equiprlogo”中。您可以根据需要移动或移除它。
            this.equiprlogoTableAdapter.Fill(this.eMSDS.equiprlogo);
            // TODO: 这行代码将数据加载到表“eMSDS.equiprspec”中。您可以根据需要移动或移除它。
            this.equiprspecTableAdapter.Fill(this.eMSDS.equiprspec);
            // TODO: 这行代码将数据加载到表“eMSDS.department”中。您可以根据需要移动或移除它。
            this.departmentTableAdapter.Fill(this.eMSDS.department);
            // TODO: 这行代码将数据加载到表“eMSDS.equiprspec”中。您可以根据需要移动或移除它。
            this.equiprspecTableAdapter.Fill(this.eMSDS.equiprspec);
            // TODO: 这行代码将数据加载到表“eMSDS.equiprlogo”中。您可以根据需要移动或移除它。
            this.equiprlogoTableAdapter.Fill(this.eMSDS.equiprlogo);
            // TODO: 这行代码将数据加载到表“eMSDS.equiptype”中。您可以根据需要移动或移除它。
            this.equiptypeTableAdapter.Fill(this.eMSDS.equiptype);
            string selstr = "SELECT equipment.equipid, equipment.sn, equipment.equipname, equiptype.typename,equiprlogo.logoname, equiprspec.specname, department.departname,equipment.proddate, equipment.other FROM equipment INNER JOIN equiptype ON equipment.typeid = equiptype.typeid INNER JOIN equiprlogo ON equipment.logoid = equiprlogo.logoid INNER JOIN equiprspec ON equipment.specid = equiprspec.specid INNER JOIN department ON equipment.departid = department.departid";

            ds = eq.excuterdataset(selstr);
            dataGridView1.DataSource            = ds.Tables[0];
            dataGridView1.Columns[0].HeaderText = "序号";
            dataGridView1.Columns[1].HeaderText = "设备编号";
            dataGridView1.Columns[2].HeaderText = "设备名称";
            dataGridView1.Columns[3].HeaderText = "设备类别";
            dataGridView1.Columns[4].HeaderText = "设备品牌";
            dataGridView1.Columns[5].HeaderText = "设备规格";
            dataGridView1.Columns[6].HeaderText = "所属部门";
            dataGridView1.Columns[7].HeaderText = "出厂日期";
            dataGridView1.Columns[8].HeaderText = "备注信息";
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string NO         = textBox1.Text;
            string personname = textBox2.Text;
            int    departid   = Convert.ToInt32(comboBox1.SelectedValue);
            string position   = comboBox2.Text;

            string selstr = string.Format("SELECT dbo.person.personid, dbo.person.[NO], dbo.person.personname,dbo.department.departname, dbo.person.[position], dbo.person.other FROM dbo.person INNER JOIN dbo.department ON dbo.person.departid = dbo.department.departid where(dbo.person.[NO] like '%{0}%' AND dbo.person.personname like '%{1}%' AND dbo.person.departid={2} and dbo.person.[position]='{3}')", NO, personname, departid, position);

            ds = eq.excuterdataset(selstr);
            dataGridView1.DataSource = ds.Tables[0];
        }
Ejemplo n.º 3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            departid = Convert.ToInt32(comboBox1.SelectedValue);
            if (comboBox1.Text == "*")
            {
                selstr = "SELECT equipname, COUNT(equipname) AS Expr1 FROM equipment GROUP BY equipname";
            }
            else
            {
                if (departid == 0)
                {
                    MessageBox.Show("没有该部门,要查找所有部门,请输入\"*\"");
                }
                else
                {
                    selstr = string.Format("SELECT equipname, COUNT(equipname) AS Expr1 FROM equipment WHERE departid = {0} GROUP BY equipname", departid);
                }
            }

            flylib.exsql eq = new exsql();
            DataSet      ds = new DataSet();

            ds = eq.excuterdataset(selstr);

            报表管理.rpt.清查明细表 rpt = new EMS.报表管理.rpt.清查明细表();
            rpt.SetDataSource(ds.Tables[0]);
            TextObject depart = rpt.ReportDefinition.ReportObjects["Text18"] as TextObject;

            depart.Text = comboBox1.Text;
            crystalReportViewer1.ReportSource = rpt;
        }
Ejemplo n.º 4
0
        private void report_Load(object sender, EventArgs e)
        {
            exsql   eq   = new exsql();
            string  rstr = "SELECT [user].username, role.role, authority.authority, subauthority.subauthority FROM [user] INNER JOIN userper ON [user].userid = userper.userid INNER JOIN role ON userper.roleid = role.roleid INNER JOIN authority ON userper.authorityid = authority.authorityid INNER JOIN subauthority ON userper.subauthorityid = subauthority.subauthorityid INNER JOIN userrole ON [user].userid = userrole.userid AND role.roleid = userrole.roleid INNER JOIN roleauthority ON role.roleid = roleauthority.roleid AND authority.authorityid = roleauthority.authorityid INNER JOIN authsub ON authority.authorityid = authsub.authorityid AND subauthority.subauthorityid = authsub.subauthorityid";
            DataSet ds   = eq.excuterdataset(rstr);

            uras rpt = new uras();

            rpt.SetDataSource(ds.Tables[0]);

            crystalReportViewer1.ReportSource = rpt;
        }
Ejemplo n.º 5
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            switch (treeView1.SelectedNode.Level)
            {
            case 0: selstr = string.Format("SELECT [user].username, role.role, authority.authority, subauthority.subauthority FROM [user] INNER JOIN ((subauthority INNER JOIN (role INNER JOIN ((authority INNER JOIN authsub ON authority.authorityid = authsub.authorityid) INNER JOIN roleauthority ON authority.authorityid = roleauthority.authorityid) ON role.roleid = roleauthority.roleid) ON subauthority.subauthorityid = authsub.subauthorityid) INNER JOIN userrole ON role.roleid = userrole.roleid) ON [user].userid = userrole.userid WHERE [user].username='******'", e.Node.Text);
                seluser    = e.Node.Text;
                eq.excutesql(selstr);
                break;

            case 1: selstr = String.Format("SELECT [user].username, role.role, authority.authority, subauthority.subauthority FROM [user] INNER JOIN ((subauthority INNER JOIN (role INNER JOIN ((authority INNER JOIN authsub ON authority.authorityid = authsub.authorityid) INNER JOIN roleauthority ON authority.authorityid = roleauthority.authorityid) ON role.roleid = roleauthority.roleid) ON subauthority.subauthorityid = authsub.subauthorityid) INNER JOIN userrole ON role.roleid = userrole.roleid) ON [user].userid = userrole.userid WHERE ([user].username='******' and role.role='{1}')", e.Node.Parent.Text, e.Node.Text);
                seluser    = e.Node.Parent.Text;
                eq.excutesql(selstr);
                break;

            case 2: selstr = String.Format("SELECT [user].username, role.role, authority.authority, subauthority.subauthority FROM [user] INNER JOIN ((subauthority INNER JOIN (role INNER JOIN ((authority INNER JOIN authsub ON authority.authorityid = authsub.authorityid) INNER JOIN roleauthority ON authority.authorityid = roleauthority.authorityid) ON role.roleid = roleauthority.roleid) ON subauthority.subauthorityid = authsub.subauthorityid) INNER JOIN userrole ON role.roleid = userrole.roleid) ON [user].userid = userrole.userid WHERE ([user].username='******' and role.role='{1}' and authority.authority='{2}')", e.Node.Parent.Parent.Text, e.Node.Parent.Text, e.Node.Text);
                seluser    = e.Node.Parent.Parent.Text;
                eq.excutesql(selstr);
                break;
            }
            DataSet ds;

            ds = eq.excuterdataset(selstr);

            dataGridView1.DataSource = ds.Tables[0];
            dataGridView1.Columns["权限"].DisplayIndex         = 4;
            dataGridView1.Columns["username"].HeaderText     = "用户名";
            dataGridView1.Columns["username"].ReadOnly       = true;
            dataGridView1.Columns["subauthority"].HeaderText = "子权限";
            dataGridView1.Columns["subauthority"].ReadOnly   = true;
            dataGridView1.Columns["role"].HeaderText         = "角色";
            dataGridView1.Columns["role"].ReadOnly           = true;
            dataGridView1.Columns["authority"].HeaderText    = "窗体";
            dataGridView1.Columns["authority"].ReadOnly      = true;
            dataGridView1.Columns["subauthority"].ReadOnly   = true;

            foreach (DataGridViewRow dr in dataGridView1.Rows)
            {
                int uid = eq.selid(dr.Cells["username"].Value.ToString(), 0);
                int rid = eq.selid(dr.Cells["role"].Value.ToString(), 1);
                int aid = eq.selid(dr.Cells["authority"].Value.ToString(), 2);
                int sid = eq.selid(dr.Cells["subauthority"].Value.ToString(), 3);

                int count = eq.selcount(uid, rid, aid, sid);
                if (count > 0)
                {
                    dr.Cells["权限"].Value = "yes";
                }
            }
            //dataGridView1.RowHeadersVisible = false;//隐藏第一列空列
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string  starttime = dateTimePicker1.Value.ToString("yyyy-MM-dd");
            string  endtime   = dateTimePicker2.Value.ToString("yyyy-MM-dd");
            string  selstr    = string.Format("SELECT equiplog.logtid, equiplog.sn, person.personname, [user].username,equiplog.logtype, equiplog.optime, equiplog.other FROM equiplog INNER JOIN person ON equiplog.personid = person.personid CROSS JOIN [user] WHERE (sn LIKE '%{0}%') AND (logtype LIKE '%{1}%') AND(optime between '{2}' and '{3}')", textBox1.Text, comboBox1.Text, starttime, endtime);
            DataSet ds        = new DataSet();
            exsql   eq        = new exsql();

            ds = eq.excuterdataset(selstr);
            dataGridView1.DataSource            = ds.Tables[0];
            dataGridView1.Columns[0].HeaderText = "序号";
            dataGridView1.Columns[1].HeaderText = "设备编号";
            dataGridView1.Columns[2].HeaderText = "职员";
            dataGridView1.Columns[3].HeaderText = "管理员";
            dataGridView1.Columns[4].HeaderText = "处理类型";
            dataGridView1.Columns[5].HeaderText = "操作时间";
            dataGridView1.Columns[6].HeaderText = "备注信息";
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            string sn            = textBox1.Text.Trim();
            string lendstarttime = dateTimePicker1.Value.ToString("yyyy-MM-dd");
            string lendendtime   = dateTimePicker2.Value.ToString("yyyy-MM-dd");

            string  selstr = string.Format("SELECT lendlog.logid, lendlog.sn, lendlog.lenddate, lendlog.returndate,person.personname, [user].username AS lendusername,user_1.username AS returnuser, lendlog.other FROM lendlog INNER JOIN [user] ON lendlog.lendUserid = [user].userid INNER JOIN [user] user_1 ON lendlog.returnUserid = user_1.userid INNER JOIN person ON lendlog.personid = person.personid WHERE (sn LIKE '%{0}%') AND(lenddate between '{1}' and '{2}')", sn, lendstarttime, lendendtime);
            DataSet ds     = new DataSet();
            exsql   eq     = new exsql();

            ds = eq.excuterdataset(selstr);
            dataGridView1.DataSource = ds.Tables[0];

            dataGridView1.Columns[0].HeaderText = "序号";
            dataGridView1.Columns[1].HeaderText = "设备编号";
            dataGridView1.Columns[2].HeaderText = "租出日期";
            dataGridView1.Columns[3].HeaderText = "归还日期";
            dataGridView1.Columns[4].HeaderText = "租借人";
            dataGridView1.Columns[5].HeaderText = "租出管理员";
            dataGridView1.Columns[6].HeaderText = "收还管理员";
            dataGridView1.Columns[7].HeaderText = "备注信息";
        }
        private void button1_Click_1(object sender, EventArgs e)
        {
            typeid   = Convert.ToInt32(comboBox1.SelectedValue);
            departid = Convert.ToInt32(comboBox2.SelectedValue);
            if (comboBox1.Text == "*")
            {
                if (comboBox2.Text == "*")
                {
                    selstr = "SELECT equipment.sn, equipment.equipname, equiprlogo.logoname,equiprspec.specname, equipment.inputdate, equipment.proddate, equipment.state,equipment.inputer, equipment.other FROM equipment INNER JOIN equiprlogo ON equipment.logoid = equiprlogo.logoid INNER JOIN equiprspec ON equipment.specid = equiprspec.specid";
                }
                else
                {
                    if (departid == 0)
                    {
                        MessageBox.Show("没有该该部门,要查找所有部门,请输入\"*\"");
                    }
                    else
                    {
                        selstr = string.Format("SELECT equipment.sn, equipment.equipname, equiprlogo.logoname,equiprspec.specname, equipment.inputdate, equipment.proddate, equipment.state,equipment.inputer, equipment.other FROM equipment INNER JOIN equiprlogo ON equipment.logoid = equiprlogo.logoid INNER JOIN equiprspec ON equipment.specid = equiprspec.specid where equipment.departid={0}", departid);
                    }
                }
            }
            else
            {
                if (typeid == 0)
                {
                    MessageBox.Show("没有该该类别,要查找所有类别,请输入\"*\"");
                }
                else
                {
                    if (comboBox2.Text == "*")
                    {
                        selstr = string.Format("SELECT equipment.sn, equipment.equipname, equiprlogo.logoname,equiprspec.specname, equipment.inputdate, equipment.proddate, equipment.state,equipment.inputer, equipment.other FROM equipment INNER JOIN equiprlogo ON equipment.logoid = equiprlogo.logoid INNER JOIN equiprspec ON equipment.specid = equiprspec.specid where equipment.typeid={0}", typeid);
                    }
                    else
                    {
                        if (departid == 0)
                        {
                            MessageBox.Show("没有该该部门,要查找所有部门,请输入\"*\"");
                        }
                        else
                        {
                            selstr = string.Format("SELECT equipment.sn, equipment.equipname, equiprlogo.logoname,equiprspec.specname, equipment.inputdate, equipment.proddate, equipment.state,equipment.inputer, equipment.other FROM equipment INNER JOIN equiprlogo ON equipment.logoid = equiprlogo.logoid INNER JOIN equiprspec ON equipment.specid = equiprspec.specid where (equipment.typeid = {0}) AND (equipment.departid = {1})", typeid, departid);
                        }
                    }
                }
            }

            flylib.exsql eq = new exsql();
            DataSet      ds = new DataSet();

            ds = eq.excuterdataset(selstr);

            报表管理.rpt.固定资产使用登记表 rpt = new EMS.报表管理.rpt.固定资产使用登记表();
            rpt.SetDataSource(ds.Tables[0]);
            TextObject type = rpt.ReportDefinition.ReportObjects["Text17"] as TextObject;

            type.Text = comboBox1.Text;
            TextObject depart = rpt.ReportDefinition.ReportObjects["Text13"] as TextObject;

            depart.Text = comboBox2.Text;
            crystalReportViewer1.ReportSource = rpt;
        }