示例#1
0
文件: SaleForm.cs 项目: Auxistus/STO
 private void SaleForm_VisibleChanged(object sender, EventArgs e)
 {
     if (Visible && saleID == -1)
     {
         SaleGrid.ClearSelection();
     }
 }
示例#2
0
文件: SaleForm.cs 项目: Auxistus/STO
        private void CancelButton_Click(object sender, EventArgs e)
        {
            SaleErrorProvider.Clear();

            if (saleID > 0)
            {
                ViewSaleDetailTab(saleID, false);
            }
            else
            {
                ViewSaleListingTab();

                saleID = -1;

                SaleGrid.ClearSelection();
            }
        }
示例#3
0
文件: SaleForm.cs 项目: Auxistus/STO
        private void FilterButton_Click(object sender, EventArgs e)
        {
            var filter = new SaleFilter
            {
                ID                = FilterIDTextBox.Text.AsInt(),
                CustomerName      = FilterCustomerNameTextBox.Text,
                ProductID         = (FilterProductDropDown.SelectedValue.AsInt() == 0) ? null : FilterProductDropDown.SelectedValue.AsInt(),
                SoldFrom          = (FilterSoldFromDatePicker.Format == DateTimePickerFormat.Custom) ? null : FilterSoldFromDatePicker.Value.Date.AsDateTime(),
                SoldTo            = (FilterSoldToDatePicker.Format == DateTimePickerFormat.Custom) ? null : FilterSoldToDatePicker.Value.Date.AsDateTime(),
                IsNotApprovedOnly = FilterIsNotApprovedOnlyCheckBox.Checked
            };

            using (var repository = new SaleRepository())
            {
                SaleGrid.DataSource = repository.GetSales(filter);
            }

            SaleGrid.ClearSelection();
        }