Пример #1
0
 /// <summary>
 /// Print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click_1(object sender, EventArgs e)
 {
     try
     {
         PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();
         if (dgvPhysicalStockReport.RowCount > 0)
         {
             DataSet   ds                      = new DataSet();
             CompanySP spCompany               = new CompanySP();
             frmReport reportobj               = new frmReport();
             DataTable dtblCompany             = spCompany.CompanyViewDataTable(1);
             DataTable dtblPhysicalStockReport = spPhysicalStockMaster.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue));
             ds.Tables.Add(dtblCompany);
             ds.Tables.Add(dtblPhysicalStockReport);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PhysicalStockReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PSRT:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        public List <DataTable> PhysicalStockReportFill(DateTime dtDateFrom, DateTime dtDateTo, string strVoucherNo, string strProductName, decimal decProductCode, decimal decVoucherTypeId)
        {
            List <DataTable> ListObj = new List <DataTable>();

            try
            {
                ListObj = spPhysicalStockMaster.PhysicalStockReportFill(dtDateFrom, dtDateTo, strVoucherNo, strProductName, decProductCode, decVoucherTypeId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PS11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(ListObj);
        }
Пример #3
0
        /// <summary>
        /// Function to fill the grid based on the search condition
        /// </summary>
        public void gridfill()
        {
            try
            {
                PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();


                DataTable dtbl = new DataTable();
                dtbl = spPhysicalStockMaster.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue));
                dgvPhysicalStockReport.DataSource = dtbl;
                if (dgvPhysicalStockReport.Columns.Count > 0)
                {
                    dgvPhysicalStockReport.Columns["dgvtxtpurchaseRate"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                    dgvPhysicalStockReport.Columns["dgvtxtsalesRate"].DefaultCellStyle.Alignment    = DataGridViewContentAlignment.MiddleRight;
                    dgvPhysicalStockReport.Columns["dgvtxtmrp"].DefaultCellStyle.Alignment          = DataGridViewContentAlignment.MiddleRight;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PSRT1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }