private void fab_OnClick(object sender, EventArgs e) { var wizard = new ReasonCodeWizard(); wizard.EditMode = EnumHelper.EditMode.Add; wizard.ShowDialog(); }
private void SetAttributes() { #region color boxes this.dtpEffectiveDate.BackColor = SystemInfoHelper.ControlBackColor.RequiredBox; this.txtTxType.BackColor = SystemInfoHelper.ControlBackColor.DisabledBox; this.txtCreatedOn.BackColor = SystemInfoHelper.ControlBackColor.DisabledBox; this.txtModifiedBy.BackColor = SystemInfoHelper.ControlBackColor.DisabledBox; this.txtModifiedOn.BackColor = SystemInfoHelper.ControlBackColor.DisabledBox; this.txtTxNumber.BackColor = SystemInfoHelper.ControlBackColor.DisabledBox; #endregion // Loading Details Page /** * details = new PriceMgmtWizard_Details(); * details.HeaderId = this.HeaderId; * details.ListType = _PMType; * details.Dock = DockStyle.Bottom; * pnlDetails.Controls.Add(details); */ lvItemList.Dock = DockStyle.Fill; lvItemList.GridLines = true; switch (_PMType) { case EnumHelper.PriceMgmtPMType.Price: colAverageCost.Visible = colOldPrice.Visible = colNewPrice.Visible = colOldMarkUp.Visible = colNewMarkUp.Visible = colDiff.Visible = colOldDiscount.Visible = colNewDiscount.Visible = true; colUpdateVipDiscount.Visible = colFixedPriceItem.Visible = colDiscountForDiscountItem.Visible = colDiscountForFixedPriceItem.Visible = colDiscountForNoDiscountItem.Visible = colStaffDiscount.Visible = false; break; case EnumHelper.PriceMgmtPMType.Discount: colAverageCost.Visible = colOldPrice.Visible = colNewPrice.Visible = colOldMarkUp.Visible = colNewMarkUp.Visible = colDiff.Visible = colOldDiscount.Visible = colNewDiscount.Visible = false; colUpdateVipDiscount.Visible = colFixedPriceItem.Visible = colDiscountForDiscountItem.Visible = colDiscountForFixedPriceItem.Visible = colDiscountForNoDiscountItem.Visible = colStaffDiscount.Visible = true; break; } #region 設定 clickable Reason Code label //lblReasonCode.AutoSize = true; // 減少 whitespace,有字嘅位置先可以 click lblReasonCode.Cursor = Cursors.Hand; // cursor over 顯示 hand cursor lblReasonCode.Click += (s, e) => // 彈出 wizard { var dialog = new ReasonCodeWizard(); dialog.FormClosed += (sender, eventArgs) => // 關閉後 refresh 個 combo box items { FillReasonCombo(); }; dialog.ShowDialog(); }; #endregion }
/// <summary> /// Saves the new message handler. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void SaveNewMessageHandler(object sender, EventArgs e) { if (((Form)sender).DialogResult == DialogResult.Yes) { if (Save()) { Helper.DesktopHelper.RefreshMainList <DiscountReasonList>(); this.Close(); ReasonCodeWizard wizard = new ReasonCodeWizard(); wizard.EditMode = EnumHelper.EditMode.Add; wizard.ShowDialog(); } } }
private void ShowItem() { if (lvList.SelectedItem != null) { Guid id = Guid.Empty; if (Guid.TryParse(lvList.SelectedItem.SubItems[2].Text, out id)) { ReasonCodeWizard wizReason = new ReasonCodeWizard(); wizReason.ReasonId = id; wizReason.EditMode = EnumHelper.EditMode.Edit; wizReason.Closed += new EventHandler(wizReason_Closed); wizReason.ShowDialog(); } } }
void cmdMenuClick(object sender, MenuItemEventArgs e) { //Control[] controls = this.Form.Controls.Find("wspPane", true); //if (controls.Length > 0) //{ // Panel wspPane = (Panel)controls[0]; // wspPane.Text = (string)e.MenuItem.Text; //} if (!(e.MenuItem.Tag == null)) { switch (e.MenuItem.Tag.ToString().ToLower()) { case "pricechange_worksheet": PriceMgmtWizard wizPriceChange = new PriceMgmtWizard(); wizPriceChange.EditMode = EnumHelper.EditMode.Add; wizPriceChange.TxType = EnumHelper.PriceMgmtTxType.PMC; wizPriceChange.PMType = EnumHelper.PriceMgmtPMType.Price; wizPriceChange.ShowDialog(); break; case "pricechange_authorization": Authorization wizAuthPrice = new Authorization(); wizAuthPrice.ListType = EnumHelper.PriceMgmtPMType.Price; wizAuthPrice.ShowDialog(); break; case "discchange_worksheet": PriceMgmtWizard wizDiscChange = new PriceMgmtWizard(); wizDiscChange.EditMode = EnumHelper.EditMode.Add; wizDiscChange.TxType = EnumHelper.PriceMgmtTxType.PMC; wizDiscChange.PMType = EnumHelper.PriceMgmtPMType.Discount; wizDiscChange.ShowDialog(); break; case "discchange_authorization": Authorization wizAuthDisc = new Authorization(); wizAuthDisc.ListType = EnumHelper.PriceMgmtPMType.Discount; wizAuthDisc.ShowDialog(); break; case "reason_code": ReasonCodeWizard wizReasonCode = new ReasonCodeWizard(); wizReasonCode.EditMode = EnumHelper.EditMode.Add; wizReasonCode.ShowDialog(); break; case "rpt_pricechangeworksheet": Reports.Worksheet wizPriceWorksheet = new RT2020.PriceMgmt.Reports.Worksheet(); wizPriceWorksheet.ReportType = EnumHelper.PriceMgmtPMType.Price; wizPriceWorksheet.ShowDialog(); break; case "rpt_pricechangehistory": Reports.History wizPriceHistory = new RT2020.PriceMgmt.Reports.History(); wizPriceHistory.ReportType = EnumHelper.PriceMgmtPMType.Price; wizPriceHistory.ShowDialog(); break; case "rpt_discountchangeworksheet": Reports.Worksheet wizDiscWorksheet = new RT2020.PriceMgmt.Reports.Worksheet(); wizDiscWorksheet.ReportType = EnumHelper.PriceMgmtPMType.Discount; wizDiscWorksheet.ShowDialog(); break; case "rpt_discountchangehistory": Reports.History wizDiscHistory = new RT2020.PriceMgmt.Reports.History(); wizDiscHistory.ReportType = EnumHelper.PriceMgmtPMType.Discount; wizDiscHistory.ShowDialog(); break; } } }