Ejemplo n.º 1
0
 public void EditRow(Taxs tax, int index)
 {
     //get selectedRow from the dataTable, tableCourse
     DataRow selectedRow = dataSet.Tables["Tax"].Rows[index];
     //replace values from course object
     selectedRow["TaxNo"] = tax.TaxNo;
     selectedRow["TaxFrom"] = tax.TaxFrom;
     selectedRow["TaxTo"] = tax.TaxTo;
     selectedRow["PercentOver"] = tax.PercentOver;
     selectedRow["TaxExemption"] = tax.TaxExemption;
     selectedRow["CivilStatus"] = tax.CivilStatus;
     selectedRow["Dependent"] = tax.Dependent;
     selectedRow["NoOfDependent"] = tax.NoOfDependent;
     EditRecord(tax, index);
 }
Ejemplo n.º 2
0
 public Tax()
 {
     InitializeComponent();
     admin = new Admin();
     tax = new Taxs();
 }
Ejemplo n.º 3
0
        public void DeleteRow(Taxs tax, int index)
        {
            //get selectedRow from the dataTable, tableCourse
            DataRow selectedRow = dataSet.Tables["Tax"].Rows[index];

            //delete selected row from the dataSet
            selectedRow.Delete();

            DeleteRecord(tax, index);
        }
Ejemplo n.º 4
0
        private void EditRecord(Taxs tax, int index)
        {
            //set up command
            SqlCommand command = new SqlCommand();
            command.Connection = connection;

            //set up commandType
            command.CommandType = CommandType.StoredProcedure;

            //set up procedure name
            command.CommandText = "cprocedureUpdateTax";
            dataAdapter.UpdateCommand = command;

            //set up parameters
            command.Parameters.AddWithValue("@TaxNo", tax.TaxNo);
            command.Parameters.AddWithValue("@TaxFrom", tax.TaxFrom);
            command.Parameters.AddWithValue("@TaxTo", tax.TaxTo);
            command.Parameters.AddWithValue("@PercentOver", tax.PercentOver);
            command.Parameters.AddWithValue("@TaxExemption", tax.TaxExemption);
            command.Parameters.AddWithValue("@CivilStatus", tax.CivilStatus);
            command.Parameters.AddWithValue("@Dependent", tax.Dependent);
            command.Parameters.AddWithValue("@NoOfDependent", tax.NoOfDependent);
            //update tableCourse from the dataSet
            dataAdapter.Update(dataSet, "Tax");
        }
Ejemplo n.º 5
0
        private void DeleteRecord(Taxs tax, int index)
        {
            //set up command
            SqlCommand command = new SqlCommand();
            command.Connection = connection;

            //set up commandType
            command.CommandType = CommandType.StoredProcedure;

            //set up procedure name
            command.CommandText = "cprocedureDeleteTax";
            dataAdapter.DeleteCommand = command;

            //set up parameters
            command.Parameters.AddWithValue("@TaxNo", tax.TaxNo);
            //update tableCourse from the dataSet
            dataAdapter.Update(dataSet, "Tax");
        }
Ejemplo n.º 6
0
 public void AddRecord(Taxs tax)
 {
     connection.Open();
     //set up command
     SqlCommand command = new SqlCommand("cprocedureInsertTax", connection);
     //set up commandType
     command.CommandType = CommandType.StoredProcedure;
     //set up parameters
     command.Parameters.AddWithValue("@TaxFrom", tax.TaxFrom);
     command.Parameters.AddWithValue("@TaxTo", tax.TaxTo);
     command.Parameters.AddWithValue("@PercentOver", tax.PercentOver);
     command.Parameters.AddWithValue("@TaxExemption", tax.TaxExemption);
     command.Parameters.AddWithValue("@CivilStatus", tax.CivilStatus);
     command.Parameters.AddWithValue("@Dependent", tax.Dependent);
     command.Parameters.AddWithValue("@NoOfDependent", tax.NoOfDependent);
     command.ExecuteNonQuery();
     connection.Close();
 }
Ejemplo n.º 7
0
 public Tax()
 {
     InitializeComponent();
     admin = new Admin();
     tax   = new Taxs();
 }