public override bool IsDataValide() { int NumberOfErrors = 0; if (Grid.RowCount == 0) { NumberOfErrors++; XtraMessageBox.Show( text: "لإتمام عملية الحفظ يجب إدخال صنف واحد على الأقل", caption: "تنبيه :", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error); } NumberOfErrors += Txt_Code.IsTextValide() ? 0 : 1; NumberOfErrors += Lkp_PartType.IsEditValueValide() ? 0 : 1; NumberOfErrors += Lkp_Treasurys.IsEditValueValide() ? 0 : 1; NumberOfErrors += Lkp_Branch.IsEditValueValide() ? 0 : 1; NumberOfErrors += GLkp_PartName.IsEditValueValide() ? 0 : 1; NumberOfErrors += Dt_Date.IsDateValide() ? 0 : 1; if (Chk_PostedTostore.Checked) { NumberOfErrors += Dt_PostedDate.IsDateValide() ? 0 : 1; } return(NumberOfErrors == 0); }
public bool FormIsComplete() { if (!Txt_Code.Equals("") && !Txt_Password.Equals("")) { return(true); } else { return(false); } }
private void Reinitialiser() { try { Txt_Code.Text = string.Empty; Txt_Libelle.Text = string.Empty; btnOk.IsEnabled = false; Txt_Code.Focus(); } catch (Exception ex) { throw ex; } }
private void Reinitialiser() { try { Txt_Code.Text = string.Empty; Txt_Libelle.Text = string.Empty; CboQuartier.SelectedItem = null; btnOk.IsEnabled = false; Txt_Code.Focus(); } catch (Exception ex) { throw ex; } }
private void Reinitialiser() { try { Txt_Code.Text = string.Empty; Txt_Libelle.Text = string.Empty; Txt_BNI.Text = string.Empty; Txt_BNS.Text = string.Empty; Txt_CFI.Text = string.Empty; Txt_CFS.Text = string.Empty; CboProduit.SelectedItem = string.Empty; btnOk.IsEnabled = false; Txt_Code.Focus(); } catch (Exception ex) { throw ex; } }
private void BtnOK_Click(object sender, RoutedEventArgs e) { try { var messageBox = new MessageBoxControl.MessageBoxChildWindow(Languages.LibelleNationalite, Languages.QuestionEnregistrerDonnees, MessageBoxControl.MessageBoxButtons.YesNo, MessageBoxControl.MessageBoxIcon.Question); messageBox.OnMessageBoxClosed += (_, result) => { if (messageBox.Result == MessageBoxResult.OK) { listForInsertOrUpdate = GetInformationsFromScreen(); var service = new ParametrageClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Parametrage")); if (listForInsertOrUpdate != null && listForInsertOrUpdate.Count > 0) { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { service.InsertNationaliteCompleted += (snder, insertR) => { if (insertR.Cancelled || insertR.Error != null) { Message.ShowError(insertR.Error.Message, Languages.LibelleNationalite); return; } if (!insertR.Result) { Message.ShowError(Languages.ErreurInsertionDonnees, Languages.LibelleNationalite); return; } UpdateParentList(listForInsertOrUpdate[0]); DialogResult = true; }; service.InsertNationaliteAsync(listForInsertOrUpdate); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { service.UpdateNationaliteCompleted += (snder, UpdateR) => { if (UpdateR.Cancelled || UpdateR.Error != null) { Message.ShowError(UpdateR.Error.Message, Languages.LibelleNationalite); return; } if (!UpdateR.Result) { Message.ShowError(Languages.ErreurMiseAJourDonnees, Languages.LibelleNationalite); return; } UpdateParentList(listForInsertOrUpdate[0]); DialogResult = true; }; service.UpdateNationaliteAsync(listForInsertOrUpdate); } } } else { return; } }; messageBox.Show(); } catch (Exception ex) { Message.ShowError(ex.Message, Languages.LibelleNationalite); } finally { Txt_Code.Focus(); } }