示例#1
0
        private void btnAdd_Clicked(object sender, EventArgs e)
        {
            for (int i = 1; i <= Convert.ToInt32(picQTY.SelectedItem); i++)
            {
                Model.SelectedGarments garment = new Model.SelectedGarments();
                garment.Name    = txtGarmentName.Text;
                garment.QTY     = 1;
                garment.IsTrail = chkTrailDate.IsChecked;
                lstSelectedGarment.Add(garment);
            }

            dgvAddedGarmnet.ItemsSource = lstSelectedGarment;
        }
示例#2
0
        private async void btnDelete_Clicked(object sender, EventArgs e)
        {
            bool result = await Model.Utility.ShowQuestionMessageBox("Are you sure, you want to delete this Garment?", this);

            if (result)
            {
                Button button  = (Button)sender;
                var    binding = button.BindingContext;

                Model.SelectedGarments tc = (Model.SelectedGarments)(binding);

                lstSelectedGarment.Remove(tc);

                dgvAddedGarmnet.ItemsSource = lstSelectedGarment;

                Model.Utility.ShowMessageBox("Garment has been deleted successfully.", Model.Utility.MessageType.Success, this);
            }
        }