//returns list with all characters from db public static List <Taxation> GetTaxations(MySqlConnection _connection) { _connection.Open(); //retrieve from db MySqlCommand command = _connection.CreateCommand(); command.CommandText = "SELECT * FROM `taxation`"; MySqlDataReader data = command.ExecuteReader(); List <Taxation> taxations = new List <Taxation>(); List <Enterprise> enterprises = EnterpriseDAO.GetEnterprises(_connection); //read data from dataReader and form list of Character instances while (data.Read()) { Int64 id = Convert.ToInt64(data["id"]); int taxation_group = Convert.ToInt32(data["taxation_group"]); decimal max_revenue = Convert.ToDecimal(data["max_revenue"]); int max_employee = Convert.ToInt32(data["max_employee"]); double VAT = Convert.ToDouble(data["VAT"]); double income_duty = Convert.ToDouble(data["income_duty"]); Taxation taxation = new Taxation(id, taxation_group, max_revenue, max_employee, VAT, income_duty); Debug.Log("Get taxation " + id); taxations.Add(taxation); } _connection.Close(); return(taxations); }
static void Main(string[] args) { Employee employee = new Employee(); employee.Salary = 40000; Console.WriteLine("Gross salary before tax - {0}", employee.Salary); Taxation.Calculate(employee); Console.WriteLine("Net salary after tax - {0}", employee.Salary); }
void Start() { if (InfoTransfer.Character != null && InfoTransfer.Taxation != null) { curCharacter = InfoTransfer.Character; Debug.Log(curCharacter); curTaxation = InfoTransfer.Taxation; Debug.Log(curTaxation); } pointsText.SetText("0"); // Нужно сделать считывание с сохранения }
protected void Page_Load(object sender, EventArgs e) { // Taxation cs_tax = StorehouseHelper.GetTaxation(ecPanelRequest.TaxationId); // if (cs_tax == null) { RedirectToBrowsePage(); } // if (!IsPostBack) { // txtDescription.Text = cs_tax.Description; // PortalUtils.LoadCountriesDropDownList(ddlCountries, cs_tax.Country); // LoadCountryStates(); // chkAllStates.Checked = String.Equals(ddlCountries.SelectedValue, TaxationsAddTax.ALL_COUNTRIES); chkAllStates.Checked = String.Equals(cs_tax.State, TaxationsAddTax.ALL_STATES); if (!chkAllStates.Checked) { // if (ddlStates.Visible) { ecUtils.SelectListItem(ddlStates, cs_tax.State); } else { txtStateProvince.Text = cs_tax.State; } } chkAllStates_CheckedChanged(sender, e); // txtTaxAmount.Text = cs_tax.Amount.ToString("C"); // rblTaxStatus.SelectedIndex = (cs_tax.Active) ? 0 : 1; // Utils.SelectListItem(ddlTaxType, cs_tax.TypeId); // SetTaxAmountValidationType(ddlTaxType.SelectedValue); } }
public bool InsertOrUpdate(Taxation Taxation) { return(_epr.InsertOrUpdate(Taxation)); }
public void UnRegisterHandler(Taxation handler) { this.handler = null; }
public void RegisterHandler(Taxation handler) { this.handler = handler; }
public bool Save(Taxation Taxation) { _TaxationApp.InsertOrUpdate(Taxation); return(_connection.Save()); }
static void Main(string[] args) { Taxation taxation = new Taxation(); taxation.RunApplication(); }