Example #1
0
        protected void SetDetail()
        {
            int contractid = _contract.contractid;

            _details = _detailbll.GetModelList("contractid=" + contractid);

            dataGridView1.Rows.Clear();
            if (_details == null || _details.Count < 1)
            {
                return;
            }
            foreach (FishEntity.ContractDetailEntity item in _details)
            {
                int             idx = dataGridView1.Rows.Add();
                DataGridViewRow row = dataGridView1.Rows[idx];
                row.Cells["id"].Value            = item.id;
                row.Cells["no"].Value            = item.no;
                row.Cells["productid"].Value     = item.productid;
                row.Cells["productno"].Value     = item.productno;
                row.Cells["productname"].Value   = item.productname;
                row.Cells["specification"].Value = item.specification;
                row.Cells["nature"].Value        = item.nature;
                row.Cells["weight"].Value        = item.weight;
                row.Cells["quantity"].Value      = item.quantity;
                row.Cells["unitprice"].Value     = item.unitprice;
                row.Cells["money"].Value         = item.money;
                row.Cells["ctlremark"].Value     = item.remark;
                row.Cells["contractid"].Value    = item.contractid;
            }
            CalcTotalMoney();
        }
        public FormContractTakeDetail(int contractid, string contractno)
        {
            InitializeComponent();

            _contractid = contractid;
            _contractno = contractno;

            this.menuStrip1.Visible = false;

            this.Text = "合同号:" + _contractno;

            InitData();

            _contractdetailBll = new FishBll.Bll.ContractDetailBll();
            List <FishEntity.ContractDetailEntity> detail = _contractdetailBll.GetModelList("contractid=" + contractid);

            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource          = detail;

            _contractproductBll = new FishBll.Bll.ContractProductBll();
            //_products =_contractproductBll.GetProducts( _contractid , _

            if (detail != null && detail.Count > 0)
            {
                int detailid = detail[0].id;
                queryProduct(detailid);
            }
        }