//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);
    }
Exemplo n.º 3
0
    void Start()
    {
        if (InfoTransfer.Character != null && InfoTransfer.Taxation != null)
        {
            curCharacter = InfoTransfer.Character;
            Debug.Log(curCharacter);
            curTaxation = InfoTransfer.Taxation;
            Debug.Log(curTaxation);
        }

        pointsText.SetText("0"); // Нужно сделать считывание с сохранения
    }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
0
 public bool InsertOrUpdate(Taxation Taxation)
 {
     return(_epr.InsertOrUpdate(Taxation));
 }
Exemplo n.º 6
0
 public void UnRegisterHandler(Taxation handler)
 {
     this.handler = null;
 }
Exemplo n.º 7
0
 public void RegisterHandler(Taxation handler)
 {
     this.handler = handler;
 }
Exemplo n.º 8
0
 public bool Save(Taxation Taxation)
 {
     _TaxationApp.InsertOrUpdate(Taxation);
     return(_connection.Save());
 }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            Taxation taxation = new Taxation();

            taxation.RunApplication();
        }