Ejemplo n.º 1
0
        protected void buttonAdd_Click(object sender, EventArgs e)
        {
            TourOtherExpense expense = new TourOtherExpense();

            expense.Tour = _tour;
            expense.Name = txtBoxName.Text;
            _module.SaveOrUpdate(expense);

            foreach (RepeaterItem item in rptExpensePrice.Items)
            {
                TourOtherExpensePrice price = new TourOtherExpensePrice();
                price.Expense = expense;
                HiddenField hiddenNumberOfCustomer = item.FindControl("hiddenNumberOfCustomer") as HiddenField;
                TextBox     textBoxPrice           = item.FindControl("txtPrice") as TextBox;
                if (hiddenNumberOfCustomer == null || textBoxPrice == null)
                {
                    continue;
                }
                price.NumberOfCustomers = Convert.ToInt32(hiddenNumberOfCustomer.Value);
                price.NetPrice          = Convert.ToDecimal(textBoxPrice.Text);
                price.Currency          = _module.CurrencyGetById(1);
                _module.SaveOrUpdate(price);
            }

            GetAddExpenseList();
            rptAddedExpenses.DataBind();
        }
Ejemplo n.º 2
0
 protected void rptTourPackages_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     switch (e.CommandName.ToLower())
     {
     case "select":
         TourPackageConfig config = new TourPackageConfig();
         config.Tour    = _tour;
         config.Package = _module.TourGetById(Convert.ToInt32(e.CommandArgument));
         _module.SaveOrUpdate(config);
         GetTourConfigList();
         rptTourConfigs.DataBind();
         break;
     }
 }