void PopualteData() { string TM02_PARTYID = ""; int iTM02_PARTYID = 0; if (!string.IsNullOrEmpty(cmbName.Text.Trim())) int.TryParse(cmbName.SelectedValue.ToString(), out iTM02_PARTYID); if (iTM02_PARTYID > 0) TM02_PARTYID = iTM02_PARTYID.ToString(); DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_STOCK_IN_REPORT '" + TM02_PARTYID + "','" + dtpFromDate.Value.ToString("yyyy-MM-dd") + "','" + dtpTodate.Value.ToString("yyyy-MM-dd") + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptStockInListing.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Stock In Listing Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PrintData() { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["T010_PACKINGSLIPID"].Value.ToString(), out ID); DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_PRINT_PACKING_SLIP_ONID '" + ID + "'"); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptPackingSlip.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Packing Slip Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PopualteData() { string sType = ""; if (!string.IsNullOrEmpty(cmbType.Text.Trim())) { sType = Convert.ToString(cmbType.Text.Trim()); } DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_ACCOUNT '','" + txtName.Text.Trim() + "','','" + sType + "' ,'" + txtCity.Text.Trim() + "','" + txtMobileNo.Text.Trim() + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptAccount.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Account Listing Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
private void btnPackingSlip_Click(object sender, EventArgs e) { if (dgDisplayData.SelectedRows.Count > 0) { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["T012_CHALLENID"].Value.ToString(), out ID); DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_PRINT_CHALLEN_BILL '" + ID + "'"); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptPackingSlipsOnInvoice.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Packing Slip"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } } }
void PrintData() { if (dgDisplayData.SelectedRows.Count > 0) { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["T012_CHALLENID"].Value.ToString(), out ID); Datalayer.iPrintableChallenId = ID; DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_PRINT_CHALLEN_BILL '" + Datalayer.iPrintableChallenId + "'"); if (dt.Rows.Count > 0) { dt.Rows[0]["BILLTYPE"] = "Orignal"; ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptChallen.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Challen Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } //frmPrintBill fmPrnt = new frmPrintBill(); //fmPrnt.Show(); } }
void PopualteData() { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_STOCK_REPORT '" + dtpFromDate.Value.ToString("yyyy-MM-dd") + "','" + dtpTodate.Value.ToString("yyyy-MM-dd") + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { DataView db = dt.DefaultView; db.Sort = "T007_DATE ASC"; DataTable sort = db.ToTable(); ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptStockReportListing.rpt"); RptDoc.SetDataSource(sort); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "GST Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PopualteData() { int iPartyID = 0, TM02_MAIN_PRODUCTSIZEID = 0; string sPartyID = "", sTM02_MAIN_PRODUCTSIZEID = ""; if (!string.IsNullOrEmpty(cmbName.Text.Trim())) { int.TryParse(cmbName.SelectedValue.ToString(), out iPartyID); } //if (!string.IsNullOrEmpty(cmbMainItemSize.Text.Trim())) // int.TryParse(cmbMainItemSize.SelectedValue.ToString(), out TM02_MAIN_PRODUCTSIZEID); if (iPartyID > 0) { sPartyID = iPartyID.ToString(); } if (TM02_MAIN_PRODUCTSIZEID > 0) { sTM02_MAIN_PRODUCTSIZEID = TM02_MAIN_PRODUCTSIZEID.ToString(); } DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_STOCK '" + sPartyID + "','" + sTM02_MAIN_PRODUCTSIZEID + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptStock.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Stock Listing Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
private void productListingToolStripMenuItem_Click(object sender, EventArgs e) { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_RPT_GETPRODUCT '" + Datalayer.iT001_COMPANYID.ToString() + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptProduct.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Product Listing Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PopualteData() { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_RP_PRODUCTION_REPORT_WITH_GROUP '','" + dtpFromDate.Value.ToString("yyyy-MM-dd") + "','" + dtpTodate.Value.ToString("yyyy-MM-dd") + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptProduction.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Production Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PrintData() { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["T007_SALEID"].Value.ToString(), out ID); DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_PRINT_SALE_BILL '" + ID + "'"); if (dt.Rows.Count > 0) { //DataTable dtQTY = new DataTable(); //dtQTY = dl.SelectMethod("SELECT TM01_HSNCODE,SUM(T008_QTY)AS QTY FROM T008_SALEITEM T008 INNER JOIN TM01_PRODUCT TM01 ON TM01.TM01_PRODUCTID = T008.TM01_PRODUCTID WHERE T007_SALEID=" + Datalayer.iPrintableBillId + " GROUP BY TM01.TM01_HSNCODE "); //if (dtQTY.Rows.Count > 0) //{ // for (int i = 0; i < dt.Rows.Count; i++) // { // if (dtQTY.Rows.Count == 1) // { // dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); // dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); // } // if (dtQTY.Rows.Count == 2) // { // dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); // dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); // dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[1][0].ToString(); // dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[1][1].ToString(); // } // if (dtQTY.Rows.Count == 3) // { // dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); // dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); // dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[1][0].ToString(); // dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[1][1].ToString(); // dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[2][0].ToString(); // dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[2][1].ToString(); // } // } //} ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptInvoice.rpt"); //RptDoc.Load(Application.StartupPath + @"\Report\rptInvoice.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Invoice Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void PrintReport(int no) { if (Datalayer.iPrintableBillId > 0) { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_PRINT_SALE_BILL '" + Datalayer.iPrintableBillId + "'"); if (dt.Rows.Count > 0) { DataTable dtQTY = new DataTable(); dtQTY = dl.SelectMethod("SELECT TM01_HSNCODE,SUM(T008_QTY)AS QTY FROM T008_SALEITEM T008 INNER JOIN TM01_PRODUCT TM01 ON TM01.TM01_PRODUCTID = T008.TM01_PRODUCTID WHERE T007_SALEID=" + Datalayer.iPrintableBillId + " GROUP BY TM01.TM01_HSNCODE "); if (dtQTY.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dtQTY.Rows.Count == 1) { dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); } if (dtQTY.Rows.Count == 2) { dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[1][0].ToString(); dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[1][1].ToString(); } if (dtQTY.Rows.Count == 3) { dt.Rows[i]["HSNCODE1"] = dtQTY.Rows[0][0].ToString(); dt.Rows[i]["HSNCODEQTY1"] = dtQTY.Rows[0][1].ToString(); dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[1][0].ToString(); dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[1][1].ToString(); dt.Rows[i]["HSNCODE2"] = dtQTY.Rows[2][0].ToString(); dt.Rows[i]["HSNCODEQTY2"] = dtQTY.Rows[2][1].ToString(); } } } if (no == 1) { dt.Rows[0]["BILLTYPE"] = "ORIGNAL"; } else if (no == 2) { dt.Rows[0]["BILLTYPE"] = "DUPLICATE"; } else if (no == 3) { dt.Rows[0]["BILLTYPE"] = "TRIPLICATE"; } ReportDocument RptDoc = new ReportDocument(); if (dt.Rows[0]["TM_STATEID"].ToString() != "24") { RptDoc.Load(Application.StartupPath + @"\Report\rptOutGujInvoice.rpt"); } else { RptDoc.Load(Application.StartupPath + @"\Report\rptGujInvoice.rpt"); } //RptDoc.Load(Application.StartupPath + @"\Report\rptInvoice.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Tax Invoice Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } } if (Datalayer.iPrintableChallenId > 0) { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_PRINT_CHALLEN_BILL '" + Datalayer.iPrintableChallenId + "'"); if (dt.Rows.Count > 0) { if (no == 1) { dt.Rows[0]["BILLTYPE"] = "Orignal"; } else if (no == 2) { dt.Rows[0]["BILLTYPE"] = "Duplicate"; } else if (no == 3) { dt.Rows[0]["BILLTYPE"] = "Triplicate"; } ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptChallen.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Challen Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } } }
void PopualteData() { string TM02_PARTYID = ""; int iTM02_PARTYID = 0; if (!string.IsNullOrEmpty(cmbName.Text.Trim())) { int.TryParse(cmbName.SelectedValue.ToString(), out iTM02_PARTYID); } if (iTM02_PARTYID > 0) { TM02_PARTYID = iTM02_PARTYID.ToString(); } DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_PARTY_STATEMENT '" + TM02_PARTYID + "','" + dtpFromDate.Value.ToString("yyyy-MM-dd") + "','" + dtpTodate.Value.ToString("yyyy-MM-dd") + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { var orderedRows = from row in dt.AsEnumerable() orderby row.Field <DateTime?>("Invoice_Date") select row; DataTable tblOrdered = orderedRows.CopyToDataTable(); decimal dBal = 0; decimal dTotalSale = 0, dTotalPayment = 0; for (int i = 0; i < tblOrdered.Rows.Count; i++) { decimal dSale_Amount = 0, Recive_Amount = 0; decimal.TryParse(tblOrdered.Rows[i]["Sale_Amount"].ToString(), out dSale_Amount); decimal.TryParse(tblOrdered.Rows[i]["Recive_Amount"].ToString(), out Recive_Amount); dSale_Amount = Math.Abs(dSale_Amount); dTotalSale = dTotalSale + Math.Abs(dSale_Amount); dTotalPayment = dTotalPayment + Math.Abs(Recive_Amount); dBal = dBal + dSale_Amount; dBal = dBal - Recive_Amount; //if (dSale_Amount > 0) //{ // if (dBal > 0) // dBal = dBal + dSale_Amount; // else // dBal = dBal - dSale_Amount; //} //else //{ // if (dBal > 0) // dBal = dBal - dSale_Amount; // else // dBal = dBal + dSale_Amount; //} //if (Recive_Amount > 0) //{ // if (dBal > 0) // dBal = dBal - Recive_Amount; // else // dBal = dBal + Recive_Amount; //} //if (dBal > 0) //{ // dBal = dBal + dSale_Amount; // dBal = dBal - Recive_Amount; //} //else //{ // dBal = dBal + dSale_Amount; // dBal = dBal - Recive_Amount; // dBal = (dBal * -1); //} tblOrdered.Rows[i]["FromDate"] = dtpFromDate.Value.ToString("dd-MM-yyyy"); tblOrdered.Rows[i]["ToDate"] = dtpTodate.Value.ToString("dd-MM-yyyy"); if (i == 0) { tblOrdered.Rows[i]["Sale_Amount"] = 0; } else { tblOrdered.Rows[i]["Sale_Amount"] = System.Math.Abs(dSale_Amount); } tblOrdered.Rows[i]["Balance"] = decimal.Round(dBal, 2); //tblOrdered.Rows[0]["T001_NAME"] = tblOrdered.Rows[1]["T001_NAME"].ToString(); } tblOrdered.Rows[dt.Rows.Count - 1]["TOTALSALE"] = dTotalSale; tblOrdered.Rows[dt.Rows.Count - 1]["TOTALPAYMENT"] = dTotalPayment; ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptPartyStatement.rpt"); RptDoc.SetDataSource(tblOrdered); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Account Statement Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void AddUpdatePackingSlip() { try { ep1.Clear(); if (string.IsNullOrEmpty(cmbName.Text.Trim())) { ep1.SetError(cmbName, "This field is required."); cmbName.Focus(); return; } if (dgDisplayData.Rows.Count == 0) { Datalayer.InformationMessageBox("Record is required.."); } int T010_PACKINGSLIPID = Datalayer.T010_PACKINGSLIPID; // int TM01_CUSTOMERID = 0; string T010_NO = "", T010_TRANSPORT = "", T010_LRNO = ""; int T001_ACCOUNTID = 0; DateTime T003_DATE = dtpDate.Value; // int.TryParse(cmbCustomerName.SelectedValue.ToString(), out TM01_CUSTOMERID); T010_NO = txtBillNo.Text.Trim(); T010_TRANSPORT = txtTransport.Text.Trim(); T010_LRNO = txtLRNo.Text.Trim(); int.TryParse(cmbName.SelectedValue.ToString(), out T001_ACCOUNTID); if (T010_PACKINGSLIPID > 0) { int?iDeletePurchaseItem_out = 0; MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); MyDa.USP_VP_DELETE_ALL_PACKINGSLIPORDER(T010_PACKINGSLIPID, ref iDeletePurchaseItem_out); } int?T010_PACKINGSLIPID_out = 0; Cursor.Current = Cursors.WaitCursor; MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); MyDa.USP_VP_ADDUPDATE_PACKING_SLIP(T010_PACKINGSLIPID, T001_ACCOUNTID, T010_NO, T003_DATE, T010_TRANSPORT, T010_LRNO, Datalayer.iT001_COMPANYID, ref T010_PACKINGSLIPID_out); if (T010_PACKINGSLIPID_out > 0) { T010_PACKINGSLIPID = int.Parse(T010_PACKINGSLIPID_out.Value.ToString()); int? @T011_PACKINGSLIPORDERID_OUT = 0; for (int i = 0; i < dgDisplayData.Rows.Count; i++) { if (!string.IsNullOrEmpty(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_ORDERID"].Value))) { int T004_ORDERID = 0, T011_QTY = 0; int.TryParse(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_ORDERID"].Value), out T004_ORDERID); int.TryParse(Convert.ToString(dgDisplayData.Rows[i].Cells["T004_PENDING_QTY"].Value), out T011_QTY); if (T011_QTY > 0) { int?T002_PURCHASEITEMID_Out = 0; MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); MyDa.USP_VP_ADDUPDATE_PACKINGSLIPORDER(0, T010_PACKINGSLIPID, T004_ORDERID, T011_QTY, Datalayer.iT001_COMPANYID, ref T002_PURCHASEITEMID_Out); } } } if (Datalayer.T010_PACKINGSLIPID == 0) { Datalayer.InsertMessageBox(sPageName); ResteData(); if (Datalayer.ShowQuestMsg("are you sure do you want to print this bill ?")) { DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_PRINT_PACKING_SLIP_ONID '" + T010_PACKINGSLIPID + "'"); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptPackingSlip.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Packing Slip Bill"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } } //DataTable dt = new DataTable(); //dt = dl.SelectMethod("exec USP_VP_GET_FULLSALEBILL '" + T003_SALEID + "'"); //if (dt.Rows.Count > 0) //{ // ReportDocument RptDoc = new ReportDocument(); // RptDoc.Load(Application.StartupPath + @"\Report\rptRetailInvoice.rpt"); // RptDoc.SetDataSource(dt); // Datalayer.RptReport = RptDoc; // Datalayer.sReportName = "Invoice"; // frmReportViewer fmReport = new frmReportViewer(); // fmReport.Show(); //} } else { Datalayer.UpdateMessageBox(sPageName); this.Close(); } } else { if (Datalayer.T010_PACKINGSLIPID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } return; } } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
void PopualteData() { int iPartyID = 0, TM02_MAIN_PRODUCTSIZEID = 0; string sPartyID = "", sTM02_MAIN_PRODUCTSIZEID = ""; if (!string.IsNullOrEmpty(cmbName.Text.Trim())) { int.TryParse(cmbName.SelectedValue.ToString(), out iPartyID); } if (iPartyID > 0) { sPartyID = iPartyID.ToString(); } if (TM02_MAIN_PRODUCTSIZEID > 0) { sTM02_MAIN_PRODUCTSIZEID = TM02_MAIN_PRODUCTSIZEID.ToString(); } //MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); //List<USP_VP_GET_PANDING_ORDERResult> lstCategory = new List<USP_VP_GET_PANDING_ORDERResult>(); //lstCategory = MyDa.USP_VP_GET_PANDING_ORDER(sPartyID, Datalayer.iT001_COMPANYID.ToString()).ToList(); //dgDisplayData.DataSource = lstCategory; DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_PANDING_ORDER '" + sPartyID + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { //var orderedRows = from row in dt.AsEnumerable() // orderby row.Field<DateTime>("Invoice_Date") // select row; //DataTable tblOrdered = orderedRows.CopyToDataTable(); DataView dv = new DataView(dt); dv.RowFilter = "TOTALPENDING >0"; // dgDisplayData.DataSource = dv.ToTable(); ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptPendingOrderListing.rpt"); RptDoc.SetDataSource(dv.ToTable()); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Pending Order Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); ////dgDisplayData.Columns["TM01_PRODUCTID"].Visible = false; ////dgDisplayData.Columns["TM02_PRODUCTSIZEID"].Visible = false; ////dgDisplayData.Columns["T001_ACCOUNTID"].Visible = false; //dgDisplayData.Columns["Account_Name"].HeaderText = "Name"; //dgDisplayData.Columns["Product_No"].HeaderText = "No"; //dgDisplayData.Columns["NAME"].HeaderText = "Name"; //dgDisplayData.Columns["SIZE"].HeaderText = "Finish"; //dgDisplayData.Columns["QTY"].HeaderText = "Order Qty"; //dgDisplayData.Columns["SALE"].HeaderText = "Displaced"; //dgDisplayData.Columns["TOTALPENDING"].HeaderText = "Pending"; //dgDisplayData.Columns["Account_Name"].DisplayIndex = 0; //dgDisplayData.Columns["Product_No"].DisplayIndex = 1; //dgDisplayData.Columns["NAME"].DisplayIndex = 2; //dgDisplayData.Columns["SIZE"].DisplayIndex = 3; //dgDisplayData.Columns["QTY"].DisplayIndex = 4; //dgDisplayData.Columns["SALE"].DisplayIndex = 5; //dgDisplayData.Columns["TOTALPENDING"].DisplayIndex = 6; //this.dgDisplayData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; //dgDisplayData.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(Datalayer.sGridHeaderColor1, Datalayer.sGridHeaderColor2, Datalayer.sGridHeaderColor3); //dgDisplayData.EnableHeadersVisualStyles = false; //// dgCategory.CurrentRow.DefaultCellStyle.BackColor = Color.White; //dgDisplayData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing; //dgDisplayData.ColumnHeadersHeight = 30; //dgDisplayData.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("Tahoma", 12F, FontStyle.Bold, GraphicsUnit.Pixel); //dgDisplayData.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; } }