//添加新行 private void AddNewRow(StructOrderDetail detail) { DataRow row = this.mainDataTable.NewRow(); this.mainDataTable.Rows.Add(row); row[TitleList.Type.ToString()] = SysManage.GetProductTypeName(detail.Category); row[TitleList.Name.ToString()] = detail.Goodsname; row[TitleList.Price.ToString()] = detail.Price; row[TitleList.Num.ToString()] = detail.Num; row[TitleList.Money.ToString()] = float.Parse(detail.Price) * detail.Num; }
//添加新行 private void AddNewRow(StructStock product) { DataRow row = this.mainDataTable.NewRow(); this.mainDataTable.Rows.Add(row); row[TitleList.Number.ToString()] = this.mainDataTable.Rows.Count + ""; row[TitleList.ProductName.ToString()] = product.Goodsname; row[TitleList.Type.ToString()] = SysManage.GetProductTypeName(product.Category); row[TitleList.StockNum.ToString()] = product.Num; row[TitleList.UnitPrice.ToString()] = product.Price; }
//添加新行 private void AddNewRow(StructGoods product) { DataRow row = this.mainDataTable.NewRow(); this.mainDataTable.Rows.Add(row); row[TitleList.Number.ToString()] = this.mainDataTable.Rows.Count + ""; row[TitleList.Name.ToString()] = product.GoodsName; row[TitleList.Type.ToString()] = SysManage.GetProductTypeName(product.Category); row[TitleList.Price.ToString()] = product.Price; row[TitleList.IsIntegral.ToString()] = product.UseIntegal; row[TitleList.IsShowStore.ToString()] = product.Hide; row[TitleList.Integral.ToString()] = product.Integal; row[TitleList.Num.ToString()] = product.Count; }
//刷新UI private void RefreshUI() { this.textEdit1.Text = this.product.GoodsName; this.textEdit2.Text = this.product.Count + ""; this.textEdit3.Text = this.product.Price + ""; this.textEdit4.Text = this.product.Integal + ""; if (this.productTypes != null) { this.comboBoxEdit1.Text = SysManage.GetProductTypeName(this.product.Category); } this.productPicture1.NetPath = this.product.GoodsImg1; this.productPicture2.NetPath = this.product.GoodsImg2; this.productPicture3.NetPath = this.product.GoodsImg3; this.checkedListBoxControl1.Items[0].CheckState = this.product.UseIntegal ? CheckState.Checked : CheckState.Unchecked; this.checkedListBoxControl1.Items[2].CheckState = this.product.Hide ? CheckState.Checked : CheckState.Unchecked; }