private void previewInventoryDetail(string pInventoryId)
 {
     try
     {
         foreach (DataRow _dr in loInventory.getAllData("Stock Adjustment", "", pInventoryId, "").Rows)
         {
             loStockAdjustmentDetailRpt.SetDataSource(GlobalVariables.DTCompanyLogo);
             loStockAdjustmentDetailRpt.Database.Tables[1].SetDataSource(loInventoryDetail.getInventoryDetails("ViewAll", pInventoryId));
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyName", GlobalVariables.CompanyName);
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyAddress", GlobalVariables.CompanyAddress);
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyContactNumber", GlobalVariables.ContactNumber);
             loStockAdjustmentDetailRpt.SetParameterValue("Username", GlobalVariables.Userfullname);
             loStockAdjustmentDetailRpt.SetParameterValue("Title", "Stock Adjustment (" + _dr["Type"].ToString() + ")");
             loStockAdjustmentDetailRpt.SetParameterValue("SubTitle", "Stock Adjustment (" + _dr["Type"].ToString() + ")");
             loStockAdjustmentDetailRpt.SetParameterValue("SAId", _dr["Id"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Date", _dr["Date"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("PreparedBy", _dr["Prepared By"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Supplier", _dr["Supplier"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Customer", _dr["Customer"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Reference", _dr["Reference"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("FinalizedBy", _dr["Finalized By"].ToString());
             loReportViewer.crystalReportViewer.ReportSource = loStockAdjustmentDetailRpt;
             loReportViewer.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 private void previewDetails(string pHeaderId)
 {
     try
     {
         foreach (DataRow _dr in loInventoryHeader.getAllData("", pHeaderId, "", "").Rows)
         {
             DataTable _dt = loInventoryDetail.getAllData(_dr[0].ToString());
             loStockAdjustmentDetailRpt.SetDataSource(GlobalVariables.DTCompanyLogo);
             loStockAdjustmentDetailRpt.Database.Tables[1].SetDataSource(_dt);
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyName", GlobalVariables.CompanyName);
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyAddress", GlobalVariables.CompanyAddress);
             loStockAdjustmentDetailRpt.SetParameterValue("CompanyContactNumber", GlobalVariables.ContactNumber);
             loStockAdjustmentDetailRpt.SetParameterValue("Username", GlobalVariables.Userfullname);
             loStockAdjustmentDetailRpt.SetParameterValue("Title", "Stock Adjustment Slip");
             loStockAdjustmentDetailRpt.SetParameterValue("SubTitle", "Stock Adjustment Slip");
             loStockAdjustmentDetailRpt.SetParameterValue("Id", _dr["Id"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Date", string.Format("{0:MM-dd-yyyy}", DateTime.Parse(_dr["Date"].ToString())));
             foreach (DataRow _dr1 in _dt.Rows)
             {
                 loStockAdjustmentDetailRpt.SetParameterValue("Location", _dr1["Location"].ToString());
             }
             loStockAdjustmentDetailRpt.SetParameterValue("Type", _dr["Type"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Supplier", _dr["Supplier"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Customer", _dr["Customer"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Reference", _dr["Reference"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("AdjustedBy", _dr["Username"].ToString());
             loStockAdjustmentDetailRpt.SetParameterValue("Remarks", _dr["Remarks"].ToString());
             loReportViewer.crystalReportViewer.ReportSource = loStockAdjustmentDetailRpt;
             loReportViewer.ShowDialog();
         }
     }
     catch { }
 }