private void formSaving() { this.form_mode = FORM_MODE.SAVING; this.msk2Sernum.Enabled = false; this.txtVersion.Enabled = false; this.txtDealer.Enabled = false; this.btnBrowseDealer.Enabled = false; this.btnOK.Enabled = false; this.btnCancel.Enabled = false; this.toolStripProcess.Visible = true; }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.toolStripProcessing.Visible = true; this.dgvHistory.Enabled = false; this.dtStart.Enabled = false; this.dtEnd.Enabled = false; this.cbUsers.Enabled = false; this.txtCompnam.Read_Only = true; }
private void FormReading() { this.form_mode = FORM_MODE.READING; this.toolStripProcessing.Visible = false; this.dgvHistory.Enabled = true; this.dtStart.Enabled = true; this.dtEnd.Enabled = true; this.cbUsers.Enabled = true; this.txtCompnam.Read_Only = false; this.txtDummy.Focus(); }
private void formEdit() { this.form_mode = FORM_MODE.EDIT; this.mskSernumTo.Enabled = true; this.txtVersion.Enabled = true; this.chkCDTraining.Enabled = true; this.chkNewRwt.Enabled = true; this.chkNewRwtJob.Enabled = true; this.btnOK.Enabled = true; this.btnCancel.Enabled = true; this.toolStripProcess.Visible = false; }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.F6) { this.form_mode = FORM_MODE.READ; this.tabControl2.SelectedTab = this.tabIV; this.dgvIV.Refresh(); this.dgvSTCRD.Refresh(); this.dgvIV.Focus(); } if (keyData == Keys.F7) { this.form_mode = FORM_MODE.READ; this.tabControl2.SelectedTab = this.tabHS; this.dgvHS.Refresh(); this.dgvSTCRD.Refresh(); this.dgvHS.Focus(); } if (keyData == Keys.F8) { this.form_mode = FORM_MODE.READ_ITEM; this.dgvSTCRD.Refresh(); this.dgvIV.Refresh(); this.dgvHS.Refresh(); this.dgvSTCRD.Focus(); } if (keyData == (Keys.Alt | Keys.E)) { if (this.form_mode == FORM_MODE.READ_ITEM) { if (this.dgvSTCRD.Rows.Count > 0) { this.ShowWarrantyForm(); return(true); } } } if (keyData == Keys.Enter) { if (this.txtSearchDocnum.Focused) { this.btnSearch.PerformClick(); return(true); } } return(base.ProcessCmdKey(ref msg, keyData)); }
/// <summary> /// Form for Add/Edit istab data /// </summary> /// <param name="mode">Specify mode (add or edit)</param> /// <param name="tabtyp">Tabtyp value</param> /// <param name="istab_data">istab data to edit(for edit mode only)</param> public IstabAddEditForm(FORM_MODE mode, Istab.TABTYP tabtyp, Istab istab_data = null) { InitializeComponent(); this.istab = istab_data; this.tabtyp = tabtyp; EscapeKeyToCloseDialog.ActiveEscToClose(this); EnterKeyManager.Active(this); this.mode = mode; this.initializeForm(); }
public SellBookForm(SnWindow parent_window) { InitializeComponent(); this.parent_window = parent_window; this.G = this.parent_window.G; this.form_mode = FORM_MODE.EDIT; List<MaskedTextBox> lmsk = new List<MaskedTextBox>(); lmsk.Add(this.mskAsDate); List<DateTimePicker> ldtp = new List<DateTimePicker>(); ldtp.Add(this.dpAsDate); PairDatePickerWithMaskedTextBox.Attach(lmsk, ldtp); }
private void formSaving() { this.form_mode = FORM_MODE.SAVING; this.mskSernum.Enabled = false; this.numQty.Enabled = false; this.txtVersion.Enabled = false; this.txtDealer.Enabled = false; this.chkCDTraining.Enabled = false; this.chkNewRwt.Enabled = false; this.chkNewRwtJob.Enabled = false; this.btnBrowseDealer.Enabled = false; this.btnOK.Enabled = false; this.btnCancel.Enabled = false; this.toolStripProcess.Visible = true; }
private void BoardSettingFrm_Load(object sender, EventArgs e) { panelGrid.Top = panelSite.Top; m_curMeta = new BoardMeta(); m_curMeta.Type = (int)BoardType.Site; FillData(); m_mode = FORM_MODE.Add; if (!VsmdController.GetVsmdController().IsInitialized()) { StatusBar.DisplayMessage(MessageType.Error, "设备未连接!"); DisableControls(); return; } }
public SellBookForm(SnWindow parent_window) { InitializeComponent(); this.parent_window = parent_window; this.G = this.parent_window.G; this.form_mode = FORM_MODE.EDIT; List <MaskedTextBox> lmsk = new List <MaskedTextBox>(); lmsk.Add(this.mskAsDate); List <DateTimePicker> ldtp = new List <DateTimePicker>(); ldtp.Add(this.dpAsDate); PairDatePickerWithMaskedTextBox.Attach(lmsk, ldtp); }
private void FormRead() { this.form_mode = FORM_MODE.READ; this.ClearInlineForm(); this.toolStripAdd.Enabled = true; this.toolStripEdit.Enabled = true; this.toolStripDelete.Enabled = true; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripReload.Enabled = true; this.dgvIstab.Enabled = true; this.toolStripProcessing.Visible = false; this.dgvIstab.Focus(); }
private void StmasDialog_Load(object sender, EventArgs e) { if (!this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.ShowWaitForm(); } this.LoadComboboxItem(); this.current_stmas = this.LoadSingleStmasFromServer(RECORD_NAVIGATION.LAST); this.FillForm(this.current_stmas); if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } this.form_mode = FORM_MODE.READ; this.SetFormControlState(); }
private void SellProgram2nd_Load(object sender, EventArgs e) { this.BackColor = ColorResource.BACKGROUND_COLOR_BEIGE; this.form_mode = FORM_MODE.EDIT; this.lblDealer_Compnam.Text = ""; this.mskOldSernum.Text = this.parent_window.serial.sernum; this.msk2Sernum.Focus(); this.msk2Sernum.Leave += new EventHandler(this.validateSernumFieldLeave); this.msk2Sernum.GotFocus += new EventHandler(this.onControlFocusedHandler); this.txtVersion.GotFocus += new EventHandler(this.onControlFocusedHandler); this.txtDealer.GotFocus += new EventHandler(this.onControlFocusedHandler); this.btnOK.GotFocus += new EventHandler(this.onControlFocusedHandler); this.btnCancel.GotFocus += new EventHandler(this.onControlFocusedHandler); this.msk2Sernum.Enter += new EventHandler(this.onControlEnterHandler); this.txtVersion.Enter += new EventHandler(this.onControlEnterHandler); this.txtDealer.Enter += new EventHandler(this.onControlEnterHandler); this.msk2Sernum.Leave += new EventHandler(this.onControlLeaveHandler); this.txtVersion.Leave += new EventHandler(this.onControlLeaveHandler); this.txtDealer.Leave += new EventHandler(this.onControlLeaveHandler); this.txtVersion.Leave += delegate { if (this.txtVersion.Text.Length == 0) { if (ValidateSN.Check(this.msk2Sernum.Text)) { this.txtVersion.Text = this.msk2Sernum.Text.Substring(2, 1) + "." + this.msk2Sernum.Text.Substring(3, 1); } else { this.txtVersion.Text = ""; } } }; this.txtDealer.Leave += new EventHandler(this.validateDealerField); }
private void FormReadItem() { #region no use //this.form_mode = FORM_MODE.READ_ITEM; //this.setToolStripFormMode(); //this.Cursor = Cursors.Default; //this.main_form.Cursor = Cursors.Default; //this.btnSwithToRefnum.TabStop = true; //this.main_form.toolStripProcessing.Visible = false; //this.main_form.menuStrip1.Enabled = true; //this.dgvProblem.Focus(); //this.transLayerHeader.Visible = false; //this.transLayerBody1.Visible = false; //this.transLayerBody2.Visible = false; //this.main_form.toolStripInfo.Text = ""; #endregion no use this.form_mode = FORM_MODE.READ_ITEM; this.toolStripProcessing.Visible = false; this.toolStripInfo.Text = ""; #region Toolstrip Button this.toolStripAdd.Enabled = false; this.toolStripEdit.Enabled = false; this.toolStripDelete.Enabled = false; this.toolStripStop.Enabled = true; this.toolStripSave.Enabled = true; this.toolStripFirst.Enabled = false; this.toolStripPrevious.Enabled = false; this.toolStripNext.Enabled = false; this.toolStripLast.Enabled = false; this.toolStripItem.Enabled = false; this.toolStripImport.Enabled = false; this.toolStripGenSN.Enabled = false; this.toolStripUpgrade.Enabled = false; this.toolStripBook.Enabled = false; this.toolStripSet2.Enabled = false; this.toolStripSearch.Enabled = false; this.toolStripInquiryAll.Enabled = false; this.toolStripInquiryRest.Enabled = false; this.toolStripSearchArea.Enabled = false; this.toolStripSearchBusityp.Enabled = false; this.toolStripSearchCompany.Enabled = false; this.toolStripSearchContact.Enabled = false; this.toolStripSearchDealer.Enabled = false; this.toolStripSearchOldnum.Enabled = false; this.toolStripSearchSN.Enabled = false; this.toolStripReload.Enabled = false; #endregion Toolstrip Button #region Button this.btnBrowseArea.Enabled = false; this.btnBrowseBusityp.Enabled = false; this.btnBrowseDealer.Enabled = false; this.btnBrowseHowknown.Enabled = false; this.chkIMOnly.Enabled = true; this.btnLostRenew.Enabled = false; this.btnSwithToRefnum.Enabled = false; this.btnCD.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnCD.Enabled = false; this.btnUP.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUP.Enabled = false; this.btnUPNewRwt.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwt.Enabled = false; this.btnUPNewRwtJob.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwtJob.Enabled = false; this.btnSupportNote.Enabled = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SUPPORT || this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SALES ? (this.main_form.lblTimeDuration.Visible ? false : true) : false); this.btnSupportViewNote.Enabled = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SUPPORT || this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SALES ? true : false); this.btnPasswordAdd.Enabled = false; this.btnPasswordRemove.Enabled = false; this.btnEditMA.Enabled = false; this.btnDeleteMA.Enabled = false; #endregion Button #region DatePicker this.dtPurdat.Read_Only = true; this.dtExpdat.Read_Only = true; this.dtManual.Read_Only = true; this.dtVerextdat.Read_Only = true; #endregion DatePicker #region Inline Problem Form if (this.dgvProblem.Parent.Controls.Find("inline_problem_date", true).Length > 0) { CustomDateTimePicker date = (CustomDateTimePicker)this.dgvProblem.Parent.Controls.Find("inline_problem_date", true)[0]; date.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_name", true).Length > 0) { CustomTextBox name = (CustomTextBox)this.dgvProblem.Parent.Controls.Find("inline_problem_name", true)[0]; name.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true).Length > 0) { CustomBrowseField probcod = (CustomBrowseField)this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true)[0]; probcod._ReadOnly = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true).Length > 0) { CustomTextBoxMaskedWithLabel probdesc = (CustomTextBoxMaskedWithLabel)this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true)[0]; probdesc.Read_Only = true; } #endregion Inline Problem Form this.dgvProblem.Enabled = true; this.dgvProblem.Focus(); this.dgvProblem.Rows[0].Cells[1].Selected = true; }
private void FormEditItem() { this.form_mode = FORM_MODE.EDIT_ITEM; this.toolStripProcessing.Visible = false; #region Toolstrip button this.toolStripEdit.Enabled = false; this.toolStripStop.Enabled = true; this.toolStripSave.Enabled = true; this.toolStripItem.Enabled = false; #endregion Toolstrip button #region Form control this.rbHoliday.Enabled = false; this.rbWeekday.Enabled = false; this.leaveMax.Enabled = false; #endregion Form control }
public UserAddEditDialog(MainForm main_form, InternalUsers user = null) : this() { this.main_form = main_form; this.form_mode = FORM_MODE.EDIT; this.user = user; }
public static void SetControlVisibility(this Component comp, FORM_MODE[] form_mode_to_visible, FORM_MODE form_mode) { if (form_mode_to_visible.Where(fm => fm == form_mode).Count() > 0) { if (comp is Control) { ((Control)comp).Visible = true; return; } } else { if (comp is Control) { ((Control)comp).Visible = false; return; } } }
private void FormReadF8() { this.form_mode = FORM_MODE.READ_F8; this.toolStripProcessing.Visible = false; this.btnStop.Enabled = true; this.btnSave.Enabled = false; this.btnCopy.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnReload.Enabled = false; this.dgvTrainer.Enabled = true; this.dgvStat.Enabled = false; this.dgvTrainer.Focus(); }
private void FormSaving() { this.form_mode = FORM_MODE.SAVING; this.toolStripProcessing.Visible = true; #region Toolstrip Button this.toolStripAdd.Enabled = false; this.toolStripEdit.Enabled = false; this.toolStripDelete.Enabled = false; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripFirst.Enabled = false; this.toolStripPrevious.Enabled = false; this.toolStripNext.Enabled = false; this.toolStripLast.Enabled = false; this.toolStripItem.Enabled = false; this.toolStripImport.Enabled = false; this.toolStripGenSN.Enabled = false; this.toolStripUpgrade.Enabled = false; this.toolStripBook.Enabled = false; this.toolStripSet2.Enabled = false; this.toolStripSearch.Enabled = false; this.toolStripInquiryAll.Enabled = false; this.toolStripInquiryRest.Enabled = false; this.toolStripSearchArea.Enabled = false; this.toolStripSearchBusityp.Enabled = false; this.toolStripSearchCompany.Enabled = false; this.toolStripSearchContact.Enabled = false; this.toolStripSearchDealer.Enabled = false; this.toolStripSearchOldnum.Enabled = false; this.toolStripSearchSN.Enabled = false; this.toolStripReload.Enabled = false; #endregion Toolstrip Button #region Button this.btnBrowseArea.Enabled = false; this.btnBrowseBusityp.Enabled = false; this.btnBrowseDealer.Enabled = false; this.btnBrowseHowknown.Enabled = false; this.chkIMOnly.Enabled = false; this.btnLostRenew.Enabled = false; this.btnSwithToRefnum.Enabled = false; this.btnCD.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnCD.Enabled = false; this.btnUP.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUP.Enabled = false; this.btnUPNewRwt.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwt.Enabled = false; this.btnUPNewRwtJob.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwtJob.Enabled = false; this.btnSupportNote.Enabled = false; this.btnSupportViewNote.Enabled = false; this.btnPasswordAdd.Enabled = false; this.btnPasswordRemove.Enabled = false; this.btnEditMA.Enabled = false; this.btnDeleteMA.Enabled = false; #endregion Button #region DatePicker this.dtPurdat.Read_Only = true; this.dtExpdat.Read_Only = true; this.dtManual.Read_Only = true; this.dtVerextdat.Read_Only = true; #endregion DatePicker this.EditControlReadState(); }
private void FormEditBreak() { this.form_mode = FORM_MODE.EDIT_BREAK; this.txtDummy.Focus(); this.parent_window.btnSupportNote.Enabled = false; this.toolStripProcessing.Visible = false; #region TOOLSTRIP this.toolStripAdd.Enabled = false; this.toolStripEdit.Enabled = false; this.toolStripBreak.Enabled = false; this.toolStripTeacher.Enabled = false; this.toolStripStop.Enabled = true; this.toolStripSave.Enabled = true; this.toolStripPrint.Enabled = false; #endregion TOOLSTRIP #region FORM CONTROL this.dtWorkDate.Read_Only = true; this.txtSernum.Read_Only = true; this.txtContact.Read_Only = false; this.chAssets.Enabled = true; this.chError.Enabled = true; this.chFonts.Enabled = true; this.chForm.Enabled = true; this.chInstall.Enabled = true; this.chMailWait.Enabled = true; this.chMapDrive.Enabled = true; this.chPeriod.Enabled = true; this.chPrint.Enabled = true; this.chRepExcel.Enabled = true; this.chSecure.Enabled = true; this.chStatement.Enabled = true; this.chStock.Enabled = true; this.chTraining.Enabled = true; this.chYearEnd.Enabled = true; this.txtRemark.Enabled = true; this.btnViewNote.Enabled = false; this.dtBreakStart.Enabled = (PreferenceForm.BREAK_TIME_METHOD_CONFIGURATION() == (int)PreferenceForm.BREAK_TIME.MANUAL ? true : false); this.dtBreakEnd.Enabled = (PreferenceForm.BREAK_TIME_METHOD_CONFIGURATION() == (int)PreferenceForm.BREAK_TIME.MANUAL ? true : false); this.btnMA.Enabled = false; #endregion FORM CONTROL if (this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Maximized; } this.tabControl1.Height = 220; this.splitContainer1.SplitterDistance = 302; //this.dgvNote.Tag = HelperClass.DGV_TAG.LEAVE; //this.dgvNote.Refresh(); this.dgvNote.Enabled = false; }
private void FormEdit() { this.form_mode = FORM_MODE.EDIT; this.toolStripProcessing.Visible = false; this.btnStop.Enabled = true; this.btnSave.Enabled = true; this.btnCopy.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnReload.Enabled = false; this.dgvTrainer.Enabled = false; this.dgvStat.Enabled = false; }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.txtDummy.Focus(); this.toolStripProcessing.Visible = true; #region TOOLSTRIP this.toolStripAdd.Enabled = false; this.toolStripEdit.Enabled = false; this.toolStripBreak.Enabled = false; this.toolStripTeacher.Enabled = false; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripPrint.Enabled = false; #endregion TOOLSTRIP #region FORM CONTROL this.dtWorkDate.Read_Only = true; this.txtSernum.Read_Only = true; this.txtContact.Read_Only = true; this.chAlsoF8.Enabled = false; this.chAssets.Enabled = false; this.chError.Enabled = false; this.chFonts.Enabled = false; this.chForm.Enabled = false; this.chInstall.Enabled = false; this.chMailWait.Enabled = false; this.chMapDrive.Enabled = false; this.chPeriod.Enabled = false; this.chPrint.Enabled = false; this.chRepExcel.Enabled = false; this.chSecure.Enabled = false; this.chStatement.Enabled = false; this.chStock.Enabled = false; this.chTraining.Enabled = false; this.chYearEnd.Enabled = false; this.txtRemark.Enabled = false; this.btnViewNote.Enabled = false; this.btnMA.Enabled = false; #endregion FORM CONTROL this.dgvNote.Tag = HelperClass.DGV_TAG.LEAVE; this.dgvNote.Refresh(); this.dgvNote.Enabled = false; }
private void FormRead() { this.form_mode = FORM_MODE.READ; //this.txtDummy.Focus(); this.toolStripProcessing.Visible = false; #region TOOLSTRIP this.toolStripAdd.Enabled = true; this.toolStripEdit.Enabled = true; this.toolStripBreak.Enabled = true; this.toolStripTeacher.Enabled = (this.main_form.G.loged_in_user_training_expert ? true : false); this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripPrint.Enabled = true; #endregion TOOLSTRIP #region FORM CONTROL this.dtWorkDate.Read_Only = false; this.txtSernum.Read_Only = true; this.txtContact.Read_Only = true; this.chAlsoF8.Enabled = false; this.chAssets.Enabled = false; this.chError.Enabled = false; this.chFonts.Enabled = false; this.chForm.Enabled = false; this.chInstall.Enabled = false; this.chMailWait.Enabled = false; this.chMapDrive.Enabled = false; this.chPeriod.Enabled = false; this.chPrint.Enabled = false; this.chRepExcel.Enabled = false; this.chSecure.Enabled = false; this.chStatement.Enabled = false; this.chStock.Enabled = false; this.chTraining.Enabled = false; this.chYearEnd.Enabled = false; this.txtRemark.Enabled = false; this.btnViewNote.Enabled = true; this.btnViewDetail.Enabled = false; this.btnViewPassword.Enabled = false; this.picCheck.Visible = false; this.btnMA.Enabled = false; #endregion FORM CONTROL this.splitContainer1.SplitterDistance = 78; this.tabControl1.Height = 0; this.main_form.lblTimeDuration.Visible = false; this.dgvNote.Enabled = true; this.dgvNote.Tag = HelperClass.DGV_TAG.READ; this.dgvNote.Refresh(); this.dgvNote.Focus(); }
private void FormReadItem() { this.form_mode = FORM_MODE.READ_ITEM; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripPrint.Enabled = true; this.toolStripPrintDetail.Enabled = true; this.toolStripPrintSummary.Enabled = true; this.toolStripExport.Enabled = true; this.toolStripExportDetail.Enabled = true; this.toolStripExportSummary.Enabled = true; this.toolStripRange.Enabled = true; this.ClearInlineFormLeaveList(); this.dgvAbsentSummary.Enabled = true; this.dgvServiceSummary.Enabled = true; this.dgvLeaveList.Enabled = true; this.dgvLeaveList.Focus(); }
private void FormEdit() { #region no use //this.tabControl1.SelectedTab = this.tabPage1; //this.form_mode = FORM_MODE.EDIT; //this.setToolStripFormMode(); //this.Cursor = Cursors.Default; //this.main_form.Cursor = Cursors.Default; //this.main_form.toolStripProcessing.Visible = false; //this.main_form.menuStrip1.Enabled = true; //List<Control> lct = new List<Control>(); //lct.Add(this.txtVersion); //lct.Add(this.txtArea); //lct.Add(this.mskRefnum); //lct.Add(this.txtPrenam); //lct.Add(this.txtCompnam); //lct.Add(this.txtAddr01); //lct.Add(this.txtAddr02); //lct.Add(this.txtAddr03); //lct.Add(this.txtZipcod); //lct.Add(this.txtTelnum); //lct.Add(this.txtFaxnum); //lct.Add(this.txtContact); //lct.Add(this.txtPosition); //lct.Add(this.mskOldnum); //lct.Add(this.txtRemark); //lct.Add(this.txtBusides); //lct.Add(this.txtBusityp); //lct.Add(this.txtDealer_dealer); //lct.Add(this.txtHowknown); //lct.Add(this.mskPurdat); //lct.Add(this.mskExpdat); //lct.Add(this.txtReg); //lct.Add(this.mskManual); //lct.Add(this.cbVerext); //lct.Add(this.mskVerextdat); //List<Label> llb = new List<Label>(); //llb.Add(this.lblVersion); //llb.Add(this.lblArea); //llb.Add(this.lblRefnum); //llb.Add(this.lblPrenam); //llb.Add(this.lblCompnam); //llb.Add(this.lblAddr01); //llb.Add(this.lblAddr02); //llb.Add(this.lblAddr03); //llb.Add(this.lblZipcod); //llb.Add(this.lblTelnum); //llb.Add(this.lblFaxnum); //llb.Add(this.lblContact); //llb.Add(this.lblPosition); //llb.Add(this.lblOldnum); //llb.Add(this.lblRemark); //llb.Add(this.lblBusides); //llb.Add(this.lblBusityp); //llb.Add(this.lblDealer_dealer); //llb.Add(this.lblHowknown); //llb.Add(this.lblPurdat); //llb.Add(this.lblExpdat); //llb.Add(this.lblReg); //llb.Add(this.lblManual); //llb.Add(this.lblVerext); //llb.Add(this.lblVerextdat); //this.Edit(lct, llb); //this.transLayerHeader.Visible = false; //this.transLayerBody1.Visible = false; //this.transLayerBody2.Visible = false; #endregion no use this.txtDummy.Focus(); // set focus to dummy textbox first this.tabControl1.SelectedTab = tabPage1; this.form_mode = FORM_MODE.EDIT; this.toolStripProcessing.Visible = false; #region Toolstrip Button this.toolStripAdd.Enabled = false; this.toolStripEdit.Enabled = false; this.toolStripDelete.Enabled = false; this.toolStripStop.Enabled = true; this.toolStripSave.Enabled = true; this.toolStripFirst.Enabled = false; this.toolStripPrevious.Enabled = false; this.toolStripNext.Enabled = false; this.toolStripLast.Enabled = false; this.toolStripItem.Enabled = false; this.toolStripImport.Enabled = false; this.toolStripGenSN.Enabled = false; this.toolStripUpgrade.Enabled = false; this.toolStripBook.Enabled = false; this.toolStripSet2.Enabled = false; this.toolStripSearch.Enabled = false; this.toolStripInquiryAll.Enabled = false; this.toolStripInquiryRest.Enabled = false; this.toolStripSearchArea.Enabled = false; this.toolStripSearchBusityp.Enabled = false; this.toolStripSearchCompany.Enabled = false; this.toolStripSearchContact.Enabled = false; this.toolStripSearchDealer.Enabled = false; this.toolStripSearchOldnum.Enabled = false; this.toolStripSearchSN.Enabled = false; this.toolStripReload.Enabled = false; #endregion Toolstrip Button #region Button this.btnBrowseArea.Enabled = true; this.btnBrowseBusityp.Enabled = true; this.btnBrowseDealer.Enabled = true; this.btnBrowseHowknown.Enabled = true; this.chkIMOnly.Enabled = false; this.btnLostRenew.Enabled = false; this.btnSwithToRefnum.Enabled = false; this.btnCD.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnCD.Enabled = false; this.btnUP.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUP.Enabled = false; this.btnUPNewRwt.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwt.Enabled = false; this.btnUPNewRwtJob.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwtJob.Enabled = false; this.btnSupportNote.Enabled = false; this.btnSupportViewNote.Enabled = false; this.btnPasswordAdd.Enabled = false; this.btnPasswordRemove.Enabled = false; this.btnEditMA.Enabled = false; this.btnDeleteMA.Enabled = false; #endregion Button #region DatePicker this.dtPurdat.Read_Only = false; this.dtExpdat.Read_Only = false; this.dtManual.Read_Only = false; this.dtVerextdat.Read_Only = false; #endregion DatePicker #region Inline Problem Form if (this.dgvProblem.Parent.Controls.Find("inline_problem_date", true).Length > 0) { CustomDateTimePicker date = (CustomDateTimePicker)this.dgvProblem.Parent.Controls.Find("inline_problem_date", true)[0]; date.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_name", true).Length > 0) { CustomTextBox name = (CustomTextBox)this.dgvProblem.Parent.Controls.Find("inline_problem_name", true)[0]; name.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true).Length > 0) { CustomTextBox probcod = (CustomTextBox)this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true)[0]; probcod.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true).Length > 0) { CustomTextBoxMaskedWithLabel probdesc = (CustomTextBoxMaskedWithLabel)this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true)[0]; probdesc.Read_Only = true; } #endregion Inline Problem Form this.EditControlEditState(); this.txtSernum.Read_Only = true; this.txtVersion.Focus(); // throw(set) focus to txtVersion }
private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { this.splashScreenManager1.ShowWaitForm(); ApiAccessibilities acc = new ApiAccessibilities { API_KEY = this.main_form.config.ApiKey, stmas = this.current_stmas }; APIResult add_edit; if (this.form_mode == FORM_MODE.ADD) // Add mode { add_edit = APIClient.POST(this.main_form.config.ApiUrl + "Stmas/AddStmas", acc); } else // Edit mode { add_edit = APIClient.PUT(this.main_form.config.ApiUrl + "Stmas/UpdateStmas", acc); } if (add_edit.Success) { StmasVM added_item = JsonConvert.DeserializeObject <StmasVM>(add_edit.ReturnValue); if (this.img_file_path.Trim().Length > 0 && !(this.img_file_path.StartsWith("http://") || this.img_file_path.StartsWith("https://"))) // have image { var upload = FIleUpload.Upload(this.main_form.config.ApiUrl + "Stmas/UploadImage", File.OpenRead(this.img_file_path), "file1", added_item.Id.ToString() + Path.GetExtension(this.img_file_path)); if (upload.Success) { acc.stmas = added_item; acc.stmas.ProductImg = acc.stmas.Id.ToString() + Path.GetExtension(this.img_file_path); APIResult update = APIClient.PUT(this.main_form.config.ApiUrl + "Stmas/UpdateStmas", acc); if (update.Success) { APIResult create_resize_img = APIClient.GET(this.main_form.config.ApiUrl + "Stmas/CreateResizedImage", this.main_form.config.ApiKey, "&id=" + acc.stmas.Id.ToString()); if (!create_resize_img.Success) { if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } MessageBox.Show("บันทึกข้อมูลสำเร็จ, แต่การอัพโหลดรูปภาพอาจมีปัญหา กรุณาตรวจสอบรูปภาพอีกครั้งในภายหลัง", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } MessageBox.Show("บันทึกข้อมูลสำเร็จ, แต่การอัพโหลดรูปภาพล้มเหลว กรุณาอัพโหลดรูปภาพอีกครั้งในภายหลัง", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } MessageBox.Show("บันทึกข้อมูลสำเร็จ, แต่การอัพโหลดรูปภาพล้มเหลว กรุณาอัพโหลดรูปภาพอีกครั้งในภายหลัง", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } this.current_stmas = added_item; this.FillForm(this.current_stmas); } else // don't have image { this.current_stmas = added_item; this.FillForm(this.current_stmas); } this.form_mode = FORM_MODE.READ; this.SetFormControlState(); } else { if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } if (MessageBox.Show(add_edit.ErrorMessage, "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) { this.btnSave.PerformClick(); } else { this.current_stmas = this.backup_stmas.Clone(); this.FillForm(this.current_stmas); this.form_mode = FORM_MODE.READ; this.SetFormControlState(); } } if (this.splashScreenManager1.IsSplashFormVisible) { this.splashScreenManager1.CloseWaitForm(); } }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.toolStripProcessing.Visible = true; this.txtDummy.Focus(); #region Toolstrip button this.toolStripEdit.Enabled = false; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripItem.Enabled = false; #endregion Toolstrip button #region Form control this.rbHoliday.Enabled = false; this.rbWeekday.Enabled = false; this.leaveMax.Enabled = false; #endregion Form control #region Set inline control to read-only state if (this.dgv.Parent.Controls.Find("inline_users_name", true).Length > 0) { ((CustomComboBox)this.dgv.Parent.Controls.Find("inline_users_name", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_from_time", true).Length > 0) { ((CustomTimePicker)this.dgv.Parent.Controls.Find("inline_from_time", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_to_time", true).Length > 0) { ((CustomTimePicker)this.dgv.Parent.Controls.Find("inline_to_time", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_leave_cause", true).Length > 0) { ((CustomComboBox)this.dgv.Parent.Controls.Find("inline_leave_cause", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_status", true).Length > 0) { ((CustomComboBox)this.dgv.Parent.Controls.Find("inline_status", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_customer", true).Length > 0) { ((CustomTextBox)this.dgv.Parent.Controls.Find("inline_customer", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_medcert", true).Length > 0) { ((CustomComboBox)this.dgv.Parent.Controls.Find("inline_medcert", true)[0]).Read_Only = true; } if (this.dgv.Parent.Controls.Find("inline_fine", true).Length > 0) { //((CustomMaskedTextBox)this.dgv.Parent.Controls.Find("inline_fine", true)[0]).Read_Only = true; ((NumericUpDown)this.dgv.Parent.Controls.Find("inline_fine", true)[0]).ReadOnly = true; } #endregion Set inline control to read-only state }
private void FormRead() { this.form_mode = FORM_MODE.READ; this.toolStripProcessing.Visible = false; this.txtSernum.Focus(); #region Toolstrip button this.btnAdd.Enabled = true; this.toolStripPrint.Enabled = true; this.toolStripPrintDetail.Enabled = true; this.toolStripPrintSummary.Enabled = true; this.toolStripExport.Enabled = true; this.toolStripExportDetail.Enabled = true; this.toolStripExportSummary.Enabled = true; this.toolStripRange.Enabled = true; this.toolStripEdit.Enabled = true; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; #endregion Toolstrip button #region Control state this.chApplyCondition.Enabled = true; #endregion Control state }
private void ShowInlineForm(FORM_MODE mode) { if (mode == FORM_MODE.ADD_F8) this.dgvTrainer.Rows[this.list_training_calendar.Where(t => t.date == this.current_event_date.ToMysqlDate()).Count<TrainingCalendar>()].Cells[0].Selected = true; List<Users> rest_users = this.list_trainer_rest.ConvertAll(t => t).ToList<Users>(); if (mode == FORM_MODE.EDIT_F8) { rest_users.Add(this.list_trainer_all.Find(u => u.username == ((TrainingCalendar)this.dgvTrainer.Rows[this.dgvTrainer.CurrentCell.RowIndex].Tag).trainer)); rest_users = rest_users.OrderBy(t => t.username).ToList<Users>(); } this.inline_course_type = (this.inline_course_type == null ? new CustomComboBox() { Read_Only = false, BorderStyle = BorderStyle.None } : this.inline_course_type); this.inline_course_type.comboBox1.Items.Clear(); this.inline_course_type.AddItem(new ComboboxItem("Basic", 1, "Basic")); this.inline_course_type.AddItem(new ComboboxItem("Advanced", 2, "Advanced")); this.inline_course_type.comboBox1.SelectedIndex = 0; this.inline_trainer = (this.inline_trainer == null ? new CustomComboBox() { Read_Only = false, BorderStyle = BorderStyle.None } : this.inline_trainer); this.inline_trainer.comboBox1.DropDownStyle = ComboBoxStyle.DropDown; this.inline_trainer.comboBox1.Items.Clear(); //foreach (Users u in rest_users) foreach (Users u in this.list_trainer_all) { this.inline_trainer.AddItem(new ComboboxItem(u.username + " : " + u.name, u.id, u.username) { Tag = u }); } this.inline_trainer.comboBox1.Leave += delegate { ComboBox cb = this.inline_trainer.comboBox1; if (cb.Items.Cast<ComboboxItem>().Where(i => i.ToString().Length >= cb.Text.Length).Where(i => i.ToString().Substring(0, cb.Text.Length) == cb.Text).Count<ComboboxItem>() > 0) { cb.SelectedItem = cb.Items.Cast<ComboboxItem>().Where(i => i.ToString().Length >= cb.Text.Length).Where(i => i.ToString().Substring(0, cb.Text.Length) == cb.Text).First<ComboboxItem>(); } else { cb.Focus(); } }; this.inline_status = (this.inline_status == null ? new CustomComboBox() { Read_Only = false, BorderStyle = BorderStyle.None } : this.inline_status); this.inline_status.comboBox1.Items.Clear(); this.inline_status.AddItem(new ComboboxItem("วิทยากร", (int)TRAINER_STATUS.TRAINER, "TRAINER")); this.inline_status.AddItem(new ComboboxItem("ผู้ช่วย", (int)TRAINER_STATUS.ASSIST, "ASSISTANT")); this.inline_status.comboBox1.SelectedIndex = 0; this.inline_term = (this.inline_term == null ? new CustomComboBox() { Read_Only = false, BorderStyle = BorderStyle.None } : this.inline_term); this.inline_term.comboBox1.Items.Clear(); this.inline_term.AddItem(new ComboboxItem("เช้า", (int)TRAINING_TERM.AM, "AM")); this.inline_term.AddItem(new ComboboxItem("บ่าย", (int)TRAINING_TERM.PM, "PM")); this.inline_term.comboBox1.SelectedIndex = 0; this.inline_remark = (this.inline_remark == null ? new CustomTextBox() { Read_Only = false, BorderStyle = BorderStyle.None } : this.inline_remark); #region binding inline control event handler this.inline_course_type.comboBox1.GotFocus += new EventHandler(this.InlineControlGotFocus); this.inline_trainer.comboBox1.GotFocus += new EventHandler(this.InlineControlGotFocus); this.inline_status.comboBox1.GotFocus += new EventHandler(this.InlineControlGotFocus); this.inline_term.comboBox1.GotFocus += new EventHandler(this.InlineControlGotFocus); this.inline_remark.textBox1.GotFocus += new EventHandler(this.InlineControlGotFocus); #endregion binding inline control event handler if (mode == FORM_MODE.ADD_F8) { this.FormAddF8(); } else if (mode == FORM_MODE.EDIT_F8) { this.FormEditF8(); TrainingCalendar trainer = (TrainingCalendar)this.dgvTrainer.Rows[this.dgvTrainer.CurrentCell.RowIndex].Tag; this.inline_course_type.comboBox1.SelectedItem = (this.inline_course_type.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.course_type).Count<ComboboxItem>() > 0 ? this.inline_course_type.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.course_type).First<ComboboxItem>() : null); this.inline_trainer.comboBox1.SelectedItem = (this.inline_trainer.comboBox1.Items.Cast<ComboboxItem>().Where(i => ((Users)i.Tag).username == trainer.trainer).Count<ComboboxItem>() > 0 ? this.inline_trainer.comboBox1.Items.Cast<ComboboxItem>().Where(i => ((Users)i.Tag).username == trainer.trainer).First<ComboboxItem>() : null); this.inline_status.comboBox1.SelectedItem = (this.inline_status.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.status).Count<ComboboxItem>() > 0 ? this.inline_status.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.status).First<ComboboxItem>() : null); this.inline_term.comboBox1.SelectedItem = (this.inline_term.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.term).Count<ComboboxItem>() > 0 ? this.inline_term.comboBox1.Items.Cast<ComboboxItem>().Where(i => i.int_value == trainer.term).First<ComboboxItem>() : null); this.inline_remark.Texts = trainer.remark; } this.SetInlineFormPosition(); this.inline_course_type.comboBox1.Focus(); this.dgvTrainer.Parent.Controls.Add(this.inline_course_type); this.dgvTrainer.Parent.Controls.Add(this.inline_trainer); this.dgvTrainer.Parent.Controls.Add(this.inline_status); this.dgvTrainer.Parent.Controls.Add(this.inline_term); this.dgvTrainer.Parent.Controls.Add(this.inline_remark); this.dgvTrainer.SendToBack(); this.inline_course_type.BringToFront(); this.inline_trainer.BringToFront(); this.inline_status.BringToFront(); this.inline_term.BringToFront(); this.inline_remark.BringToFront(); this.inline_course_type.Focus(); }
public static void SetControlState(this Component comp, FORM_MODE[] form_mode_to_enable, FORM_MODE form_mode) { if (form_mode_to_enable.Where(f => f == form_mode).Count() > 0) { if (comp is CheckBox) { ((CheckBox)comp).Enabled = true; } if (comp is DataGridView) { ((DataGridView)comp).Enabled = true; } if (comp is TextBox) { ((TextBox)comp).Enabled = true; } if (comp is ComboBox) { ((ComboBox)comp).Enabled = true; } if (comp is ToolStripButton) { ((ToolStripButton)comp).Enabled = true; } } else { if (comp is CheckBox) { ((CheckBox)comp).Enabled = false; } if (comp is DataGridView) { ((DataGridView)comp).Enabled = false; } if (comp is TextBox) { ((TextBox)comp).Enabled = false; } if (comp is ComboBox) { ((ComboBox)comp).Enabled = false; } if (comp is ToolStripButton) { ((ToolStripButton)comp).Enabled = false; } } }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.toolStripProcessing.Visible = true; this.btnStop.Enabled = false; this.btnSave.Enabled = false; this.btnCopy.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnReload.Enabled = false; this.dgvTrainer.Enabled = false; this.dgvStat.Enabled = false; if (this.inline_course_type != null) this.inline_course_type.Read_Only = true; if (this.inline_trainer != null) this.inline_trainer.Read_Only = true; if (this.inline_status != null) this.inline_status.Read_Only = true; if (this.inline_term != null) this.inline_term.Read_Only = true; if (this.inline_remark != null) this.inline_remark.Read_Only = true; }
private void ShowInlineForm(FORM_MODE mode) { if (this.current_group != null) { this.inline_user = new CustomComboBox(); this.inline_user.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList; this.inline_user.comboBox1.Font = new Font("tahoma", 9.75f); this.inline_user.label1.Font = new Font("tahoma", 9.75f); this.inline_user.BorderStyle = BorderStyle.None; this.inline_user.Read_Only = false; this.inline_user.comboBox1.GotFocus += new EventHandler(this.SetControlFocused); this.RefreshCurrentData(); this.FillForm(this.current_group); foreach (Users u in this.list_users.Where(u => u.usergroup == string.Empty).ToList<Users>()) { this.inline_user.AddItem(new ComboboxItem(u.username + " : " + u.name, u.id, u.username) { Tag = u }); } if (mode == FORM_MODE.ADD_F8) { this.dgvMember.Rows[this.list_users.Where(u => u.usergroup == this.current_group.typcod).ToList<Users>().Count].Cells[0].Selected = true; this.SetInlineFormPosition(); } this.dgvMember.Parent.Controls.Add(this.inline_user); this.dgvMember.SendToBack(); this.inline_user.BringToFront(); this.inline_user.comboBox1.Focus(); SendKeys.Send("{F4}"); } else { MessageAlert.Show("ท่านต้องสร้างกลุ่มขึ้นมาก่อนที่เพิ่มสมาชิกในกลุ่ม", "Error", MessageAlertButtons.OK, MessageAlertIcons.ERROR); } }
private void FormConfig_Load(object sender, EventArgs e) { this.form_mode = FORM_MODE.READ; this.config = Config.LoadConfigValue(); this.FillForm(); }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.toolStripProcessing.Visible = true; this.btnAdd.Enabled = false; this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnStop.Enabled = false; this.btnSave.Enabled = false; this.btnFirst.Enabled = false; this.btnPrevious.Enabled = false; this.btnNext.Enabled = false; this.btnLast.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnSearch.Enabled = false; this.btnInquiryAll.Enabled = false; this.btnInquiryRest.Enabled = false; this.btnSearchTypcod.Enabled = false; this.btnReload.Enabled = false; this.txtTypcod.Read_Only = true; this.txtTypdes.Read_Only = true; this.dgvMember.Enabled = false; this.dgvUnGroup.Enabled = false; if (this.inline_user != null) { this.inline_user.Read_Only = true; } }
private void FormRead() { this.form_mode = FORM_MODE.READ; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripPrint.Enabled = true; this.toolStripPrintDetail.Enabled = true; this.toolStripPrintSummary.Enabled = true; this.toolStripExport.Enabled = true; this.toolStripExportDetail.Enabled = true; this.toolStripExportSummary.Enabled = true; this.toolStripRange.Enabled = true; }
public UserAddEditDialog(MainForm main_form) : this() { this.main_form = main_form; this.form_mode = FORM_MODE.ADD; }
public static void SetControlState(this Component comp, FORM_MODE[] allow_active_mode, FORM_MODE current_mode) { if (comp is DataGridView) { ((DataGridView)comp).Enabled = allow_active_mode.Where(m => m.ToString() == current_mode.ToString()).Count() > 0 ? true : false; } }
private void FormReadF8() { this.form_mode = FORM_MODE.READ_F8; this.focused_control = null; this.toolStripProcessing.Visible = false; this.btnAdd.Enabled = false; this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnStop.Enabled = true; this.btnSave.Enabled = false; this.btnFirst.Enabled = false; this.btnPrevious.Enabled = false; this.btnNext.Enabled = false; this.btnLast.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnSearch.Enabled = false; this.btnInquiryAll.Enabled = false; this.btnInquiryRest.Enabled = false; this.btnSearchTypcod.Enabled = false; this.btnReload.Enabled = false; this.txtTypcod.Read_Only = true; this.txtTypdes.Read_Only = true; this.dgvMember.Enabled = true; this.ClearInlineForm(); this.dgvMember.Enabled = true; this.dgvUnGroup.Enabled = true; }
private void FormProcessing() { this.form_mode = FORM_MODE.PROCESSING; this.toolStripProcessing.Visible = true; this.cbUsers.Enabled = false; this.cbReason.Enabled = false; this.cbMedCert.Enabled = false; this.dtDateStart.Enabled = false; this.dtDateEnd.Enabled = false; this.dtFromTime.Enabled = false; this.dtToTime.Enabled = false; this.cbStatus.Enabled = false; this.txtCustomer.Enabled = false; this.btnOK.Enabled = false; this.btnCancel.Enabled = false; this.chIsFine.Enabled = false; this.chMonday.Enabled = false; this.chTuesday.Enabled = false; this.chWednesday.Enabled = false; this.chThursday.Enabled = false; this.chFriday.Enabled = false; this.chSaturday.Enabled = false; this.numFine.Enabled = false; }
private void FormEditGroup() { this.form_mode = FORM_MODE.EDIT_GROUP; this.toolStripProcessing.Visible = false; this.btnAdd.Enabled = false; this.btnEdit.Enabled = false; this.btnDelete.Enabled = false; this.btnStop.Enabled = true; this.btnSave.Enabled = true; this.btnFirst.Enabled = false; this.btnPrevious.Enabled = false; this.btnNext.Enabled = false; this.btnLast.Enabled = false; this.btnItem.Enabled = false; this.btnItemF7.Enabled = false; this.btnItemF8.Enabled = false; this.btnSearch.Enabled = false; this.btnInquiryAll.Enabled = false; this.btnInquiryRest.Enabled = false; this.btnSearchTypcod.Enabled = false; this.btnReload.Enabled = false; this.txtTypcod.Read_Only = true; this.txtTypdes.Read_Only = false; this.dgvMember.Enabled = false; this.dgvUnGroup.Enabled = false; }
private void PerformThreeDSecureAuthentication(string szPaRES, string szCrossReference) { string szMessage = null; bool boTransactionSuccessful = false; StringBuilder sbString; int nCount = 0; ThreeDSecureAuthentication tdsaThreeDSecureAuthentication; RequestGatewayEntryPointList lrgepRequestGatewayEntryPoints; GatewayOutput goGatewayOutput; TransactionOutputMessage tomTransactionOutputMessage; string szPreviousTransactionMessage = null; bool boDuplicateTransaction = false; lrgepRequestGatewayEntryPoints = new RequestGatewayEntryPointList(); // you need to put the correct gateway entry point urls in here // contact support to get the correct urls // The actual values to use for the entry points can be established in a number of ways // 1) By periodically issuing a call to GetGatewayEntryPoints // 2) By storing the values for the entry points returned with each transaction // 3) Speculatively firing transactions at https://gw1.xxx followed by gw2, gw3, gw4.... // The lower the metric (2nd parameter) means that entry point will be attempted first, // EXCEPT if it is -1 - in this case that entry point will be skipped // NOTE: You do NOT have to add the entry points in any particular order - the list is sorted // by metric value before the transaction sumbitting process begins // The 3rd parameter is a retry attempt, so it is possible to try that entry point that number of times // before failing over onto the next entry point in the list lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw1." + Global.PaymentProcessorFullDomain, 100, 2)); lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw2." + Global.PaymentProcessorFullDomain, 200, 2)); lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw3." + Global.PaymentProcessorFullDomain, 300, 2)); tdsaThreeDSecureAuthentication = new ThreeDSecureAuthentication( lrgepRequestGatewayEntryPoints, new MerchantDetails(Global.MerchantID, Global.Password), new ThreeDSecureInputData(szCrossReference, szPaRES), null); // send the SOAP request if (!tdsaThreeDSecureAuthentication.ProcessTransaction(out goGatewayOutput, out tomTransactionOutputMessage)) { szMessage = "Couldn't communicate with payment gateway"; boTransactionSuccessful = true; } else { switch (goGatewayOutput.StatusCode) { case 0: // status code of 0 - means transaction successful boTransactionSuccessful = true; m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; break; case 5: // status code of 5 - means transaction declined boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; break; case 20: // status code of 20 - means duplicate transaction m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; if (goGatewayOutput.PreviousTransactionResult.StatusCode.Value == 0) { boTransactionSuccessful = true; } else { boTransactionSuccessful = false; } szPreviousTransactionMessage = goGatewayOutput.PreviousTransactionResult.Message; boDuplicateTransaction = true; break; case 30: // status code of 30 - means an error occurred boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.RESULTS; sbString = new StringBuilder(); // get any additional messages if (goGatewayOutput.ErrorMessages.Count > 0) { sbString.Append("<br /><ul>"); for (nCount = 0; nCount < goGatewayOutput.ErrorMessages.Count; nCount++) { sbString.AppendFormat("<li>{0}</li>", goGatewayOutput.ErrorMessages[nCount]); } sbString.Append("</ul>"); } szMessage = goGatewayOutput.Message + sbString.ToString(); break; default: // unhandled status code boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; break; } } pnTransactionResultsPanel.Visible = true; pnMessagePanel.Visible = false; if (!boTransactionSuccessful) { pnTransactionResultsPanel.CssClass = "ErrorMessage"; } else { pnTransactionResultsPanel.CssClass = "SuccessMessage"; } lbGatewayResponse.Text = szMessage; // sort out the duplicate transaction reporting if (boDuplicateTransaction) { pnDuplicateTransactionPanel.Visible = true; lbPreviousTransactionMessage.Text = szPreviousTransactionMessage; } // the process another link hlProcessAnother.NavigateUrl = Global.SiteSecureBaseURL + "PaymentForm.aspx"; }
public static void SetControlState(this Component comp, FORM_MODE[] form_mode_to_enable, FORM_MODE form_mode, string accessibility_by_scacclv = null) { if (form_mode_to_enable.ToList().Where(fm => fm == form_mode).Count() > 0) { if (comp is ToolStripButton) { ((ToolStripButton)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((ToolStripButton)comp).Enabled = false; } return; } if (comp is ToolStripSplitButton) { ((ToolStripSplitButton)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((ToolStripSplitButton)comp).Enabled = false; } return; } if (comp is ToolStripDropDownButton) { ((ToolStripDropDownButton)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((ToolStripDropDownButton)comp).Enabled = false; } return; } if (comp is ToolStripMenuItem) { ((ToolStripMenuItem)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((ToolStripMenuItem)comp).Enabled = false; } return; } if (comp is TabControl) { ((TabControl)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((TabControl)comp).Enabled = false; } return; } if (comp is Button) { ((Button)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((Button)comp).Enabled = false; } return; } if (comp is DataGridView) { ((DataGridView)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((DataGridView)comp).Enabled = false; } return; } if (comp is XTextEdit) { ((XTextEdit)comp)._ReadOnly = false; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((XTextEdit)comp)._ReadOnly = true; } return; } if (comp is XDropdownList) { ((XDropdownList)comp)._ReadOnly = false; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((XDropdownList)comp)._ReadOnly = true; } return; } if (comp is XDatePicker) { ((XDatePicker)comp)._ReadOnly = false; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((XDatePicker)comp)._ReadOnly = true; } return; } if (comp is XBrowseBox) { ((XBrowseBox)comp)._ReadOnly = false; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((XBrowseBox)comp)._ReadOnly = true; } return; } if (comp is RadioButton) { ((RadioButton)comp).Enabled = true; if (accessibility_by_scacclv != null && accessibility_by_scacclv == "N") { ((RadioButton)comp).Enabled = false; } return; } } else { if (comp is ToolStripButton) { ((ToolStripButton)comp).Enabled = false; return; } if (comp is ToolStripSplitButton) { ((ToolStripSplitButton)comp).Enabled = false; return; } if (comp is ToolStripDropDownButton) { ((ToolStripDropDownButton)comp).Enabled = false; return; } if (comp is ToolStripMenuItem) { ((ToolStripMenuItem)comp).Enabled = false; return; } if (comp is TabControl) { ((TabControl)comp).Enabled = false; return; } if (comp is Button) { ((Button)comp).Enabled = false; return; } if (comp is DataGridView) { ((DataGridView)comp).Enabled = false; return; } if (comp is XTextEdit) { ((XTextEdit)comp)._ReadOnly = true; return; } if (comp is XDropdownList) { ((XDropdownList)comp)._ReadOnly = true; return; } if (comp is XDatePicker) { ((XDatePicker)comp)._ReadOnly = true; return; } if (comp is XBrowseBox) { ((XBrowseBox)comp)._ReadOnly = true; return; } if (comp is RadioButton) { ((RadioButton)comp).Enabled = false; return; } } }
private void ShowInlineForm(COMMENT_TYPE comment_type, FORM_MODE mode) { this.curr_comment_type = comment_type; DataGridView dgv = null; switch (comment_type) { case COMMENT_TYPE.COMMENT: dgv = this.dgvComment; this.inline_comment_desc = new CustomTextBox() { Read_Only = false }; dgv.Parent.Controls.Add(this.inline_comment_desc); break; case COMMENT_TYPE.COMPLAIN: dgv = this.dgvComplain; this.inline_comment_desc = new CustomTextBox() { Read_Only = false }; dgv.Parent.Controls.Add(this.inline_comment_desc); break; case COMMENT_TYPE.NONE: break; default: break; } if (dgv != null && mode == FORM_MODE.ADD) { dgv.Rows[dgv.Rows.Add()].Cells[0].Selected = true; this.prepared_comment = new SupportNoteComment(); this.prepared_comment.id = -1; this.prepared_comment.type = (int)comment_type; this.prepared_comment.note_id = this.note_id; this.prepared_comment.rec_by = this.parent_wind.main_form.G.loged_in_user_name; this.FormAdd(); } if (dgv != null && mode == FORM_MODE.EDIT && dgv.Rows[dgv.CurrentCell.RowIndex].Tag is SupportNoteComment) { this.prepared_comment = (SupportNoteComment)dgv.Rows[dgv.CurrentCell.RowIndex].Tag; this.prepared_comment.rec_by = this.parent_wind.main_form.G.loged_in_user_name; this.inline_comment_desc.Texts = this.prepared_comment.description; this.FormEdit(); } this.SetInlineFormPosition(dgv); dgv.Enabled = false; dgv.SendToBack(); this.inline_comment_desc.BringToFront(); this.inline_comment_desc.Focus(); this.inline_comment_desc.SelectionStart = 0; this.inline_comment_desc.SelectionLength = 0; dgv.Tag = HelperClass.DGV_TAG.READ; dgv.Refresh(); }
private void FormRead() { this.form_mode = FORM_MODE.READ; this.toolStripProcessing.Visible = false; this.toolStripInfo.Text = ""; #region Toolstrip Button this.toolStripAdd.Enabled = true; this.toolStripEdit.Enabled = true; this.toolStripDelete.Enabled = true; this.toolStripStop.Enabled = false; this.toolStripSave.Enabled = false; this.toolStripFirst.Enabled = true; this.toolStripPrevious.Enabled = true; this.toolStripNext.Enabled = true; this.toolStripLast.Enabled = true; this.toolStripItem.Enabled = true; this.toolStripImport.Enabled = true; this.toolStripGenSN.Enabled = true; this.toolStripUpgrade.Enabled = true; this.toolStripBook.Enabled = true; this.toolStripSet2.Enabled = true; this.toolStripSearch.Enabled = true; this.toolStripInquiryAll.Enabled = true; this.toolStripInquiryRest.Enabled = true; this.toolStripSearchArea.Enabled = true; this.toolStripSearchBusityp.Enabled = true; this.toolStripSearchCompany.Enabled = true; this.toolStripSearchContact.Enabled = true; this.toolStripSearchDealer.Enabled = true; this.toolStripSearchOldnum.Enabled = true; this.toolStripSearchSN.Enabled = true; this.toolStripReload.Enabled = true; #endregion Toolstrip Button #region Button this.btnBrowseArea.Enabled = false; this.btnBrowseBusityp.Enabled = false; this.btnBrowseDealer.Enabled = false; this.btnBrowseHowknown.Enabled = false; this.chkIMOnly.Enabled = true; this.btnLostRenew.Enabled = true; this.btnSwithToRefnum.Enabled = true; this.btnCD.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnCD.Enabled = (this.btnCD.Visible ? true : false); this.btnUP.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUP.Enabled = (this.btnUP.Visible ? true : false); this.btnUPNewRwt.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwt.Enabled = (this.btnUPNewRwt.Visible ? true : false); this.btnUPNewRwtJob.Visible = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_ADMIN ? true : false); this.btnUPNewRwtJob.Enabled = (this.btnUPNewRwtJob.Visible ? true : false); this.btnSupportNote.Enabled = ((this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SUPPORT || this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SALES) ? (this.main_form.lblTimeDuration.Visible ? false : true) : false); this.btnSupportViewNote.Enabled = (this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SUPPORT || this.main_form.G.loged_in_user_level == GlobalVar.USER_LEVEL_SALES ? true : false); this.btnPasswordAdd.Enabled = true; this.btnPasswordRemove.Enabled = true; this.btnEditMA.Enabled = true; this.btnDeleteMA.Enabled = true; #endregion Button #region DatePicker this.dtPurdat.Read_Only = true; this.dtExpdat.Read_Only = true; this.dtManual.Read_Only = true; this.dtVerextdat.Read_Only = true; #endregion DatePicker #region Inline Problem Form if (this.dgvProblem.Parent.Controls.Find("inline_problem_date", true).Length > 0) { CustomDateTimePicker date = (CustomDateTimePicker)this.dgvProblem.Parent.Controls.Find("inline_problem_date", true)[0]; date.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_name", true).Length > 0) { CustomTextBox name = (CustomTextBox)this.dgvProblem.Parent.Controls.Find("inline_problem_name", true)[0]; name.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true).Length > 0) { CustomTextBox probcod = (CustomTextBox)this.dgvProblem.Parent.Controls.Find("inline_problem_probcod", true)[0]; probcod.Read_Only = true; } if (this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true).Length > 0) { CustomTextBoxMaskedWithLabel probdesc = (CustomTextBoxMaskedWithLabel)this.dgvProblem.Parent.Controls.Find("inline_problem_probdesc", true)[0]; probdesc.Read_Only = true; } #endregion Inline Problem Form this.txtDummy.Focus(); // throw(set) focus to dummy textbox this.EditControlReadState(); }
private void ResetFormState(FORM_MODE form_mode) { this.form_mode = form_mode; this.xDatagrid1.SetControlState(new FORM_MODE[] { FORM_MODE.READ }, this.form_mode); }
public GenerateSNForm(SnWindow parent_window) { InitializeComponent(); this.parent_window = parent_window; this.G = this.parent_window.G; this.BackColor = ColorResource.BACKGROUND_COLOR_BEIGE; //this.chkCDTraining.CheckState = CheckState.Checked; this.mskSernum.Enter += new EventHandler(this.onControlEnterHandler); this.numQty.Enter += new EventHandler(this.onControlEnterHandler); this.txtVersion.Enter += new EventHandler(this.onControlEnterHandler); this.txtDealer.Enter += new EventHandler(this.onControlEnterHandler); this.txtVersion.Leave += new EventHandler(this.onControlLeaveHandler); this.numQty.Leave += new EventHandler(this.onControlLeaveHandler); this.mskSernum.Leave += new EventHandler(this.onControlLeaveHandler); this.txtDealer.Leave += new EventHandler(this.onControlLeaveHandler); this.mskSernum.GotFocus += new EventHandler(this.onControlFocusedHandler); this.numQty.GotFocus += new EventHandler(this.onControlFocusedHandler); this.txtVersion.GotFocus += new EventHandler(this.onControlFocusedHandler); this.txtDealer.GotFocus += new EventHandler(this.onControlFocusedHandler); this.chkCDTraining.GotFocus += new EventHandler(this.onControlFocusedHandler); this.chkNewRwt.GotFocus += new EventHandler(this.onControlFocusedHandler); this.chkNewRwtJob.GotFocus += new EventHandler(this.onControlFocusedHandler); this.btnOK.GotFocus += new EventHandler(this.onControlFocusedHandler); ; this.btnCancel.GotFocus += new EventHandler(this.onControlFocusedHandler); this.mskSernum.Leave += new EventHandler(this.validateSernumFieldLeave); this.txtDealer.Leave += new EventHandler(this.validateDealerFieldLeave); this.chkNewRwt.CheckedChanged += new EventHandler(this.onCheckBoxStateChange); this.chkNewRwtJob.CheckedChanged += new EventHandler(this.onCheckBoxStateChange); this.getDealer(); this.numQty.Leave += delegate { if (this.numQty.Text.Length == 0) { this.numQty.Text = "1"; } }; this.txtVersion.Leave += delegate { if (this.txtVersion.Text.Length == 0) { if (ValidateSN.Check(this.mskSernum.Text)) { this.txtVersion.Text = this.mskSernum.Text.Substring(2, 1) + "." + this.mskSernum.Text.Substring(3, 1); } } }; this.form_mode = FORM_MODE.EDIT; }
protected void SubmitButton_Click(object sender, EventArgs e) { string szMessage = null; bool boTransactionSuccessful = false; StringBuilder sbString; int nCount = 0; int nTemp; CardDetailsTransaction cdtCardDetailsTransaction; RequestGatewayEntryPointList lrgepRequestGatewayEntryPoints; GatewayOutput goGatewayOutput; TransactionOutputMessage tomTransactionOutputMessage; TransactionControl tcTransactionControl; CardDetails cdCardDetails; CreditCardDate ccdExpiryDate = null; CreditCardDate ccdStartDate = null; CustomerDetails cdCustomerDetails = null; NullableInt nCountryCode = null; NullableInt nExpiryDateMonth = null; NullableInt nExpiryDateYear = null; NullableInt nStartDateMonth = null; NullableInt nStartDateYear = null; string szPreviousTransactionMessage = null; bool boDuplicateTransaction = false; lrgepRequestGatewayEntryPoints = new RequestGatewayEntryPointList(); // you need to put the correct gateway entry point urls in here // contact support to get the correct urls // The actual values to use for the entry points can be established in a number of ways // 1) By periodically issuing a call to GetGatewayEntryPoints // 2) By storing the values for the entry points returned with each transaction // 3) Speculatively firing transactions at https://gw1.xxx followed by gw2, gw3, gw4.... // The lower the metric (2nd parameter) means that entry point will be attempted first, // EXCEPT if it is -1 - in this case that entry point will be skipped // NOTE: You do NOT have to add the entry points in any particular order - the list is sorted // by metric value before the transaction sumbitting process begins // The 3rd parameter is a retry attempt, so it is possible to try that entry point that number of times // before failing over onto the next entry point in the list lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw1." + Global.PaymentProcessorFullDomain, 100, 2)); lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw2." + Global.PaymentProcessorFullDomain, 200, 2)); lrgepRequestGatewayEntryPoints.Add(new RequestGatewayEntryPoint("https://gw3." + Global.PaymentProcessorFullDomain, 300, 2)); tcTransactionControl = new TransactionControl(new NullableBool(true), new NullableBool(true), new NullableBool(true), new NullableBool(true), new NullableInt(60), null, null, null, null, null, null); if (!String.IsNullOrEmpty(ddExpiryDateMonth.SelectedValue)) { nExpiryDateMonth = new NullableInt(System.Convert.ToInt32(ddExpiryDateMonth.SelectedValue)); } if (!String.IsNullOrEmpty(ddExpiryDateYear.SelectedValue)) { nExpiryDateYear = new NullableInt(System.Convert.ToInt32(ddExpiryDateYear.SelectedValue)); } ccdExpiryDate = new CreditCardDate(nExpiryDateMonth, nExpiryDateYear); if (!String.IsNullOrEmpty(ddStartDateMonth.SelectedValue)) { nStartDateMonth = new NullableInt(System.Convert.ToInt32(ddStartDateMonth.SelectedValue)); } if (!String.IsNullOrEmpty(ddStartDateYear.SelectedValue)) { nStartDateYear = new NullableInt(System.Convert.ToInt32(ddStartDateYear.SelectedValue)); } ccdStartDate = new CreditCardDate(nStartDateMonth, nStartDateYear); cdCardDetails = new CardDetails(tbCardName.Text, tbCardNumber.Text, ccdExpiryDate, ccdStartDate, tbIssueNumber.Text, tbCV2.Text); if (!String.IsNullOrEmpty(ddCountries.SelectedValue)) { nTemp = System.Convert.ToInt32(ddCountries.SelectedValue); if (nTemp != -1) { nCountryCode = new NullableInt(nTemp); } } cdCustomerDetails = new CustomerDetails(new AddressDetails(tbAddress1.Text, tbAddress2.Text, tbAddress3.Text, tbAddress4.Text, tbCity.Text, tbState.Text, tbPostCode.Text, nCountryCode), "*****@*****.**", "123456789", Request.UserHostAddress); cdtCardDetailsTransaction = new CardDetailsTransaction(lrgepRequestGatewayEntryPoints, new MerchantDetails(Global.MerchantID, Global.Password), new TransactionDetails(TRANSACTION_TYPE.SALE, new NullableInt(System.Convert.ToInt32(hfAmount.Value)), new NullableInt(System.Convert.ToInt32(hfCurrencyISOCode.Value)), hfOrderID.Value, hfOrderDescription.Value, tcTransactionControl, new ThreeDSecureBrowserDetails(new NullableInt(0), "*/*", Request.UserAgent)), cdCardDetails, cdCustomerDetails, null); // send the SOAP request if (!cdtCardDetailsTransaction.ProcessTransaction(out goGatewayOutput, out tomTransactionOutputMessage)) { szMessage = "Couldn't communicate with payment gateway"; boTransactionSuccessful = false; } else { switch (goGatewayOutput.StatusCode) { case 0: // status code of 0 - means transaction successful boTransactionSuccessful = true; m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; break; case 3: // status code of 3 - means 3D Secure authentication required m_fmFormMode = FORM_MODE.THREE_D_SECURE; m_szTermURL = Global.SiteSecureBaseURL + "ThreeDSecureLandingPage.aspx"; m_szPaREQ = tomTransactionOutputMessage.ThreeDSecureOutputData.PaREQ; m_szACSURL = tomTransactionOutputMessage.ThreeDSecureOutputData.ACSURL; m_szCrossReference = tomTransactionOutputMessage.CrossReference; break; case 5: // status code of 5 - means transaction declined boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; break; case 20: // status code of 20 - means duplicate transaction m_fmFormMode = FORM_MODE.RESULTS; szMessage = goGatewayOutput.Message; if (goGatewayOutput.PreviousTransactionResult.StatusCode.Value == 0) { boTransactionSuccessful = true; } else { boTransactionSuccessful = false; } szPreviousTransactionMessage = goGatewayOutput.PreviousTransactionResult.Message; boDuplicateTransaction = true; break; case 30: // status code of 30 - means an error occurred boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.PAYMENT_FORM; sbString = new StringBuilder(); // get any additional messages if (goGatewayOutput.ErrorMessages.Count > 0) { sbString.Append("<br /><ul>"); for (nCount = 0; nCount < goGatewayOutput.ErrorMessages.Count; nCount++) { sbString.AppendFormat("<li>{0}</li>", goGatewayOutput.ErrorMessages[nCount]); } sbString.Append("</ul>"); } szMessage = goGatewayOutput.Message + sbString.ToString(); break; default: // unhandled status code boTransactionSuccessful = false; m_fmFormMode = FORM_MODE.PAYMENT_FORM; szMessage = goGatewayOutput.Message; break; } } if (m_fmFormMode == FORM_MODE.PAYMENT_FORM) { pnMessagePanel.CssClass = "ErrorMessage"; pnMessagePanel.Visible = true; lbMessageLabel.Text = szMessage; pnTransactionResultsPanel.Visible = false; } else { pnTransactionResultsPanel.Visible = true; pnMessagePanel.Visible = false; if (!boTransactionSuccessful) { pnTransactionResultsPanel.CssClass = "ErrorMessage"; } else { pnTransactionResultsPanel.CssClass = "SuccessMessage"; } lbGatewayResponse.Text = szMessage; // sort out the duplicate transaction reporting if (boDuplicateTransaction) { pnDuplicateTransactionPanel.Visible = true; lbPreviousTransactionMessage.Text = szPreviousTransactionMessage; } // the process another link if (boTransactionSuccessful == true) { Response.Redirect("Thankyou.aspx?id=" + szMessage); } else { hlProcessAnother.NavigateUrl = Global.SiteSecureBaseURL + "PaymentForm.aspx"; } } }
public static void SetControlState(this Component component, FORM_MODE[] form_mode_to_enable, FORM_MODE current_form_mode) { if (form_mode_to_enable.Where(m => m == current_form_mode).Count() > 0) // Enable component { if (component is Button) { ((Button)component).Enabled = true; } if (component is TextBox) { ((TextBox)component).Enabled = true; } if (component is DateTimePicker) { ((DateTimePicker)component).Enabled = true; } if (component is NumericUpDown) { ((NumericUpDown)component).Enabled = true; } if (component is CheckBox) { ((CheckBox)component).Enabled = true; } } else // Disable component { if (component is Button) { ((Button)component).Enabled = false; } if (component is TextBox) { ((TextBox)component).Enabled = false; } if (component is DateTimePicker) { ((DateTimePicker)component).Enabled = false; } if (component is NumericUpDown) { ((NumericUpDown)component).Enabled = false; } if (component is CheckBox) { ((CheckBox)component).Enabled = false; } } }
private void save_data_gd_chi_tiet_giai_ngan_in_grid(US_GD_CHI_TIET_GIAI_NGAN ip_us, FORM_MODE ip_form_mode) { ip_us.dcID_LOAI_NHIEM_VU = CIPConvert.ToDecimal(m_ddl_grid_edit_loai_nhiem_vu.SelectedValue); if (m_rdb_grid_edit_theo_chuong_loai_khoan_muc.Checked == true) { string v_str_mix = m_ddl_grid_edit_muc_tieu_muc.SelectedValue; string[] v_arr_id = v_str_mix.Split('|'); ip_us.dcID_CHUONG = CIPConvert.ToDecimal(v_arr_id[0]); //v_dc_id_loai = CIPConvert.ToDecimal(v_arr_id[1]); ip_us.dcID_KHOAN = CIPConvert.ToDecimal(v_arr_id[2]); ip_us.dcID_MUC = CIPConvert.ToDecimal(v_arr_id[3]); if (!v_arr_id[4].Trim().Equals("")) { ip_us.dcID_TIEU_MUC = CIPConvert.ToDecimal(v_arr_id[4]); } ip_us.SetID_CONG_TRINHNull(); ip_us.SetID_DU_ANNull(); } else { ip_us.dcID_CONG_TRINH = CIPConvert.ToDecimal(m_ddl_grid_edit_du_an_quoc_lo.SelectedValue); ip_us.dcID_DU_AN = CIPConvert.ToDecimal(m_ddl_grid_edit_du_an.SelectedValue); ip_us.SetID_CHUONGNull(); ip_us.SetID_KHOANNull(); ip_us.SetID_MUCNull(); ip_us.SetID_TIEU_MUCNull(); } ip_us.dcID_DON_VI = CIPConvert.ToDecimal(m_ddl_don_vi.SelectedValue); ip_us.dcID_GIAI_NGAN = CIPConvert.ToDecimal(m_hdf_id_dm_giai_ngan.Value); ip_us.dcSO_TIEN_NOP_THUE = CIPConvert.ToDecimal(m_txt_grid_edit_so_tien_nop_thue.Text); ip_us.dcSO_TIEN_TT_CHO_DV_HUONG = CIPConvert.ToDecimal(m_txt_grid_edit_so_tien_tt_cho_dv_huong.Text); ip_us.strNOI_DUNG_CHI = m_txt_grid_edit_ghi_chu.Text.Trim(); switch (ip_form_mode) { case FORM_MODE.THEM: ip_us.Insert(); WebformControls.ghiLogDuToan("Thêm bản ghi Giải ngân ở Uỷ nhiệm chi " + new US_DM_GIAI_NGAN(ip_us.dcID_GIAI_NGAN).strSO_UNC); break; case FORM_MODE.SUA: ip_us.Update(); WebformControls.ghiLogDuToan("Cập nhật bản ghi Giải ngân ở Uỷ nhiệm chi " + new US_DM_GIAI_NGAN(ip_us.dcID_GIAI_NGAN).strSO_UNC); break; case FORM_MODE.XOA: break; default: break; } }
private void FormReadItem() { this.form_mode = FORM_MODE.READ_ITEM; this.toolStripProcessing.Visible = false; this.dgv.Enabled = true; this.dgv.Focus(); #region Toolstrip button this.toolStripEdit.Enabled = false; this.toolStripStop.Enabled = true; this.toolStripSave.Enabled = true; this.toolStripItem.Enabled = false; #endregion Toolstrip button #region Form control this.rbHoliday.Enabled = false; this.rbWeekday.Enabled = false; this.leaveMax.Enabled = false; #endregion Form control this.ClearInlineForm(); }