예제 #1
0
        private async void btnCreateIssue_Click(object sender, RoutedEventArgs e)
        {
            if (cmbCustomers.SelectedIndex < 0)
            {
                var dialog = new MessageDialog("Please select a customer!");
                await dialog.ShowAsync();
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(tbxTitle.Text) && !string.IsNullOrWhiteSpace(tbxDescription.Text))
                {
                    Customer customer = (Customer)cmbCustomers.SelectedItem;

                    await SqliteContext.CreateIssueAsync(
                        new Issue
                    {
                        Title       = tbxTitle.Text,
                        Description = tbxDescription.Text,
                        CustomerId  = customer.Id
                    }
                        );
                }
                else
                {
                    var dialog = new MessageDialog("Please fill in both of description and title fields!");
                    await dialog.ShowAsync();
                }
            }
            await LoadIssuesAsync();

            ResetTextBoxes();
        }
예제 #2
0
        private async void btnSaveIssue_Click(object sender, RoutedEventArgs e)
        {
            await SqliteContext.CreateIssueAsync(new Issue { CustomerId = await SqliteContext.GetCustomerIdByNames(cmbCustomer.SelectedItem.ToString()), Titel = tbTitel.Text, Description = tbDescription.Text, Category = cbCategory.SelectedItem.ToString() });

            tbTitel.Text       = "";
            cbCategory.Text    = "";
            tbDescription.Text = "Case Added";
        }
예제 #3
0
        private async void CreateIssue_Click(object sender, RoutedEventArgs e)
        {
            await SqliteContext.CreateIssueAsync(
                new Issue
            {
                Title       = "CAS-" + Guid.NewGuid().ToString(),
                Description = "Detta är ett ärende",
                CustomerId  = await SqliteContext.GetCustomerIdByName(cmbCustomers.SelectedItem.ToString())
            }
                );

            await LoadIssuesAsync();
        }
예제 #4
0
        private async void btnAddIssue_Click(object sender, RoutedEventArgs e)
        {
            if (cbxCustomers.SelectedItem == null)
            {
                return;
            }

            Issue issue = new Issue(
                ((Customer)cbxCustomers.SelectedItem).Id,
                tbxTitle.Text,
                tbxDescription.Text,
                "pending"
                );

            await SqliteContext.CreateIssueAsync(issue);
        }
예제 #5
0
        private async void btnAddIssue_Click(object sender, RoutedEventArgs e)
        {
            await SqliteContext.CreateIssueAsync(
                new Issue
            {
                Title       = "Title: " + tbTitle.Text,
                Description = "Desc: " + tbDescription.Text,
                Status      = cmbStatus.SelectedItem.ToString(),
                CustomerId  = await SqliteContext.GetCustomerIdByName(cmbCustomers.SelectedItem.ToString())
            }

                );

            tbTitle.Text       = string.Empty;
            tbDescription.Text = string.Empty;
        }
예제 #6
0
        private async void CreateCase_Click(object sender, RoutedEventArgs e)
        {
            await SqliteContext.CreateIssueAsync(
                new Issue
            {
                GuidId = Guid.NewGuid(),
                Title  = TitleBox.ToString(),
                Status = cmbStatus.SelectedItem.ToString(),

                CustomerId = await SqliteContext.GetCustomerIdByNameAsync(cmbCustomers.SelectedItem.ToString())
            }

                );

            await LoadIssuesAsync();
        }
예제 #7
0
        private async void CreateIssue_Click(object sender, RoutedEventArgs e)
        {
            //Om alla av dem här inte har tomma strängar eller innehåller värdet null så exekveras CreateIssueAsync med dynamiska värden
            if (tbxTitle.Text != "" && tbxDesc.Text != "" && cmbCategory.SelectedItem != null)
            {
                await SqliteContext.CreateIssueAsync(
                    new Issue
                {
                    Title       = $"{tbxTitle.Text} - ({ Guid.NewGuid()})",
                    Description = tbxDesc.Text,
                    Category    = cmbCategory.SelectedItem.ToString(),
                    //Skickar iväg värden som är vald på comboboxen. Jag konverterar om till string för säkerhets skull
                    CustomerId = await SqliteContext.GetCustomerIdByName(cmbCustomers.SelectedItem.ToString()),
                    //hämtar länken till bilden som är sparad i _picture
                    PictureSource = StorageBlob._picture
                }
                    );
                await LoadIssuesAsync();

                uploadMessage.Text = "";
            }
        }