Пример #1
0
        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"));
            }
        }
Пример #2
0
        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"));
            }
        }
Пример #3
0
        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();
        }
Пример #4
0
        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();
        }
Пример #5
0
 private void AddNewDialog_OnClick(object sender, EventArgs e)
 {
     Dialog.Message("Success");
 }
Пример #6
0
 internal void WriteEMailButton_OnClick(object o, EventArgs e)
 {
     Dialog.Message(Translator.Translate("under_construction"));
 }
Пример #7
0
 private void AddNewDialog_OnClick(object sender, EventArgs e)
 {
     //System.Threading.Thread.Sleep(10000);
     FileSystem.SyncShared();
     Dialog.Message("Success");
 }