Exemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                var dtAccess = new WareHousingDataAccess();

                var dt = dtAccess.GetWareHousingInfo(txtWHSFrom.Text,
                                                     txtWHSTo.Text,
                                                     txtGoodName.Text,
                                                     txtGoodCodeFrom.Text,
                                                     txtGoodCodeTo.Text,
                                                     txtDtFrom.Text,
                                                     txtDtTo.Text);

                if (dt.Rows.Count > 0)
                {
                    this.DisplayData(dt);
                    DisplayMessage(MessageKind.SuccessBox, MessageManager.S002);
                }
                else
                {
                    this.DisplayData(dt);
                    DisplayMessage(MessageKind.ErrorBox, MessageManager.E003);
                }
            }
            catch (Exception ex)
            {
                //DisplayMessage(MessageKind.ErrorBox, MessageManager.E000);
                DisplayMessage(MessageKind.ErrorBox, ex.StackTrace.ToString());
                ErrorCatcher(ex.Message);
                throw ex;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 移動タイプが更新の場合、対象データを取得する
        /// </summary>
        /// <param name="whNo"></param>
        /// <param name="whDate"></param>
        private void SearchWHDetailData(string whNo, string whDate)
        {
            try
            {
                var dtAccess = new WareHousingDataAccess();

                var dt = dtAccess.GetWareHousingModifyData(whNo, whDate);

                grvWareHousingInsert.DataSource = dt;


                grvWareHousingInsert.Columns["WaID"].HeaderText = "入荷番号";
                grvWareHousingInsert.Columns["WaID"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grvWareHousingInsert.Columns["WaDate"].HeaderText = "入荷日";
                grvWareHousingInsert.Columns["WaDate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
                grvWareHousingInsert.Columns["PrID"].HeaderText   = "商品コード";
                grvWareHousingInsert.Columns["PrID"].Width        = 100;
                grvWareHousingInsert.Columns["PrName"].HeaderText = "商品名称";
                grvWareHousingInsert.Columns["PrName"].Width      = 140;
                grvWareHousingInsert.Columns["PrName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
                grvWareHousingInsert.Columns["Color"].HeaderText = "色";
                grvWareHousingInsert.Columns["Color"].Width      = 100;
                grvWareHousingInsert.Columns["Price"].HeaderText = "単価";
                grvWareHousingInsert.Columns["Price"].Width      = 80;
                grvWareHousingInsert.Columns["Price"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                grvWareHousingInsert.Columns["WDquantity"].HeaderText            = "入荷数量";
                grvWareHousingInsert.Columns["WDquantity"].Width = 80;
                grvWareHousingInsert.Columns["WDquantity"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                grvWareHousingInsert.Columns["Mnumber"].Visible        = false;
                grvWareHousingInsert.Columns["TotalAmount"].HeaderText = "合計金額";
                grvWareHousingInsert.Columns["TotalAmount"].Width      = 120;
                grvWareHousingInsert.Columns["TotalAmount"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }