using System; using System.Data; using HRM.DA; namespace HRM.Report { public class rptAssetSerial { public byte[] GetAssetAcknowledgementdata(int serialId, string reportType, int payrollTypeId,int employeeId) { DataRow dRow = null; DataSet assetSerialData = null; DataSet resultDataSet = new DataSet(); DataSet assetSerialFormData = null; assetSerialData = new AssetSerialService().GetFormData(serialId); PayrollDataSet.PayrollDataSet.AssetAcknowledgementDataTable dTassetAcknowledgement = new PayrollDataSet.PayrollDataSet.AssetAcknowledgementDataTable(); foreach (DataRow oDRow in assetSerialData.Tables[0].Rows) { dRow = dTassetAcknowledgement.NewRow(); dRow["Name"] = oDRow["Name"]; dRow["Designation"] = oDRow["Designation"]; dRow["Department"] = oDRow["Department"]; dRow["Address"] = oDRow["Address"]; dRow["NIDPassportNo"] = oDRow["NIDPassportNo"]; dRow["ContactNo"] = oDRow["ContactNo"]; dRow["Email"] = oDRow["Email"]; dRow["BpID"] = oDRow["BpID"]; dRow["JobLocation"] = oDRow["JobLocation"]; dRow["LineManager"] = oDRow["LineManager"]; dTassetAcknowledgement.Rows.Add(dRow); } dTassetAcknowledgement.TableName = "PayrollDataset_AssetAcknowledgement"; resultDataSet.Tables.Add(dTassetAcknowledgement); assetSerialFormData = new AssetSerialService().GetFormSerialData(employeeId); PayrollDataSet.PayrollDataSet.AssetSerialInformationDataTable dTassetSerialInfo = new PayrollDataSet.PayrollDataSet.AssetSerialInformationDataTable(); foreach (DataRow oDRow in assetSerialFormData.Tables[0].Rows) { dRow = dTassetSerialInfo.NewRow(); dRow["BpProductID"] = oDRow["BpProductID"]; dRow["Asset"] = oDRow["Asset"]; double _days = 0; dRow["DurationDays"] = _days.ToString(); dRow["SerialNumber"] = oDRow["SerialNumber"]; dRow["Quantity"] = "1"; dRow["EmployeeName"] = oDRow["Name"]; dRow["AssignDate"] = oDRow["AssignDate"].ToString(); dTassetSerialInfo.Rows.Add(dRow); } dTassetSerialInfo.TableName = "PayrollDataset_AssetSerialInformation"; resultDataSet.Tables.Add(dTassetSerialInfo); string RDLCName = "HRM.Report.RDLC.AssetSerial.rdlc"; ReportProcessor reportProcessor = new ReportProcessor(); return reportProcessor.CommonReportView(null, RDLCName, resultDataSet, null, null, true, payrollTypeId, reportType); } } }