Esempio n. 1
0
        private void bottonSearch()
        {
            CostEditLogic          logic = new CostEditLogic();
            DataTable              dt    = new DataTable();
            selectExpenditureClass conds = new selectExpenditureClass();

            conds.prName  = cmbProductName.Text.Trim().Equals("") ? null : cmbProductName.Text;
            conds.prModel = cmbProductmodel.Text.Trim().Equals("") ? null : cmbProductmodel.Text;
            conds.eqName  = cmbEquipmentName.Text.Trim().Equals("") ? null : cmbEquipmentName.Text;
            conds.eqModel = cmbEquipmentModel.Text.Trim().Equals("") ? null : cmbEquipmentModel.Text;
            conds.flag    = CBFlag.Text;
            if (checkBox1.Checked)
            {
                conds.beginDateTime = dtpStart.Value.ToString();
            }
            if (checkBox2.Checked)
            {
                conds.endDateTime = dtpEnd.Value.ToString();
            }

            dt = logic.SelectAllData(conds);
            dgvShow.DataSource = dt;
            caleRecordAndMoney(dt);
            dgvShow.Columns["id"].Visible = false;
        }
Esempio n. 2
0
        // 删除表中的记录之后重新绑定数据源取表的过程
        private DataTable distillCostTable()
        {
            CostEditLogic          logic = new CostEditLogic();
            DataTable              dt    = new DataTable();
            selectExpenditureClass conds = new selectExpenditureClass();

            conds.prName  = cmbProductName.Text.Trim().Equals("") ? null : cmbProductName.Text;
            conds.prModel = cmbProductmodel.Text.Trim().Equals("") ? null : cmbProductmodel.Text;
            conds.eqName  = cmbEquipmentName.Text.Trim().Equals("") ? null : cmbEquipmentName.Text;
            conds.eqModel = cmbEquipmentModel.Text.Trim().Equals("") ? null : cmbEquipmentModel.Text;
            if (checkBox1.Checked)
            {
                conds.beginDateTime = dtpStart.Value.ToString();
            }
            if (checkBox2.Checked)
            {
                conds.endDateTime = dtpEnd.Value.ToString();
            }

            dt = logic.SelectAllData(conds);
            return(dt);
        }
Esempio n. 3
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode != null)
            {
                selectExpenditureClass conds = new selectExpenditureClass();
                TreeNode nodes = new TreeNode();
                nodes = treeView1.SelectedNode;
                for (int i = treeView1.SelectedNode.Level; i >= 0; i--)
                {
                    switch (treefields[i].ToString().Trim())
                    {
                    case "费用类别":
                        conds.exSort = nodes.Text;
                        break;

                    case "费用名称":
                        conds.exName = nodes.Text;
                        break;

                    case "费用明细":
                        conds.exDetail = nodes.Text;
                        break;

                    case "费用描述":
                        conds.exDepict = nodes.Text;
                        break;

                    case "年份":
                        conds.exYear = nodes.Text;
                        break;

                    case "月份":
                        conds.exMonth = nodes.Text;
                        break;

                    case "设备名称":
                        conds.eqName = nodes.Text;
                        break;

                    case "设备型号":
                        conds.eqModel = nodes.Text;
                        break;

                    case "产品名称":
                        conds.prName = nodes.Text;
                        break;

                    case "产品型号":
                        conds.prModel = nodes.Text;
                        break;

                    case "单价":
                        conds.exUnitPrice = nodes.Text;
                        break;

                    case "数量":
                        conds.exNumber = nodes.Text;
                        break;

                    case "金额":
                        conds.exMoney = nodes.Text;
                        break;

                    case "录入时间":
                        conds.exInputDate = nodes.Text;
                        break;

                    case "录入人":
                        conds.exInputMan = nodes.Text;
                        break;

                    case "折算系数":
                        conds.exConvert = nodes.Text;
                        break;

                    case "备注":
                        conds.exRemark = nodes.Text;
                        break;
                    }
                    nodes = nodes.Parent;
                }
                CostEditLogic logic = new CostEditLogic();
                DataTable     dt    = new DataTable();

                dt = logic.SelectAllData(conds);
                dgvShow.DataSource = dt;
                caleRecordAndMoney(dt);
                dgvShow.Columns["id"].Visible = false;
            }
        }