Esempio n. 1
0
        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();
                //}
            }
        }
Esempio n. 2
0
 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);
                 }
             }
         }
     }
 }
Esempio n. 3
0
 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();
             }
         }
     }
 }
Esempio n. 4
0
 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);
     }
 }