private void SetReportParameters(SettlementOfAccountsDTO settlementOfAcct, ReportViewer reportViewer) { string truckRegNo = string.Empty; decimal grossAmount = settlementOfAcct.Account_Quantity * settlementOfAcct.booking.Booking_MaterialType_HandlingRate; decimal serviceTaxOnAmount = (grossAmount * settlementOfAcct.booking.Booking_MaterialType_ServiceTax) / 100; decimal educationCessOnAmount = (serviceTaxOnAmount * settlementOfAcct.booking.Booking_MaterialType_EducationCess) / 100; decimal higherEducationCessOnAmount = (serviceTaxOnAmount * settlementOfAcct.booking.Booking_MaterialType_HigherEducationCess) / 100; decimal netAmount = grossAmount + serviceTaxOnAmount + educationCessOnAmount + higherEducationCessOnAmount; ReportParameter SNo = new ReportParameter("SNo", settlementOfAcct.booking.Booking_Agent_AgentShortName + "/" + settlementOfAcct.Account_Id); ReportParameter Date = new ReportParameter("Date", Convert.ToDateTime(settlementOfAcct.Account_CreatedDate).ToString()); ReportParameter CustName = new ReportParameter("CustName", settlementOfAcct.booking.Booking_Cust_UnitName); ReportParameter Address = new ReportParameter("Address", settlementOfAcct.booking.Booking_Cust_UnitAddress); ReportParameter District = new ReportParameter("District", settlementOfAcct.booking.Booking_Cust_District_Name); ReportParameter State = new ReportParameter("State", settlementOfAcct.booking.Booking_Cust_State_Name); ReportParameter MatTypeName = new ReportParameter("MatTypeName", settlementOfAcct.booking.Booking_MaterialType_MaterialName); ReportParameter Quantity = new ReportParameter("Quantity", Convert.ToString(settlementOfAcct.Account_Quantity)); ReportParameter Rate = new ReportParameter("Rate", Convert.ToString(settlementOfAcct.booking.Booking_MaterialType_HandlingRate)); ReportParameter Amount = new ReportParameter("Amount", Convert.ToString(String.Format("{0:F2}", grossAmount))); if (settlementOfAcct.booking.Booking_TruckType == true) { truckRegNo = settlementOfAcct.booking.Booking_StandaloneTruck_RegNo; } else { truckRegNo = settlementOfAcct.booking.Booking_Truck_RegNo; } ReportParameter TruckNo = new ReportParameter("TruckNo", truckRegNo); ReportParameter InvoiceNo = new ReportParameter("InvoiceNo", settlementOfAcct.Account_InvoiceNumber); ReportParameter ServiceTax = new ReportParameter("ServiceTax", Convert.ToString(String.Format("{0:F2}", settlementOfAcct.booking.Booking_MaterialType_ServiceTax))); ReportParameter EducationCess = new ReportParameter("EducationCess", Convert.ToString(String.Format("{0:F2}", settlementOfAcct.booking.Booking_MaterialType_EducationCess))); ReportParameter HigherEducationCess = new ReportParameter("HigherEducationCess", Convert.ToString(String.Format("{0:F2}", settlementOfAcct.booking.Booking_MaterialType_HigherEducationCess))); CurrencyConvertor currenyInWords = new CurrencyConvertor(); string amountInWords = currenyInWords.Convertor(Convert.ToString(String.Format("{0:F2}", netAmount))); ReportParameter RupeesInWords = new ReportParameter("RupeesInWords", amountInWords); ReportParameter TotalAmount = new ReportParameter("TotalAmount", Convert.ToString(String.Format("{0:F2}",netAmount))); ReportParameter ServiceTaxAmt = new ReportParameter("ServiceTaxAmt", Convert.ToString(String.Format("{0:F2}", serviceTaxOnAmount))); ReportParameter EducationCessAmt = new ReportParameter("EducationCessAmt", Convert.ToString(String.Format("{0:F2}", educationCessOnAmount))); ReportParameter HigherEducationCessAmt = new ReportParameter("HigherEducationCessAmt", Convert.ToString(String.Format("{0:F2}", higherEducationCessOnAmount))); reportViewer.LocalReport.SetParameters(new ReportParameter[] {SNo, Date, CustName, Address, District, State, MatTypeName, Quantity, Rate, Amount, TruckNo, InvoiceNo, ServiceTax, EducationCess, HigherEducationCess, RupeesInWords, TotalAmount, ServiceTaxAmt, EducationCessAmt, HigherEducationCessAmt}); }
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}); }
protected void Page_Load(object sender, EventArgs e) { CurrencyConvertor currenyInWords = new CurrencyConvertor(); string words=currenyInWords.Convertor(Convert.ToString("2159.41")); //IList<DcaMaterialAllocationDTO> listMaterialAllocations = new List<DcaMaterialAllocationDTO>(); //IList<MaterialTypeDTO> lstMaterialTypeDTO = ESalesUnityContainer.Container.Resolve<IMaterialTypeService>().GetMaterialTypeList(true); //foreach (MaterialTypeDTO Material in lstMaterialTypeDTO) //{ // IList<AgentDTO> lstAgentDTO = ESalesUnityContainer.Container.Resolve<IAgentService>().GetAgentList(); // if (lstAgentDTO.Count > 0) // { // foreach (AgentDTO item in lstAgentDTO) // { // DcaMaterialAllocationDTO DCAMaterialAllocation = new DcaMaterialAllocationDTO(); // DCAMaterialAllocation.DCAMA_Date = System.DateTime.Now.Date.AddDays(0); // DCAMaterialAllocation.DCAMA_Agent_Id = item.Agent_Id; // DCAMaterialAllocation.DCAMA_MaterialType_Id = Material.MaterialType_Id; // IList<AgentMaterialPercentageDTO> lstAgentMaterialPercentageDTO = ESalesUnityContainer.Container // .Resolve<IAgentMaterialPercentageService>().GetAgentMaterialPercentByAgentId(item.Agent_Id); // IList<DcaMaterialAllocationDTO> listMaterial = ESalesUnityContainer.Container.Resolve<IDcaMaterialAllocationService>() // .GetMaterialAllocationDetails(Material.MaterialType_Id, DateTime.Now.Date.AddDays(-1)); // DCAMaterialAllocation.DCAMA_TodayPercentage = (from F in lstAgentMaterialPercentageDTO // where F.AMP_MaterialType_Id == Material.MaterialType_Id // select F.AMP_Percentage).FirstOrDefault() // + // (from F in listMaterial // where F.DCAMA_Agent_Id == item.Agent_Id // select F.DCAMA_CurrentVariance).FirstOrDefault() // ; // listMaterialAllocations.Add(DCAMaterialAllocation); // } // } //} //ESalesUnityContainer.Container.Resolve<IDcaMaterialAllocationService>() // .SaveAndUpdateDCAMaterialDetails(listMaterialAllocations); }
protected void btnValidateAmount_Click(object sender, EventArgs e) { CurrencyConvertor currencyConvertor = new CurrencyConvertor(); //IndianCurrencyCovnertor currencyConvertor = new IndianCurrencyCovnertor(); string amountInWords = currencyConvertor.Convertor(string.Format("{0:0.00}", Convert.ToDecimal(txtAmount.Text.Trim()))); string message = string.Concat(amountInWords, "<br/><br/>Do you want to continue"); ucYesNoMessageBox.ShowMessage(message); }
protected void btnValidateAmount_Click(object sender, EventArgs e) { if (Convert.ToDecimal(txtAmount.Text.Trim()) <= Convert.ToDecimal(ViewState[Globals.StateMgmtVariables.SELECTEDAMOUNT])) { CurrencyConvertor currencyConvertor = new CurrencyConvertor(); string amountInWords = currencyConvertor.Convertor(string.Format("{0:0.00}", Convert.ToDecimal(txtAmount.Text.Trim()))); string message = string.Concat(amountInWords, "<br/><br/>Do you want to continue"); ucYesNoMessageBox.ShowMessage(message); } else { ucMessageBoxForGrid.ShowMessage("Refund amount cannot be greater than balance amount"); } }
/// <summary> /// Set Report Parameters by bookingDetails and reportViewer /// </summary> /// <param name="bookingDetails"></param> /// <param name="reportViewer"></param> private void SetReportParameters(BookingDTO bookingDetails, ReportViewer reportViewer) { string truckRegNo = string.Empty; string truckOwnerName = string.Empty; string truckDriverName = string.Empty; string truckOwnerShortAdd = string.Empty; string truckDriverShortAdd = string.Empty; BarcodeDTO b = new BarcodeDTO(); SMSRegistrationDTO smsDetail = new SMSRegistrationDTO(); smsDetail = ESalesUnityContainer.Container.Resolve<ISMSService>().GetSmsDetailsByBookingId(bookingDetails.Booking_Id); ReportParameter loadingAdviceFor = new ReportParameter("LoadingAdviceFor", bookingDetails.Booking_MaterialType_MaterialName); ReportParameter loadingAdviceNo = new ReportParameter("LoadingAdviceNo", bookingDetails.Booking_Agent_AgentShortName + "-" + bookingDetails.Booking_Id); ReportParameter sNO = new ReportParameter("SNo", Convert.ToString(bookingDetails.Booking_Id)); ReportParameter bookingDate = new ReportParameter("BookingDate", Convert.ToDateTime(bookingDetails.Booking_Date).ToString("dd/MMM/yyyy")); ReportParameter matTypeName = new ReportParameter("MatTypeName", bookingDetails.Booking_MaterialType_MaterialName); ReportParameter matCode = new ReportParameter("MatCode", bookingDetails.Booking_MaterialType_Code); ReportParameter custCode = new ReportParameter("CustCode", bookingDetails.Booking_Cust_Code); ReportParameter smsId1 = new ReportParameter("SMSId1", Convert.ToString(smsDetail.SMSReg_Id)); ReportParameter smsId2 = new ReportParameter("SMSId2", Convert.ToString(smsDetail.SMSReg_Id)); if (bookingDetails.Booking_TruckType == true) { truckRegNo = bookingDetails.Booking_StandaloneTruck_RegNo; truckOwnerName = bookingDetails.Booking_StandaloneTruck_OwnerName + ',' + bookingDetails.Booking_StandaloneTruck_OwnerShortAdd; truckDriverName = bookingDetails.Booking_StandaloneTruck_DriverName + ',' + bookingDetails.Booking_StandaloneTruck_DriverShortAdd; } else { truckRegNo = bookingDetails.Booking_Truck_RegNo; truckOwnerName = bookingDetails.Booking_Truck_OwnerName + ',' + bookingDetails.Booking_Truck_OwnerShortAdd; truckDriverName = bookingDetails.Booking_Truck_DriverName + ',' + bookingDetails.Booking_Truck_DriverShortAdd; } ReportParameter truckNo = new ReportParameter("TruckNo", truckRegNo); ReportParameter truckOwner = new ReportParameter("TruckOwner", truckOwnerName); ReportParameter truckDriver = new ReportParameter("TruckDriver", truckDriverName); ReportParameter custName = new ReportParameter("CustName", bookingDetails.Booking_Cust_UnitName); ReportParameter address = new ReportParameter("Address", bookingDetails.Booking_Cust_UnitAddress); ReportParameter district = new ReportParameter("District", bookingDetails.Booking_Cust_District_Name); ReportParameter state = new ReportParameter("State", bookingDetails.Booking_Cust_State_Name); ReportParameter approxQty = new ReportParameter("AppQty", Convert.ToString(bookingDetails.Booking_Qty) + " M"); CurrencyConvertor currencyConvertor = new CurrencyConvertor(); MoneyReceiptDTO moneyReceiptDetails = MasterList.GetMoneyReceiptById(0, bookingDetails.Booking_Id); ReportParameter advanceAmount = new ReportParameter("AdvanceAmount", Convert.ToString(moneyReceiptDetails.MoneyReceipt_AmountPaid)); ReportParameter amountInWords = new ReportParameter("AmountInWords", currencyConvertor.Convertor(moneyReceiptDetails.MoneyReceipt_AmountPaid.ToString())); ReportParameter moneyReceiptDate = new ReportParameter("MoneyReceiptDate", Convert.ToDateTime(moneyReceiptDetails.MoneyReceipt_CreateDate).ToString("dd/MMM/yyyy")); ReportParameter moneyReceiptSNo = new ReportParameter("MoneyReceiptSNo", Convert.ToString(moneyReceiptDetails.MoneyReceipt_Id)); GenerateBarcode(bookingDetails.Booking_Id.ToString(), ref b); List<BarcodeDTO> barcodes = new List<BarcodeDTO>(); barcodes.Add(b); reportViewer.LocalReport.DataSources.Clear(); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", barcodes)); reportViewer.LocalReport.SetParameters(new ReportParameter[] { loadingAdviceFor, loadingAdviceNo, sNO, bookingDate, matTypeName, matCode, custCode, truckNo, truckOwner, truckDriver, custName, address, district, state, approxQty, advanceAmount, amountInWords, moneyReceiptSNo, moneyReceiptDate, smsId1, smsId2}); }
private void SetReportParameters(PaymentCollectionDTO paymentCollectionDetails, ReportViewer reportViewer, bool isRePrint) { string amount = Convert.ToString(paymentCollectionDetails.PC_Amount); ReportParameter rpReceiptNo = new ReportParameter("ReceiptNo", Convert.ToString(paymentCollectionDetails.PC_Id)); ReportParameter rpReceiptDate = new ReportParameter("ReceiptDate", String.Format("{0:dd/MM/yyyy}", Convert.ToString(paymentCollectionDetails.PC_ReceiptDate))); ReportParameter rpCustomerCode = new ReportParameter("CustomerCode", paymentCollectionDetails.CustomerCode); ReportParameter rpTradeName = new ReportParameter("TradeName", paymentCollectionDetails.CustomerTradeName); ReportParameter rpCustomerName = new ReportParameter("CustomerName", Convert.ToString(paymentCollectionDetails.CustomerName)); ReportParameter rpDistrictName = new ReportParameter("DistrictName", Convert.ToString(paymentCollectionDetails.CustomerDistrict)); 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); ReportParameter rpInstrumentType = new ReportParameter("InstrumentType", Convert.ToString(paymentCollectionDetails.PaymentModeName)); ReportParameter rpInstrumentNumber = new ReportParameter("InstrumentNumber", Convert.ToString(paymentCollectionDetails.PC_InstrumentNo)); ReportParameter rpInstrumentDate = new ReportParameter("InstrumentDate", Convert.ToDateTime(paymentCollectionDetails.PC_InstrumentDate).ToString("dd/MMM/yyyy")); ReportParameter rpBankDrawn = new ReportParameter("BankDrawn", Convert.ToString(ESalesUnityContainer.Container.Resolve<IMasterService>().GetBanksDetailsById(Convert.ToInt32(paymentCollectionDetails.PC_BankDrawn)).Bank_Name)); ReportParameter rpBankBranch = new ReportParameter("BranchName", Convert.ToString(paymentCollectionDetails.PC_BankBranch)); ReportParameter rpPayer = new ReportParameter("Payer", Convert.ToString(paymentCollectionDetails.PC_PayerName)); ReportParameter rpPayerMobileNumber = new ReportParameter("PayerMobileNumber", Convert.ToString(paymentCollectionDetails.PC_MobileNumber)); ReportParameter rpPrintNumber = new ReportParameter("PrintNumber", Convert.ToString(GetPrintName(isRePrint == true ? (paymentCollectionDetails.PC_ReprintCount + 1) : paymentCollectionDetails.PC_ReprintCount))); reportViewer.LocalReport.SetParameters(new ReportParameter[] {rpReceiptNo, rpReceiptDate, rpCustomerCode, rpTradeName, rpCustomerName, rpDistrictName, rpAmount, rpAmountInWords, rpInstrumentType, rpInstrumentNumber, rpInstrumentDate, rpBankDrawn, rpBankBranch, rpPayer, rpPayerMobileNumber,rpPrintNumber}); }