Пример #1
0
 public bool CreateNewSalaryPaymentFrequency(SalaryPaymentFrequency paymentFrequency,List<SalaryPaymentFrequencyDetail> paymentFrequencyDetail)
 {
     string QUERY = @"INSERT INTO [dbo].[BSalaryPaymentFrequency]
                    ([RefId],[Status]
                    ,[OpenAccounId]
                    ,[CustomerId]
                    ,[CustomerName]
                    ,[Currency]
                    ,[TotalDebitAmt]
                    ,[Fequency]
                    ,[Term]
                    ,[EndDate]
                    ,[OrderingCust]
                    ,[NonFrequency]
                    ,[CreatedBy]
                    ,[CreatedDate])
              VALUES(@RefId,@Status,@OpenAccounId,@CustomerId,@CustomerName,@Currency,@TotalDebitAmt
                     ,@Fequency,@Term,@EndDate,@OrderingCust,@NonFrequency,@CreatedBy, getdate())";
     UpdateSalaryPaymentFrequencyDetail(paymentFrequencyDetail, paymentFrequency.RefId);
     using (var conn = new SqlConnection(DataProvider.ConnectionString))
     {
         paymentFrequency.Status = AuthoriseStatus.UNA.ToString();
         return conn.Execute(QUERY, paymentFrequency) > 0;
     }
 }
 private bool CommitPaymentFrequency()
 {
     var paymentFrequency = new SalaryPaymentFrequency();
     BuildPaymentFrequency(paymentFrequency);
     if (SavingAccountDAO.CheckSalaryPaymentFrequencyExist(paymentFrequency.RefId))
     {
         paymentFrequency.UpdatedBy = this.UserInfo.Username;
         return SavingAccountDAO.UpdateSalaryPaymentFrequency(paymentFrequency, BuildListDetail());
     }
     else
     {
         paymentFrequency.CreatedBy = this.UserInfo.Username;
         return SavingAccountDAO.CreateNewSalaryPaymentFrequency(paymentFrequency, BuildListDetail());
     }
 }
Пример #3
0
 public bool UpdateSalaryPaymentFrequency(SalaryPaymentFrequency paymentFrequency, List<SalaryPaymentFrequencyDetail> paymentFrequencyDetail)
 {
     string QUERY = @"UPDATE [dbo].[BSalaryPaymentFrequency]
                    SET [Status] =@Status
                       ,[NonFrequency] = @NonFrequency
                       ,[OpenAccounId] = @OpenAccounId
                       ,[CustomerId] = @CustomerId
                       ,[CustomerName] = @CustomerName
                       ,[Currency] = @Currency
                       ,[TotalDebitAmt] = @TotalDebitAmt
                       ,[Fequency] = @Fequency
                       ,[Term] = @Term
                       ,[EndDate] = @EndDate
                       ,[OrderingCust] = @OrderingCust
                       ,[UpdatedBy] = @UpdatedBy
                       ,[UpdatedDate] = getdate()
                  WHERE [RefId] = @RefId";
     UpdateSalaryPaymentFrequencyDetail(paymentFrequencyDetail, paymentFrequency.RefId);
     using (var conn = new SqlConnection(DataProvider.ConnectionString))
     {
         paymentFrequency.Status = AuthoriseStatus.UNA.ToString();
         return conn.Execute(QUERY, paymentFrequency) > 0;
     }
 }
 private void BuildPaymentFrequency(SalaryPaymentFrequency paymentFrequency)
 {
     var accountPayment = rcbAccountPayment.SelectedItem;
     paymentFrequency.RefId = tbDepositCode.Text;
     paymentFrequency.OpenAccounId = accountPayment.Value;
     paymentFrequency.CustomerId = accountPayment.Attributes["CustomerId"];
     paymentFrequency.CustomerName = accountPayment.Attributes["CustomerName"];
     paymentFrequency.Currency = lblCurrency.Text;
     paymentFrequency.TotalDebitAmt = (decimal?)tbTotalDebitAmtShow.Value;
     if (NonFrequency != "YES")
     {
         paymentFrequency.Fequency = rdpFrequency.SelectedDate;
         paymentFrequency.Term = rcbTerm.SelectedValue;
     }
     paymentFrequency.EndDate = rdpEndDate.SelectedDate;
     paymentFrequency.OrderingCust = tbOrderingCust.Text;
     paymentFrequency.NonFrequency = NonFrequency;
 }