/// <summary>インサート</summary> private void btnInsert2_Click(object sender, EventArgs e) { // 色のクリア this.ClearColor2(); // 引数 TestParameterValue testParameterValue = new TestParameterValue( this.Name, ((Button)sender).Name, "Insert", "SQL", this.myUserInfo); // データを入力できないのでパス //testParameterValue.field1 = this.txtCategoryID; // CategoryID //this.txtCategoryID.BackColor = Color.LightYellow; testParameterValue.field2 = this.txtCategoryName.Text; // CategoryName this.txtCategoryName.BackColor = Color.LightYellow; testParameterValue.field3 = this.txtDescription.Text; // Description this.txtDescription.BackColor = Color.LightYellow; // データを入力できないのでパス //testParameterValue.field4 = this.txtPicture.Text; // Picture //this.txtPicture.BackColor = Color.LightYellow; // B層呼び出し LayerB_Dynamic lb = new LayerB_Dynamic(); TestReturnValue testReturnValue = (TestReturnValue)lb.DoBusinessLogic(testParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); // コミット BaseLogic2CS.CommitAndClose(); // データグリッドを更新 this.btnSelectAll2_Click(sender, e); }
/// <summary>デリート</summary> private void btnDelete2_Click(object sender, EventArgs e) { // 色のクリア this.ClearColor2(); // 引数 TestParameterValue testParameterValue = new TestParameterValue( this.Name, ((Button)sender).Name, "Delete", "SQL", this.myUserInfo); // 検索条件 testParameterValue.field1_ForSearch = txtCategoryID_where.Text; // CategoryID_where txtCategoryID_where.BackColor = Color.LightYellow; testParameterValue.field2_ForSearch = txtCategoryName_where.Text; // CategoryName_where txtCategoryName_where.BackColor = Color.LightYellow; // 検索条件に使えない↓ //testParameterValue.field3_ForSearch = txtDescription_where.Text; // Description_where //txtDescription_where.BackColor = Color.LightYellow; //testParameterValue.field4_ForSearch = txtPicture_where.Text; // Picture //txtPicture_where.BackColor = Color.LightYellow; // B層呼び出し LayerB_Dynamic lb = new LayerB_Dynamic(); TestReturnValue testReturnValue = (TestReturnValue)lb.DoBusinessLogic(testParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); // コミット BaseLogic2CS.CommitAndClose(); // データグリッドを更新 this.btnSelectAll2_Click(sender, e); }
/// <summary>Categoryテーブルの取得</summary> private DataTable GetCategory(string controlId) { // 引数 TestParameterValue testParameterValue = new TestParameterValue( this.Name, controlId, "SelectAll", "SQL", this.myUserInfo); // B層呼び出し LayerB_Dynamic lb = new LayerB_Dynamic(); TestReturnValue testReturnValue = (TestReturnValue)lb.DoBusinessLogic(testParameterValue, DbEnum.IsolationLevelEnum.ReadCommitted); // コミット BaseLogic2CS.CommitAndClose(); // 戻り値 return (DataTable)testReturnValue.dt; }