public void AddRecord(SSSS sss)
 {
     connection.Open();
     //set up command
     SqlCommand command = new SqlCommand("sprocedureInsertSSS",connection);
     //set up commandType
     command.CommandType = CommandType.StoredProcedure;
     //set up parameters
     command.Parameters.AddWithValue("@SalaryRangeFrom", sss.SalaryRangeFrom);
     command.Parameters.AddWithValue("@SalaryRangeTo", sss.SalaryRangeTo);
     command.Parameters.AddWithValue("@SalaryBase", sss.SalaryBase);
     command.Parameters.AddWithValue("@SocialSecurityEmployeeShare", sss.SocialSecurityEmployeeShare);
     command.Parameters.AddWithValue("@SocialSecurityEmployerShare", sss.SocialSecurityEmployerShare);
     command.Parameters.AddWithValue("@SocialSecurityTotal", sss.SocialSecurityTotal);
     command.Parameters.AddWithValue("@EmployerShare", sss.EmployerShare);
     command.Parameters.AddWithValue("@TotalContributionEmployeeShare", sss.TotalContributionEmployeeShare);
     command.Parameters.AddWithValue("@TotalContributionEmployerShare", sss.TotalContributionEmployerShare);
     command.Parameters.AddWithValue("@TotalContribution", sss.TotalContribution);
     command.Parameters.AddWithValue("@TotalContributionForSEVMOFW", sss.TotalContributionForSEVMOFW);
     command.ExecuteNonQuery();
     connection.Close();
 }
Esempio n. 2
0
 public SSS()
 {
     InitializeComponent();
     admin = new Admin();
     sSS   = new SSSS();
 }
        public void EditRow(SSSS sss, int index)
        {
            //get selectedRow from the dataTable, tableCourse
            DataRow selectedRow = dataSet.Tables["SSS"].Rows[index];

            //replace values from course object
            selectedRow["SSSSalaryBracetNo"] = sss.SSSSalaryBracetNo;
            selectedRow["SalaryRangeFrom"] = sss.SalaryRangeFrom;
            selectedRow["SalaryRangeTo"] = sss.SalaryRangeTo;
            selectedRow["SalaryBase"] = sss.SalaryBase;
            selectedRow["SocialSecurityEmployeeShare"] = sss.SocialSecurityEmployeeShare;
            selectedRow["SocialSecurityEmployerShare"] = sss.SocialSecurityEmployerShare;
            selectedRow["SocialSecurityTotal"] = sss.SocialSecurityTotal;
            selectedRow["EmployerShare"] = sss.EmployerShare;
            selectedRow["TotalContributionEmployeeShare"] = sss.TotalContributionEmployeeShare;
            selectedRow["TotalContributionEmployerShare"] = sss.TotalContributionEmployerShare;
            selectedRow["TotalContribution"] = sss.TotalContribution;
            selectedRow["TotalContributionForSEVMOFW"] = sss.TotalContributionForSEVMOFW;
            EditRecord(sss, index);
        }
        public void DeleteRow(SSSS sss, int index)
        {
            //get selectedRow from the dataTable, tableCourse
            DataRow selectedRow = dataSet.Tables["SSS"].Rows[index];

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

            DeleteRecord(sss, index);
        }
 private void EditRecord(SSSS sss, 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 = "sprocedureUpdateSSS";
     dataAdapter.UpdateCommand = command;
     //set up parameters
     command.Parameters.AddWithValue("@SSSSalaryBracetNo", sss.SSSSalaryBracetNo);
     command.Parameters.AddWithValue("@SalaryRangeFrom", sss.SalaryRangeFrom);
     command.Parameters.AddWithValue("@SalaryRangeTo", sss.SalaryRangeTo);
     command.Parameters.AddWithValue("@SalaryBase", sss.SalaryBase);
     command.Parameters.AddWithValue("@SocialSecurityEmployeeShare", sss.SocialSecurityEmployeeShare);
     command.Parameters.AddWithValue("@SocialSecurityEmployerShare", sss.SocialSecurityEmployerShare);
     command.Parameters.AddWithValue("@SocialSecurityTotal", sss.SocialSecurityTotal);
     command.Parameters.AddWithValue("@EmployerShare", sss.EmployerShare);
     command.Parameters.AddWithValue("@TotalContributionEmployeeShare", sss.TotalContributionEmployeeShare);
     command.Parameters.AddWithValue("@TotalContributionEmployerShare", sss.TotalContributionEmployerShare);
     command.Parameters.AddWithValue("@TotalContribution", sss.TotalContribution);
     command.Parameters.AddWithValue("@TotalContributionForSEVMOFW", sss.TotalContributionForSEVMOFW);
     //update tableCourse from the dataSet
     dataAdapter.Update(dataSet, "SSS");
 }
        private void DeleteRecord(SSSS sss, 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 = "sprocedureDeleteSSS";
            dataAdapter.DeleteCommand = command;

            //set up parameters
            command.Parameters.AddWithValue("@SSSSalaryBracetNo", sss.SSSSalaryBracetNo);
            //update tableCourse from the dataSet
            dataAdapter.Update(dataSet, "SSS");
        }
Esempio n. 7
0
 public SSS()
 {
     InitializeComponent();
     admin = new Admin();
     sSS = new SSSS();
 }