コード例 #1
0
ファイル: KatashikiMstShosai.cs プロジェクト: 25cm/HelloWorld
        ////////////////////////////////////////////////////////////////////////////
        //  メソッド名 : DisplayDataTab02
        /// <summary>
        /// 
        /// </summary>
        /// <param name="alOutput"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/09  DatNT      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private void DisplayDataTab02(IFormLoadALOutput alOutput)
        {
            if (alOutput.KatashikiBurowaMstDT != null && alOutput.KatashikiBurowaMstDT.Count > 0)
            {
                // ADD 20140731 START ZynasSou
                foreach (KatashikiBurowaMstDataSet.KatashikiBurowaMstRow row in alOutput.KatashikiBurowaMstDT.Rows)
                {
                    row.BurowaKiteiFuryo = row.BurowaKiteiFuryo.Trim();
                }
                // ADD 20140731 END ZynasSou

                _katashikiBurowaMstDT = alOutput.KatashikiBurowaMstDT;

                katashikiBurowaListDataGridView.DataSource = _katashikiBurowaMstDT;

                _katashikiBurowaMstDT.PrimaryKey = null;

                foreach (DataColumn dc in _katashikiBurowaMstDT.Columns)
                {
                    dc.AllowDBNull = true;

                    if (dc.ColumnName == "BurowaNinsou"
                        || dc.ColumnName == "BurowaRenban"
                        || dc.ColumnName == "BurowaKiteiBurowaNm"
                        || dc.ColumnName == "BurowaKiteiFuryo")
                    {
                        dc.MaxLength = Int32.MaxValue;
                    }
                }
            }
            // display columns of katashikiBurowaListDgv
            DispColumnKatashikiBurowaListdgv();
        }
コード例 #2
0
ファイル: KatashikiMstShosai.cs プロジェクト: 25cm/HelloWorld
        ////////////////////////////////////////////////////////////////////////////
        //  メソッド名 : CreateBuroDTInsert
        /// <summary>
        /// 
        /// </summary>
        /// <param name="now"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/09  DatNT      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable CreateBuroDTInsert(DateTime now)
        {
            KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable insertDT = new KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable();

            for (int i = 0; i < katashikiBurowaListDataGridView.RowCount - 1; i++)
            {
                DataGridViewRow row = katashikiBurowaListDataGridView.Rows[i];

                if ((row.Cells["BurowaNinsouCol"].Value == null || string.IsNullOrEmpty(row.Cells["BurowaNinsouCol"].Value.ToString()))
                    && (row.Cells["BurowaRenbanCol"].Value == null || string.IsNullOrEmpty(row.Cells["BurowaRenbanCol"].Value.ToString()))
                    && (row.Cells["BurowaKiteiBurowaNmCol"].Value == null || string.IsNullOrEmpty(row.Cells["BurowaKiteiBurowaNmCol"].Value.ToString()))
                    && (row.Cells["BurowaKiteiFuryoCol"].Value == null || string.IsNullOrEmpty(row.Cells["BurowaKiteiFuryoCol"].Value.ToString()))
                    )
                {
                    // Row empty
                    // don't add
                }
                else
                {
                    KatashikiBurowaMstDataSet.KatashikiBurowaMstRow insertRow = insertDT.NewKatashikiBurowaMstRow();

                    // メーカー業者コード
                    insertRow.BurowaKatashikiMakerCd = katashikiMakerCdTextBox.Text;

                    // 型式コード
                    insertRow.BurowaKatashikiCd = katashikiCdTextBox.Text;

                    // 人槽
                    insertRow.BurowaNinsou = row.Cells["BurowaNinsouCol"].Value.ToString();

                    // 連番
                    insertRow.BurowaRenban = row.Cells["BurowaRenbanCol"].Value.ToString();

                    // 規定ブロブ名称
                    insertRow.BurowaKiteiBurowaNm = row.Cells["BurowaKiteiBurowaNmCol"].Value.ToString();

                    // 規定風量
                    insertRow.BurowaKiteiFuryo = row.Cells["BurowaKiteiFuryoCol"].Value.ToString();

                    insertRow.InsertDt = now;
                    insertRow.InsertTarm = terminal;
                    insertRow.InsertUser = loginUser;
                    insertRow.UpdateDt = now;
                    insertRow.UpdateTarm = terminal;
                    insertRow.UpdateUser = loginUser;

                    // 行を挿入
                    insertDT.AddKatashikiBurowaMstRow(insertRow);

                    // 行の状態を設定
                    insertRow.AcceptChanges();

                    // 行の状態を設定(新規)
                    insertRow.SetAdded();
                }
            }

            return insertDT;
        }
