public FrmStockQuery(bool isThisStock, FrmDmSheetDetail _detail, string branch_no) { InitializeComponent(); this.Text = Gattr.AppTitle; if (isThisStock) { this.txtBranchNO.Text = Gattr.BranchNo; this.txtBranchNO.Enabled = false; this.btnSelectBranch.Enabled = false; this.txtKey.Focus(); this.btnSelectBranch.Enabled = false; } else { this.txtBranchNO.Text = Gattr.BranchNo; this.txtBranchNO.Enabled = true; this.txtKey.Focus(); this.btnDm.Visible = true; } if (_detail != null) { this._detail = _detail; } this.txtBranchNO.Text = branch_no; }
private void dgItem_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { string itemNo = SIString.TryStr(this.dgItem.Rows[this.dgItem.CurrentRow.Index].Cells["item_no"].Value.ToString().Trim()); string str2 = SIString.TryStr(this.dgItem.Rows[this.dgItem.CurrentRow.Index].Cells["branch_no"].Value.ToString().Trim()); if (!string.IsNullOrEmpty(str2)) { if (Gattr.BranchNo == this.txtBranchNO.Text.Trim()) { MessageBox.Show("发货门店和收货门店不能相同", Gattr.AppTitle); } else { DataTable table = new DataTable(); table.Columns.Add(new DataColumn("item_no")); table.Columns.Add(new DataColumn("stock_qty")); table.Columns.Add(new DataColumn("item_name")); table.Columns.Add(new DataColumn("item_size")); table.Columns.Add(new DataColumn("item_clsname")); table.Columns.Add(new DataColumn("code_name")); table.Columns.Add(new DataColumn("unit_no")); foreach (DataGridViewRow dgvr in this.dgItem.SelectedRows) { DataRow dr = table.NewRow(); dr["item_no"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_no"].Value); dr["item_name"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_name"].Value); dr["item_size"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_size"].Value); dr["item_clsname"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_clsname"].Value); dr["code_name"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["code_name"].Value); dr["unit_no"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["unit_no"].Value); dr["stock_qty"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["stock_qty"].Value); table.Rows.Add(dr); } string branch_no = this.txtBranchNO.Text.Trim(); if (_detail == null) { FrmDmSheetDetail detail = new FrmDmSheetDetail(branch_no, table); detail.ShowDialog(); } else { DialogResult = System.Windows.Forms.DialogResult.OK; if (SetStock != null) { SetStock(table); } } } //using (FrmDmSheetDetail detail = new FrmDmSheetDetail(str2, itemNo)) //{ // detail.ShowDialog(); //} } }
private void btnDm_Click(object sender, EventArgs e) { if (this.dgItem.SelectedRows.Count == 0) { MessageBox.Show("请选择商品", Gattr.AppTitle); } else { if (Gattr.BranchNo == this.txtBranchNO.Text.Trim()) { MessageBox.Show("发货门店和收货门店不能相同", Gattr.AppTitle); } else { DataTable table = new DataTable(); table.Columns.Add(new DataColumn("item_no")); table.Columns.Add(new DataColumn("stock_qty")); table.Columns.Add(new DataColumn("item_name")); table.Columns.Add(new DataColumn("item_size")); table.Columns.Add(new DataColumn("item_clsname")); table.Columns.Add(new DataColumn("code_name")); table.Columns.Add(new DataColumn("unit_no")); foreach (DataGridViewRow dgvr in this.dgItem.SelectedRows) { DataRow dr = table.NewRow(); dr["item_no"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_no"].Value); dr["item_name"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_name"].Value); dr["item_size"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_size"].Value); dr["item_clsname"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["item_clsname"].Value); dr["code_name"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["code_name"].Value); dr["unit_no"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["unit_no"].Value); dr["stock_qty"] = ExtendUtility.Instance.ParseToString(dgvr.Cells["stock_qty"].Value); table.Rows.Add(dr); } string branch_no = this.txtBranchNO.Text.Trim(); if (_detail == null) { FrmDmSheetDetail detail = new FrmDmSheetDetail(branch_no, table); detail.ShowDialog(); } else { DialogResult = System.Windows.Forms.DialogResult.OK; if (SetStock != null) { SetStock(table); } } } } }
public FrmItemQuery(FrmDmSheetDetail frm) { this._itemList = new List <t_item_info>(); this.itemF5 = string.Empty; this.IsClose = true; this.TxtTitle = "可输入货号、自编码、商品名、类别、品牌关键字进行查询"; this.components = null; this.IsClose = false; this.frmDmSheetDetail = frm; this.InitializeComponent(); this.txtSearchKey.Text = this.TxtTitle; this.txtSearchKey.ForeColor = Color.Silver; this.Text = Gattr.AppTitle; //FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; }
private void dgvSheet_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { string str = SIString.TryStr(this.dgvSheet.Rows[e.RowIndex].Cells["sheet_no"].Value); if (!string.IsNullOrEmpty(str)) { object obj = this.dgvSheet.Rows[e.RowIndex].DataBoundItem; //t_ using (FrmDmSheetDetail detail = new FrmDmSheetDetail(obj)) { detail.ShowDialog(); } } } }
private void btnOpen_Click(object sender, EventArgs e) { if (this.dgvSheet.CurrentRow != null) { string str = SIString.TryStr(this.dgvSheet.Rows[this.dgvSheet.CurrentRow.Index].Cells["sheet_no"].Value.ToString().Trim()); if (!string.IsNullOrEmpty(str)) { object dataRow = this.dgvSheet.CurrentRow.DataBoundItem; using (FrmDmSheetDetail detail = new FrmDmSheetDetail(dataRow)) { detail.ShowDialog(); } } } else { MessageBox.Show("请先选中一行再进行操作!", Gattr.AppTitle); } }