private void MenuItemNew_Click(object sender, EventArgs e) { LaBelleNewForm FromLaBelleNew = new LaBelleNewForm(); FromLaBelleNew.ShowDialog(); if (FromLaBelleNew.DialogResult == DialogResult.OK) { LaBelleForm FromLaBelle = new LaBelleForm(); FromLaBelle.MdiParent = this; FromLaBelle.ProductType = FromLaBelleNew.ProductType; FromLaBelle.Show(); } }
private void showEditDataWnd(PRODUCT_TYPE nProductType, string strNumber) { List<string> listDBField = new List<string>(); List<string> listDBEntry = new List<string>(); listDBEntry.Add(String.Format("{0} in ({1})", LaBelleCmnDef.strDBNumber, strNumber)); string strTableName = LaBelleCmnDef.strDBTableName[(uint)nProductType]; List<Dictionary<string, string>> listData = dbLaBelleExcel.Select(strTableName, listDBField, listDBEntry); if (listData.Count != 1) MessageBox.Show(String.Format("搜尋到{0}筆資料", listData.Count), "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error); LaBelleForm FormLaBelle = new LaBelleForm(); FormLaBelle.MdiParent = this; FormLaBelle.ProductType = nProductType; FormLaBelle.LaBelleFormStatus = LABELLE_FORM_STATUS.LABELLE_FORM_STATUS_EDIT; FormLaBelle.DBNumber = Convert.ToUInt32(strNumber); FormLaBelle.Visible = false; FormLaBelle.Show(); FormLaBelle.UpdateCtrlFromDB(listData[0]); FormLaBelle.Visible = true; }