private void SetReportParameters(SMSPaymentRegistrationDTO smsPaymentDetails, ReportViewer reportViewer)
 {
     string amount = Convert.ToString(smsPaymentDetails.SMSPay_Amount);
     ReportParameter rpSMSPay_Id = new ReportParameter("SMSPay_Id", Convert.ToString(smsPaymentDetails.SMSPay_Id));
     ReportParameter rpSMSPay_Date = new ReportParameter("SMSPay_Date", String.Format("{0:dd/MM/yyyy}",
         Convert.ToString(smsPaymentDetails.SMSPay_Date)));
     ReportParameter rpCustomerCode = new ReportParameter("CustomerCode", smsPaymentDetails.SMSPay_CustCode);
     ReportParameter rpTradeName = new ReportParameter("TradeName", smsPaymentDetails.SMSPay_Cust_TradeName);
     ReportParameter rpCustomerName = new ReportParameter("CustomerName", Convert.ToString(smsPaymentDetails.SMSPay_CustomerName));
     ReportParameter rpDistrictName = new ReportParameter("DistrictName", Convert.ToString(smsPaymentDetails.SMSPay_Cust_District_Name));
     ReportParameter rpAmount = new ReportParameter("Amount", amount);
     CurrencyConvertor currencyConvertor = new CurrencyConvertor();
     string amountInWords = currencyConvertor.Convertor(string.Format("{0:0.00}", amount));
     ReportParameter rpAmountInWords = new ReportParameter("AmountInWords", amountInWords);
     
     reportViewer.LocalReport.SetParameters(new ReportParameter[] {rpSMSPay_Id, 
         rpSMSPay_Date, rpCustomerCode, rpTradeName, rpCustomerName, rpDistrictName,
         rpAmount, rpAmountInWords});
 }
        public SMSPaymentRegistrationDTO GetSMSPaymentDetailsByID(int smsID)
        {


            SMSPaymentRegistrationDTO smsPaymentRegDetails = new SMSPaymentRegistrationDTO();
            smspaymentregistration smsPaymentRegEntity = ESalesUnityContainer.Container.Resolve<IGenericRepository<smspaymentregistration>>()
                                                        .GetSingle(item => item.SMSPay_Id == smsID);

            AutoMapper.Mapper.Map(smsPaymentRegEntity, smsPaymentRegDetails);
            return smsPaymentRegDetails;
        }
        public int SaveAndUpdateSMSPaymentDetails(SMSPaymentRegistrationDTO smsPaymentDetails)
        {
            int smsPay_Id = 0;
            smspaymentregistration smsPaymentegistrationEntity = new smspaymentregistration();
            AutoMapper.Mapper.Map(smsPaymentDetails, smsPaymentegistrationEntity);

            if (smsPaymentDetails.SMSPay_Id == 0)
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<smspaymentregistration>>().Save(smsPaymentegistrationEntity);
            }
            else
            {
                ESalesUnityContainer.Container.Resolve<IGenericRepository<smspaymentregistration>>().Update(smsPaymentegistrationEntity);
            }

            smsPay_Id = smsPaymentegistrationEntity.SMSPay_Id;

            //return the details
            return smsPay_Id;
        }
        public SMSPaymentRegistrationDTO GetSMSPaymentDetails(int smsID, int validDays)
        {
            DateTime previousday = DateTime.Now.AddDays(-validDays);

            SMSPaymentRegistrationDTO smsPaymentRegDetails = new SMSPaymentRegistrationDTO();
            smspaymentregistration smsPaymentRegEntity = ESalesUnityContainer.Container.Resolve<IGenericRepository<smspaymentregistration>>()
                                                        .GetSingle(item => item.SMSPay_Id == smsID && item.SMSPay_Status == false
                                                        && item.SMSPay_Date >= previousday.Date);

            AutoMapper.Mapper.Map(smsPaymentRegEntity, smsPaymentRegDetails);
            return smsPaymentRegDetails;
        }
Example #5
0
 private static SMSPaymentRegistrationDTO InitializeSMSPaymentDetails(int custId, string customerCode, Decimal amount)
 {
     SMSPaymentRegistrationDTO smsPayDetails = new SMSPaymentRegistrationDTO();
     smsPayDetails.SMSPay_CustId = custId;
     smsPayDetails.SMSPay_CustCode = customerCode;
     smsPayDetails.SMSPay_Amount = amount;
     smsPayDetails.SMSPay_Status= false;
     smsPayDetails.SMSPay_CreatedDate = DateTime.Now;
     smsPayDetails.SMSPay_LastUpdatedDate = DateTime.Now;
     smsPayDetails.SMSPay_Date = DateTime.Now.Date;
     return smsPayDetails;
 }