예제 #1
0
 public RecievePay(PaymentOrder payment)
 {
     using (VistaDBConnection connection = new VistaDBConnection(new Connection().ConnectionString))
     {
         try
         {
             connection.Open();
             using (VistaDBCommand command = new VistaDBCommand())
             {
                 command.Connection  = connection;
                 command.CommandText = $"UPDATE dbo.PaymentOrder SET Status = 'Recieved',RecievedBy ={LoginUser.UserId},RecievedDate = GETDATE() WHERE Id = {payment.Id}";
                 command.ExecuteNonQuery();
                 connection.Close();
                 MessageBox.Show(@"successfully Recieved");
             }
         }
         catch (VistaDBException exception)
         {
             Log.Error(exception);
         }
     }
 }
예제 #2
0
 public void Save(PaymentOrder paymentOrder)
 {
     using (VistaDBConnection connection = new VistaDBConnection(new Connection().ConnectionString))
     {
         try
         {
             connection.Open();
             using (VistaDBCommand command = new VistaDBCommand())
             {
                 command.Connection  = connection;
                 command.CommandText = $"INSERT INTO dbo.PaymentOrder(PoNumber,Beneficiary,Payee,Phone,Amount,Interest,SchoolId,UserId)VALUES('{paymentOrder.PoNumber}','{paymentOrder.Beneficiary}','{paymentOrder.Payee}','{paymentOrder.Phone}',{paymentOrder.Amount},{paymentOrder.Interest},{SchoolId},{UserId})";
                 command.ExecuteNonQuery();
                 connection.Close();
                 MessageBox.Show(@"successfully Saved Payment");
             }
         }
         catch (VistaDBException exception)
         {
             MessageBox.Show("Something went wrong");
             Log.Error(exception);
         }
     }
 }
예제 #3
0
 public void Payment(PaymentOrder payment, School school, User user)
 {
     using (VistaDBConnection connection = Connection.Connexion)
     {
         try
         {
             connection.Open();
             using (VistaDBCommand command = new VistaDBCommand())
             {
                 command.Connection  = connection;
                 command.CommandText = $"INSERT INTO dbo.PaymentOrder(PoNumber,Beneficiary,Payee,Phone,Amount,Interest,SchoolId,UserId)VALUES('{payment.PoNumber}','{payment.Beneficiary}','{payment.Payee}','{payment.Phone}',{payment.Amount},{payment.Interest},{school.Id},{user.Id},)";
                 command.ExecuteNonQuery();
                 connection.Close();
                 MessageBox.Show($"Successfully added Payment for {school.SchoolName}");
             }
         }
         catch (VistaDBException exception)
         {
             MessageBox.Show("Something went wrong");
             Log.Error(exception);
         }
     }
 }