/*--- 建立新的問事表 ---*/ private void btnCreate_Click(object sender, EventArgs e) { string strPlace = btnSelectPlace.Text; if (strPlace == "選擇地點") { lblPlaceMsg.Visible = true; //顯示『必須選擇地點』 return; } string strDate = todayDate.Value.ToString("yyyyMMdd"); string tableName = strDate + strPlace; //建立問事表名稱 /*-- 確認資料庫中是否存在相同問事表 --*/ if (CheckTabelIsExist(tableName)) { FormFunction form = new FormFunction(); form.OpenFocusForm(new Message.WarningForm("資料表已經存在")); } else { askingTable.date = todayDate.Value; //設定建表日期 askingTable.placeName = strPlace; //設定建表地點 askingTable.CreateLabelandTable(tableName, false); this.Close(); // 關閉 NewTableForm askingTable.formFun.CloseMenu(); // 關閉HomeForm } }
/*------ 4個功能 *-『btnOpen_Click』:開啟舊問事表 *-『btnDelete_Click』:刪除整個問事表(包含問事紀錄) *-『btnExportPDF_Click』:匯出PDF *-『』: *-------------------------*/ /*--- 開啟舊問事表 ---*/ private void btnOpen_Click(object sender, EventArgs e) { SetDateAndPlace(formTitle.Text); askingTable.CreateLabelandTable(formTitle.Text, true); this.Close(); //關閉 BrowseTablesEdit askingTable.formFun.CloseMenu(); // 關閉HomeForm }