// Список internal void CheckListValList_OnClick(object sender, EventArgs e) { if (_readonly) { return; } _currentCheckListItemID = ((VerticalLayout)sender).Id; _textView = (TextView)((VerticalLayout)sender).GetControl(0); var tv = GetTextView(sender); var startObject = "not_choosed"; var items = new Dictionary <object, string> { { "not_choosed", Translator.Translate("not_choosed") } }; var temp = DBHelper.GetActionValuesList(_textView.Id); while (temp.Next()) { if (temp["Val"] == null) { DConsole.WriteLine("Empty value Id: " + (temp["Id"] == null ? "Id is empty" : temp["Id"].ToString())); continue; } items[temp["Id"].ToString()] = temp["Val"].ToString(); if (temp["Val"].ToString() == _textView.Text) { startObject = temp["Id"].ToString(); } } Dialog.Choose(tv.Text, items, startObject, ValListCallback); }
internal void ChoosePaymentType_OnClick(object sender, EventArgs e) { Dialog.Choose(Translator.Translate("payment_type"), _paymentTypes, $"{_choosedPaymentType}", (o, args) => { _choosedPaymentType = int.Parse($"{args.Result.Key}"); _paymentTypeTextView.Text = args.Result.Value; DisableButton(); ChangeViewState(_choosedPaymentType <= 0); _punchButtonLayout.OnClick -= Print_OnClick; switch (_choosedPaymentType) { case 0: _enteredSumEditText.Enabled = true; _enteredSumEditText.Text = $"{_totalSum}"; break; case 1: case 2: case 3: _enteredSumEditText.Text = $"{_totalSum}"; _enteredSumEditText.Enabled = false; break; } ProcessingPaymentType(); }); }
internal void StatusImportance_OnClick(object sender, EventArgs e) { Dialog.Choose(Translator.Translate("select_importance"), DBHelper.GetStatusImportance(), _statusImportance, (o, args) => { ((Button)sender).Text = args.Result.Value; _event.Importance = (DbRef)args.Result.Key; _statusImportance = args.Result.Key; Utils.TraceMessage($"{nameof(_event)}.{nameof(_event.Importance)}-> " + $"{_event.Importance}"); }); }
internal void SelectTaskType_OnClick(object sender, EventArgs e) { Dialog.Choose(Translator.Translate("task_type"), DBHelper.GetTaskTypes(), _choosedTaskType, (sendr, args) => { ((Button)sender).Text = args.Result.Value; _choosedTaskType = args.Result.Key; _event.KindEvent = (DbRef)args.Result.Key; Utils.TraceMessage($"_event.KindEvent-> {_event.KindEvent}"); }); }
// Булево internal void CheckListBoolean_OnClick(object sender, EventArgs e) { if (_readonly) { return; } _currentCheckListItemID = ((VerticalLayout)sender).Id; _textView = (TextView)((VerticalLayout)sender).GetControl(0); var tv = GetTextView(sender); var items = new Dictionary <object, string> { { "true", Translator.Translate("yes") }, { "false", Translator.Translate("no") }, }; var startKey = _textView.Text == Translator.Translate("no") ? "false" : "true"; Dialog.Choose(tv.Text, items, startKey, BooleanCallback); }