internal void StartFinishButton_OnClick(object sender, EventArgs eventArgs) { var result = DBHelper.GetTotalFinishedRequireQuestionByEventId( (string)BusinessProcess.GlobalVariables[Parameters.IdCurrentEventId]); var isActiveEvent = !result.Next() || (long)result["count"] == 0; if (isActiveEvent) { Dialog.Alert(Translator.Translate("closeeventquestion"), (o, args) => { if (!CheckEventBeforeClosing() || args.Result != 0) { return; } Navigation.Move("CloseEventScreen"); }, null, Translator.Translate("yes"), Translator.Translate("no")); } else { Dialog.Message(Translator.Translate("unfinished_business")); } }
internal void StartFinishButton_OnClick(object sender, EventArgs eventArgs) { var result = DBHelper.GetTotalFinishedRequireQuestionByEventId( (string)BusinessProcess.GlobalVariables[Parameters.IdCurrentEventId]); var isActiveEvent = !result.Next() || (long)result["count"] == 0; if (isActiveEvent) { Dialog.Alert(Translator.Translate("closetaskquestion"), (o, args) => { if (!CheckEventBeforeClosing() || args.Result != 0) { return; } var @event = (Event) DBHelper.LoadEntity( (string)BusinessProcess.GlobalVariables[Parameters.IdCurrentEventId]); @event.Status = StatusyEvents.GetDbRefFromEnum(StatusyEventsEnum.Done); @event.ActualEndDate = DateTime.Now; DBHelper.SaveEntity(@event, false); Navigation.Move("CloseEventScreen"); }, null, Translator.Translate("yes"), Translator.Translate("no")); } else { Dialog.Message(Translator.Translate("unfinished_business")); } }
internal void TopInfo_RightButton_OnClick(object sender, EventArgs e) { var name = ((EditText)Variables["NameEditText"]).Text.Trim(); var surname = ((EditText)Variables["SurnameEditText"]).Text.Trim(); var position = ((EditText)Variables["PositionEditText"]).Text.Trim(); var phone = ((EditText)Variables["PhoneEditText"]).Text; var email = ((EditText)Variables["EMailEditText"]).Text; // TODO: Разбраться с Code if (string.IsNullOrWhiteSpace(name)) { Dialog.Message(Translator.Translate("forgot_name")); return; } string pattern = @"^((\d{1,3}|\+\d{1,3})[\- ]?)?(\(?\d{3,5}\)?[\- ]?)?[\d\- ]{7,10}$"; Regex r = new Regex(pattern, RegexOptions.None); if (!r.IsMatch(phone) && !phone.Equals("")) { Dialog.Message(Translator.Translate("phone_mask_warn")); return; } Contact.Description = $"{name} {surname}"; Contact.Position = position; Contact.Tel = phone; Contact.EMail = email; DBHelper.SaveEntity(Contact); if (_clientId != null) { // TODO Разобраться с LineNumber var clientContacts = new Client_Contacts { Ref = DbRef.FromString(_clientId), Id = DbRef.CreateInstance("Catalog_Client_Contacts", Guid.NewGuid()), Contact = Contact.Id, Actual = false // Actual на самом деле означает "уволен" }; DBHelper.SaveEntity(clientContacts); } Navigation.Back(); }
internal void TopInfo_RightButton_OnClick(object sender, EventArgs e) { var name = ((EditText)Variables["NameEditText"]).Text; var surname = ((EditText)Variables["SurnameEditText"]).Text; var position = ((EditText)Variables["PositionEditText"]).Text; var phone = ((EditText)Variables["PhoneEditText"]).Text; var email = ((EditText)Variables["EMailEditText"]).Text; // TODO: Разбраться с Code if (string.IsNullOrWhiteSpace(name)) { Dialog.Message(Translator.Translate("forgot_name")); return; } Contact.Description = $"{name} {surname}"; Contact.Position = position; Contact.Tel = phone; Contact.EMail = email; DBHelper.SaveEntity(Contact); if (_clientId != null) { // TODO Разобраться с LineNumber var clientContacts = new Client_Contacts { Ref = DbRef.FromString(_clientId), Id = DbRef.CreateInstance("Catalog_Client_Contacts", Guid.NewGuid()), Contact = Contact.Id, Actual = false // Actual на самом деле означает "уволен" }; DBHelper.SaveEntity(clientContacts); } Navigation.Back(); }
private void AddNewDialog_OnClick(object sender, EventArgs e) { Dialog.Message("Success"); }
internal void WriteEMailButton_OnClick(object o, EventArgs e) { Dialog.Message(Translator.Translate("under_construction")); }
private void AddNewDialog_OnClick(object sender, EventArgs e) { //System.Threading.Thread.Sleep(10000); FileSystem.SyncShared(); Dialog.Message("Success"); }