Esempio n. 1
0
        /// <summary>
        /// 検索フォーム起動処理
        /// </summary>
        /// <param name="kbn"></param>
        /// <param name="setCtl"></param>
        private void SearchData(EsearchKbn kbn, Control setCtl)
        {
            switch (kbn)
            {
            case EsearchKbn.Product:
                string ymd = bbl.GetDate();
                using (Search_Product frmProduct = new Search_Product(ymd))
                {
                    frmProduct.ShowDialog();

                    if (!frmProduct.flgCancel)
                    {
                        int index = Array.IndexOf(detailControls, setCtl);

                        switch (index)
                        {
                        case (int)EIndex.JanCD:
                            if (string.IsNullOrWhiteSpace(detailControls[(int)EIndex.JanCD].Text))
                            {
                                detailControls[(int)EIndex.JanCD].Text = frmProduct.JANCD;
                            }
                            else
                            {
                                detailControls[(int)EIndex.JanCD].Text = detailControls[(int)EIndex.JanCD].Text + "," + frmProduct.JANCD;
                            }

                            break;

                        case (int)EIndex.SKUCD:
                            if (string.IsNullOrWhiteSpace(detailControls[(int)EIndex.SKUCD].Text))
                            {
                                detailControls[(int)EIndex.SKUCD].Text = frmProduct.SKUCD;
                            }
                            else
                            {
                                detailControls[(int)EIndex.SKUCD].Text = detailControls[(int)EIndex.SKUCD].Text + "," + frmProduct.SKUCD;
                            }

                            break;
                        }
                    }
                    setCtl.Focus();
                }
                break;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Show select_SKU form on gridview JanCD button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvJANCDHenkou_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;
            //if (dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD"].Value  != null)
            {
                if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn &&
                    e.RowIndex >= 0)
                {
                    Search_Product frmsp = new Search_Product(System.DateTime.Now.ToString("yyyy-MM-dd"));
                    //frmsp.JANCD = dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD"].Value.ToString();
                    frmsp.ShowDialog();
                    if (!frmsp.flgCancel)
                    {
                        JANCD = frmsp.JANCD;

                        //if (dtGenJanCD.Rows.Count > 0)
                        //{
                        // DataTable tmp1 = jhbl.SimpleSelect1("61", System.DateTime.Now.ToString("yyyy-MM-dd"), SKUCD, dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD"].Value.ToString());
                        dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD"].Value = JANCD;
                        dgvJANCDHenkou.CurrentCell = dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD"];
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colBrandCD"].Value = tmp1.Rows[0]["BrandCD"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colBrandName"].Value = tmp1.Rows[0]["BrandName"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colITEM"].Value = tmp1.Rows[0]["ITemCD"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colSKUName"].Value = tmp1.Rows[0]["SKUName"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colSize"].Value = tmp1.Rows[0]["SizeName"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colColor"].Value = tmp1.Rows[0]["ColorName"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colGenJanCD2"].Value = tmp1.Rows[0]["GenJanCD2"].ToString();
                        //dgvJANCDHenkou.Rows[e.RowIndex].Cells["colSKUCD"].Value = tmp1.Rows[0]["SKUCD"].ToString();
                        //dtGenJanCD.AcceptChanges();
                        //dgvJANCDHenkou.DataSource = dtGenJanCD;
                        //}
                        //else
                        //{
                        //    dtGenJanCD = jhbl.SimpleSelect1("61", System.DateTime.Now.ToString("yyyy-MM-dd"), SKUCD);
                        //    dgvJANCDHenkou.DataSource = dtGenJanCD;
                        //}
                    }
                }
            }
        }