Пример #1
0
        private void btnDeleteHistory_Click(object sender, EventArgs e)
        {
            try
            {
                int RangeId = ddlDateRange.SelectedValue.ToInt();


                if (RangeId == 0)
                {
                    ENUtils.ShowMessage("Please select a DateRange History");
                    return;
                }

                using (TaxiDataContext db = new TaxiDataContext())
                {
                    Fleet_DriverWeeklyRentHistory objHistory = db.GetTable <Fleet_DriverWeeklyRentHistory>().FirstOrDefault(c =>
                                                                                                                            (c.Id == RangeId));


                    if (objHistory != null)
                    {
                        db.Fleet_DriverWeeklyRentHistories.DeleteOnSubmit(objHistory);
                        db.SubmitChanges();
                    }
                }

                ComboFunctions.FillDriverWeeklyRentHistoryCombo(ddlDateRange);
                //ComboFunctions.FillDriverCommissionCollectionHistoryCombo(ddlDateRange);
                grdLister.Rows.Clear();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Пример #2
0
        private void FillCombo()
        {
            ComboFunctions.FillDriverWeeklyRentHistoryCombo(ddlDateRange);
            ComboFunctions.FillDriverNoCombo(ddlDriver);

            //ComboFunctions.FillDriverNoCombo(ddlDriver, c => c.DriverTypeId == 1);
        }