Exemplo n.º 1
0
        //Update Recode
        void iIncome.UpdateIncomeRecode(cIncome Income)
        {
            if (Income.IncomeID > 0)
            {
                SqlCommand cmd = new SqlCommand("UPDATE incomePayment SET incomeUnitName = @IUName, incomeType = @IncomeType, incomeAmount = @IncomeAmount, incomeDate = @IncomeDate, incomeDescription = @IncomeDescription WHERE incomeID = @IID", con);
                cmd.CommandType = CommandType.Text;

                cmd.Parameters.AddWithValue("@IUName", Income.incomeUnitName);
                cmd.Parameters.AddWithValue("@IncomeType", Income.incomeType);
                cmd.Parameters.AddWithValue("@IncomeAmount", Income.incomeAmount);
                cmd.Parameters.AddWithValue("@IncomeDate", Income.incomeDate);
                cmd.Parameters.AddWithValue("@IncomeDescription", Income.incomeDescription);
                cmd.Parameters.AddWithValue("@IID", Income.IncomeID);

                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();

                InUC.Hide();
                SuccessfullMessageBox.ShowDialog("A New Expenses Recode is Update  Successfully", "Successfully Inserted");
                InUC.Show();
            }

            else
            {
                // InUC.Hide();
                ErrorDialogBox.ShowDialog("Please Select a Expenses Recode to Update", "Error");
                // InUC.Show();
            }
        }
Exemplo n.º 2
0
        private void btnIncomeInsert_Click(object sender, EventArgs e)
        {
            if (IsEmpty() && IsValid())
            {
                cIncome cIn = new cIncome(dropIncomeUnitName.Text, dropIncomeType.Text, txtIncomeAmount.Text, txtIncomeDate.Text, txtIncomeDescription.Text);

                iIncome iIn = new IncomeImpl();

                iIn.InsertIncomeRecode(cIn);
                ReadRecode();
                ResetIncomeRecode();
            }
        }
Exemplo n.º 3
0
        //Insert Recode
        void iIncome.InsertIncomeRecode(cIncome Income)
        {
            SqlCommand cmd = new SqlCommand("INSERT INTO incomePayment VALUES (@IUName, @IncomeType, @IncomeAmount, @IncomeDate, @IncomeDescription)", con);

            cmd.CommandType = CommandType.Text;

            cmd.Parameters.AddWithValue("@IUName", Income.incomeUnitName);
            cmd.Parameters.AddWithValue("@IncomeType", Income.incomeType);
            cmd.Parameters.AddWithValue("@IncomeAmount", Income.incomeAmount);
            cmd.Parameters.AddWithValue("@IncomeDate", Income.incomeDate);
            cmd.Parameters.AddWithValue("@IncomeDescription", Income.incomeDescription);

            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();

            InUC.Hide();
            SuccessfullMessageBox.ShowDialog("A New Expenses Recode is Insert Successfully", "Successfully Inserted");
            InUC.Show();
        }
Exemplo n.º 4
0
        //Delete Recode
        void iIncome.DeleteIncomeRecode(cIncome Income)
        {
            if (Income.IncomeID > 0)
            {
                SqlCommand cmd = new SqlCommand("DELETE FROM incomePayment WHERE incomeID = @IID", con);
                cmd.CommandType = CommandType.Text;

                cmd.Parameters.AddWithValue("@IID", Income.IncomeID);

                con.Open();
                cmd.ExecuteNonQuery();
                con.Close();

                InUC.Hide();
                SuccessfullMessageBox.ShowDialog("Expenses Recode is Delete Successfully", "Successfully Deleted");
                InUC.Show();
            }
            else
            {
                InUC.Hide();
                ErrorDialogBox.ShowDialog("Please Select a Expenses Recode to Delete", "Error");
                InUC.Show();
            }
        }