コード例 #3
0
ファイル: KatashikiMstShosai.cs プロジェクト: 25cm/HelloWorld
        ////////////////////////////////////////////////////////////////////////////
        //  メソッド名 : CreateBuroDTUpdate
        /// <summary>
        /// 
        /// </summary>
        /// <param name="now"></param>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/09  DatNT      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable CreateBuroDTUpdate(DateTime now)
        {
            KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable dataTable = new KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable();

            foreach (DataRow dr in _katashikiBurowaMstDT)
            {
                if (!string.IsNullOrEmpty(dr["BurowaNinsou"].ToString())
                    && !string.IsNullOrEmpty(dr["BurowaRenban"].ToString())
                    && !string.IsNullOrEmpty(dr["BurowaKiteiBurowaNm"].ToString())
                    && !string.IsNullOrEmpty(dr["BurowaKiteiFuryo"].ToString()))
                {
                    dr["InsertDt"] = now;
                    dr["InsertUser"] = loginUser;
                    dr["InsertTarm"] = terminal;
                    dr["UpdateDt"] = now;
                    dr["UpdateUser"] = loginUser;
                    dr["UpdateTarm"] = terminal;

                    dataTable.ImportRow(dr);
                }
            }
            return dataTable;
        }
コード例 #4
0
ファイル: KatashikiMstShosai.cs プロジェクト: 25cm/HelloWorld
        ////////////////////////////////////////////////////////////////////////////
        //  メソッド名 : DoUpdate
        /// <summary>
        /// 
        /// </summary>
        /// <history>
        /// 日付    担当者   内容
        /// 2014/07/08  DatNT      新規作成
        /// </history>
        ////////////////////////////////////////////////////////////////////////////
        private void DoUpdate()
        {
            // KatashikiMst
            KatashikiMstDataSet.KatashikiMstDataTable mstDT = new KatashikiMstDataSet.KatashikiMstDataTable();

            // KatashikiBurowaMst
            KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable buroDT = new KatashikiBurowaMstDataSet.KatashikiBurowaMstDataTable();

            // KatashikiBetsuTaniSochiMst
            KatashikiBetsuTaniSochiMstDataSet.KatashikiBetsuTaniSochiMstDataTable sochiDT = new KatashikiBetsuTaniSochiMstDataSet.KatashikiBetsuTaniSochiMstDataTable();

            // current time
            DateTime now = Common.Common.GetCurrentTimestamp();

            if (_updateMode == DispMode.Add)
            {
                mstDT = CreateMstDTInsert(now);

                buroDT = CreateBuroDTInsert(now);

                sochiDT = CreateSochiDTInsert(now);
            }
            else
            {
                mstDT = CreateMstDTUpdate(_mstDT, now);

                buroDT = CreateBuroDTUpdate(now);

                sochiDT = CreateSochiDTInsert(now);
            }

            IDecisionBtnClickALInput alInput = new DecisionBtnClickALInput();
            alInput.DispMode = _updateMode;
            alInput.KatashikiMstDT = mstDT;
            alInput.KatashikiBurowaMstDT = buroDT;
            alInput.KatashikiBetsuTaniSochiMstDT = sochiDT;
            IDecisionBtnClickALOutput alOutput = new DecisionBtnClickApplicationLogic().Execute(alInput);

            if (!string.IsNullOrEmpty(alOutput.ErrorMessage))
            {
                MessageForm.Show2(MessageForm.DispModeType.Error, alOutput.ErrorMessage);
            }
            else
            {
                KatashikiMstListForm frm = new KatashikiMstListForm();
                Program.mForm.ShowForm(frm);
            }
        }