private void FillSentDate() { iPBillId = Convert.ToInt32(grdViewDemand.GetFocusedRowCellValue("PBillId")); try { dtSD = new DataTable(); dtSD = ProgBillBL.GetSentDate(iPBillId); grdSent.DataSource = null; grdSent.DataSource = dtSD; grdViewSent.PopulateColumns(); grdSent.ForceInitialize(); grdViewSent.OptionsSelection.InvertSelection = true; grdViewSent.OptionsSelection.EnableAppearanceHideSelection = false; grdViewSent.Appearance.FocusedRow.BackColor = Color.Teal; grdViewSent.Appearance.FocusedRow.ForeColor = Color.White; grdViewSent.BestFitColumns(); } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
private void FillGrid() { try { if (m_sBuyerId == "") { grdDemand.DataSource = null; return; } DataTable dtBind = new DataTable(); dtBuyer = new DataTable(); DataTable dt = new DataTable(); DataSet ds = new DataSet(); ds = ProgBillBL.GetDemandAge(m_iFromDays, m_iToDays, m_iCCId); dt = ds.Tables[0]; dtBuyer = ds.Tables[1]; dtBind = ds.Tables[2]; DataView dv = new DataView(dtBind); dv.RowFilter = "LeadId In(" + m_sBuyerId.TrimEnd(',') + ")"; dtBind = dv.ToTable(); grdDemand.DataSource = null; //grdDemand.DataSource = dtBind; grdDemand.DataSource = dtBuyer; grdViewDemand.PopulateColumns(); grdDemand.ForceInitialize(); grdViewDemand.Columns["PBillId"].Visible = false; grdViewDemand.Columns["CostCentreId"].Visible = false; grdViewDemand.Columns["FlatId"].Visible = false; grdViewDemand.Columns["PaySchId"].Visible = false; grdViewDemand.Columns["Count"].Visible = false; grdViewDemand.Columns["LeadId"].Visible = false; grdViewDemand.Columns["NoOfDays"].Visible = false; grdViewDemand.Columns["SortOrder"].Visible = false; grdViewDemand.Columns["BillNo"].Width = 50; grdViewDemand.Columns["FlatNo"].Width = 50; grdViewDemand.Columns["BuyerName"].Width = 100; grdViewDemand.Columns["Description"].Width = 200; //grdViewDemand.Columns["Count"].Width = 25; grdViewDemand.Columns["Sel"].Width = 50; grdViewDemand.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No"; grdViewDemand.Columns["NoOfDays"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdViewDemand.Columns["Sel"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDemand.Columns["Sel"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDemand.OptionsSelection.InvertSelection = true; grdViewDemand.OptionsSelection.EnableAppearanceHideSelection = false; grdViewDemand.Appearance.FocusedRow.BackColor = Color.Teal; grdViewDemand.Appearance.FocusedRow.ForeColor = Color.White; //grdViewDemand.BestFitColumns(); } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
private string GetBillId() { m_sBillId = ""; DataTable dtSel = new DataTable(); dtSel = grdDemand.DataSource as DataTable; DataView dview = new DataView(dtSel) { RowFilter = "Sel=" + true + "" }; DataTable dt = new DataTable(); dt = dview.ToTable(); if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { int iLeadId = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[i]["LeadId"], CommFun.datatypes.vartypenumeric)); int iFlatId = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[i]["FlatId"], CommFun.datatypes.vartypenumeric)); int iSortOrder = Convert.ToInt32(CommFun.IsNullCheck(dt.Rows[i]["SortOrder"], CommFun.datatypes.vartypenumeric)); DataView dv = new DataView(dtSel) { RowFilter = "LeadId=" + iLeadId + " AND FlatId=" + iFlatId + " AND SortOrder<=" + iSortOrder + "" }; DataTable dtFilter = new DataTable(); dtFilter = dv.ToTable(); if (dtFilter != null) { for (int k = 0; k < dtFilter.Rows.Count; k++) { if (m_sBillId == "") { m_sBillId = String.Format("{0}", dtFilter.Rows[k]["PBillId"]); } else { m_sBillId = String.Format("{0},{1}", m_sBillId, dtFilter.Rows[k]["PBillId"]); } } m_sBillId = m_sBillId.TrimEnd(','); if (m_sBillId == "") { m_sBillId = "0"; } //Insert into Temp Table ProgBillBL.InsertDLDate(m_sLeadId, m_sBillId, dtFilter); } } } return(m_sBillId); }
private void btnDelete_ItemClick(object sender, ItemClickEventArgs e) { try { if (grdPBRegView.FocusedRowHandle >= 0) { if (BsfGlobal.FindPermission("Progress Bill-Delete") == false) { MessageBox.Show("You don't have Rights to Progress Bill-Delete"); return; } int iProgRegId = Convert.ToInt32(grdPBRegView.GetRowCellValue(grdPBRegView.FocusedRowHandle, "ProgRegId")); int iCCId = Convert.ToInt32(grdPBRegView.GetRowCellValue(grdPBRegView.FocusedRowHandle, "CostCentreId")); bool bAns = ProgBillBL.GetApprFound(iProgRegId, iCCId); if (bAns == true) { MessageBox.Show("Bill Approved, Do not Delete"); return; } bAns = ProgBillBL.GetReceiptRaised(iProgRegId, iCCId); if (bAns == true) { MessageBox.Show("Receipt Raised, Could not Delete"); return; } DialogResult Result; Result = MessageBox.Show("Do you Want to Delete?", "CRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Result == DialogResult.Yes) { if (m_sBussinessType == "B") { ProgBillBL.DeletePBillMaster(iProgRegId); grdPBRegView.DeleteRow(grdPBRegView.FocusedRowHandle); grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle); BsfGlobal.InsertLog(DateTime.Now, "Progress Bill-Delete", "D", "Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0); } else { ProgBillBL.DeletePlotPBillMaster(iProgRegId); grdPBRegView.DeleteRow(grdPBRegView.FocusedRowHandle); grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle); BsfGlobal.InsertLog(DateTime.Now, "Plot-Progress-Bill-Delete", "D", "Plot Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0); } } } } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e) { try { if (grdPBTransView.FocusedRowHandle >= 0) { if (BsfGlobal.FindPermission("Progress Bill-Delete") == false) { MessageBox.Show("You don't have Rights to Progress Bill-Delete"); return; } string sApprove = CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("Approve"), CommFun.datatypes.vartypestring).ToString(); if (sApprove == "P" || sApprove == "Y") { MessageBox.Show("Bill Approved, Do not Delete"); return; } DialogResult Result; Result = MessageBox.Show("Do you Want to Delete?", "CRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Result == DialogResult.Yes) { int iPBillId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "PBillId")); int iCCId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "CostCentreId")); if (m_sBussinessType == "B") { ProgBillBL.DeletePBill(iPBillId); grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle); //CommFun.InsertLog(DateTime.Now, "Progress Bill-Delete", "D", "Progress Bill", BsfGlobal.g_lUserId, Convert.ToInt32(gridView1.GetFocusedRowCellValue("RegisterId")), Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId")), 0, BsfGlobal.g_sCRMDBName); BsfGlobal.InsertLog(DateTime.Now, "Progress Bill-Delete", "D", "Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0); } else { ProgBillBL.DeletePlotPBill(iPBillId); grdPBTransView.DeleteRow(grdPBTransView.FocusedRowHandle); //CommFun.InsertLog(DateTime.Now, "Plot-Progress-Bill-Delete", "D", "Plot Progress Bill ", BsfGlobal.g_lUserId, Convert.ToInt32(gridView1.GetFocusedRowCellValue("RegisterId")), Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId")), 0, BsfGlobal.g_sCRMDBName); BsfGlobal.InsertLog(DateTime.Now, "Plot-Progress-Bill-Delete", "D", "Plot Progress Bill", iProgRegId, iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId, 0, 0); } } } } catch (Exception ex) { throw ex; } }
private void GetPBAccountSetup() { DataTable dt = new DataTable(); dt = ProgBillBL.GetPBAccountSetup(m_sBussinessType); if (dt.Rows.Count > 0) { m_iIncomeId = Convert.ToInt32(dt.Rows[0]["IncomeAccountId"]); m_iBuyerId = Convert.ToInt32(dt.Rows[0]["BuyerAccountId"]); m_iAdvanceId = Convert.ToInt32(dt.Rows[0]["AdvanceAccountId"]); } dt.Dispose(); }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { grdViewAcct.FocusedRowHandle = grdViewAcct.FocusedRowHandle + 1; DataTable dt = new DataTable(); dt = grdAcct.DataSource as DataTable; ProgBillBL.UpdateQualAccount(dt, m_sBussinessType); m_iIncomeId = Convert.ToInt32(CommFun.IsNullCheck(cboIncome.EditValue, CommFun.datatypes.varTypeBoolean)); m_iBuyerId = Convert.ToInt32(CommFun.IsNullCheck(cboBuyer.EditValue, CommFun.datatypes.varTypeBoolean)); m_iAdvanceId = Convert.ToInt32(CommFun.IsNullCheck(cboAdvance.EditValue, CommFun.datatypes.varTypeBoolean)); ProgBillBL.UpdatePBAccountSetup(m_iIncomeId, m_iBuyerId, m_iAdvanceId, m_sBussinessType); m_boK = true; this.Close(); }
private string GetBuyer() { DataSet ds = new DataSet(); ds = ProgBillBL.GetDemandAge(m_iFromDays, m_iToDays, m_iCCId); dtBuyer = ds.Tables[1]; m_sBuyerId = ""; if (dtBuyer.Rows.Count > 0) { for (int i = 0; i < dtBuyer.Rows.Count; i++) { m_sBuyerId = String.Format("{0}{1},", m_sBuyerId, dtBuyer.Rows[i]["LeadId"]); } } return(m_sBuyerId); }
private void PopulateGrid() { DataTable dt = new DataTable(); dt = ProgBillBL.GetQualifierAccount(m_sBussinessType); grdAcct.DataSource = dt; grdViewAcct.PopulateColumns(); grdViewAcct.Columns["QualifierId"].Visible = false; grdViewAcct.Columns["AccountId"].Caption = "Account Name"; DataTable dtAccount = new DataTable(); dtAccount = ProgBillBL.GetQualAcct(); DataRow dr = dtAccount.NewRow(); dr["AccountId"] = 0; dr["AccountName"] = "None"; dtAccount.Rows.InsertAt(dr, 0); RepositoryItemLookUpEdit cboAccount = new RepositoryItemLookUpEdit(); cboAccount.DataSource = dtAccount; cboAccount.ValueMember = "AccountId"; cboAccount.DisplayMember = "AccountName"; cboAccount.PopulateColumns(); cboAccount.Columns["AccountId"].Visible = false; cboAccount.ShowFooter = false; cboAccount.ShowHeader = false; grdViewAcct.Columns["AccountId"].ColumnEdit = cboAccount; grdViewAcct.Appearance.HeaderPanel.Font = new Font(grdViewAcct.Appearance.HeaderPanel.Font, FontStyle.Bold); grdViewAcct.Appearance.FocusedCell.BackColor = Color.Teal; grdViewAcct.Appearance.FocusedCell.ForeColor = Color.White; grdViewAcct.Appearance.FocusedRow.ForeColor = Color.White; grdViewAcct.Appearance.FocusedRow.BackColor = Color.Teal; grdViewAcct.OptionsSelection.EnableAppearanceHideSelection = false; }
private void PopulateAdvanceAcct() { DataTable dt = new DataTable(); dt = ProgBillBL.GetAcct(8); DataRow dr = dt.NewRow(); dr["AccountId"] = 0; dr["AccountName"] = "None"; dt.Rows.InsertAt(dr, 0); cboAdvance.Properties.DataSource = dt; cboAdvance.Properties.PopulateColumns(); cboAdvance.Properties.DisplayMember = "AccountName"; cboAdvance.Properties.ValueMember = "AccountId"; cboAdvance.Properties.Columns["AccountId"].Visible = false; cboAdvance.Properties.ShowFooter = false; cboAdvance.Properties.ShowHeader = false; cboAdvance.EditValue = m_iAdvanceId; }
public void PopulateProject() { RepositoryItemLookUpEdit ff = cboProj.Edit as RepositoryItemLookUpEdit; try { DataTable dt = new DataTable(); dt = ProgBillBL.GetCostCentre(); ff.DataSource = CommFun.AddSelectToDataTable(dt); ff.PopulateColumns(); ff.ValueMember = "CostCentreId"; ff.DisplayMember = "CostCentreName"; ff.Columns["CostCentreId"].Visible = false; ff.ShowFooter = false; ff.ShowHeader = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void PopulateAge() { try { DataTable dt = new DataTable(); dt = ProgBillBL.GetAgeDesc(m_iCCId); cboAge.Properties.DataSource = CommFun.AddSelectToDataTable(dt); cboAge.Properties.PopulateColumns(); cboAge.Properties.ForceInitialize(); cboAge.Properties.ValueMember = "AgeId"; cboAge.Properties.DisplayMember = "AgeDesc"; cboAge.Properties.Columns["AgeId"].Visible = false; cboAge.Properties.Columns["FromDays"].Visible = false; cboAge.Properties.Columns["ToDays"].Visible = false; cboAge.Properties.Columns["ReportName"].Visible = false; cboAge.Properties.ShowFooter = false; cboAge.Properties.ShowHeader = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void FillGridMaster() { try { if (Convert.ToInt32(cboProj.EditValue) > 0) { dtBind = new DataTable(); dtBind = ProgBillBL.GetPBMaster(Convert.ToInt32(cboProj.EditValue.ToString()), m_sBussinessType); //bAns = true; grdPBReg.DataSource = dtBind; grdPBRegView.Columns["ProgRegId"].Visible = false; grdPBRegView.Columns["CostCentreId"].Visible = false; grdPBRegView.Columns["NetAmount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; grdPBRegView.Columns["NetAmount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; //bAns = false; grdPBRegView.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdPBRegView.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdPBRegView.Appearance.HeaderPanel.Font = new Font(grdPBRegView.Appearance.HeaderPanel.Font, FontStyle.Bold); grdPBRegView.Appearance.FocusedCell.BackColor = Color.Teal; grdPBRegView.Appearance.FocusedCell.ForeColor = Color.White; grdPBRegView.Appearance.FocusedRow.ForeColor = Color.Black; grdPBRegView.Appearance.FocusedRow.BackColor = Color.White; grdPBRegView.OptionsSelection.EnableAppearanceHideSelection = false; } } catch (Exception ex) { throw ex; } }
private void btnNote_ItemClick(object sender, ItemClickEventArgs e) { if (grdPBTransView.FocusedRowHandle < 0) { return; } int p_FlatId = 0, p_BillId = 0, p_ProgRegId = 0; p_FlatId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "FlatId")); p_ProgRegId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "ProgRegId")); p_BillId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "PBillId")); DataTable dt = new DataTable(); dt = ProgBillBL.GetDNPrint(p_FlatId, p_BillId, p_ProgRegId); string strReportPath = string.Empty; Cursor.Current = Cursors.WaitCursor; frmReport objReport = new frmReport(); strReportPath = Application.StartupPath + "\\DemandNote.rpt"; objReport.Text = "Report : " + strReportPath; ReportDocument cryRpt = new ReportDocument(); cryRpt.Load(strReportPath); cryRpt.SetDataSource(dt); //cryRpt.DataDefinition.FormulaFields["CompanyName"].Text = String.Format("'{0}'", BsfGlobal.g_sCompanyName); objReport.rptViewer.ReportSource = cryRpt; objReport.rptViewer.Refresh(); objReport.Show(); //try //{ // if (gridView1.FocusedRowHandle < 0) return; // int p_FlatId = 0, p_BillId = 0, p_PlotId = 0; decimal d_SchPer = 0; // string s = ""; frmReport objReport; ReportDocument cryRpt; // string[] DataFiles; // if (m_sBussinessType == "B") // { // p_FlatId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FlatId")); // d_SchPer = ProgBillBL.GetSchPer(p_FlatId); // p_BillId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ProgRegId")); // int CCId = Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId").ToString()); // objReport = new frmReport(); // string strReportPath = Application.StartupPath + "\\DemandNote.Rpt"; // cryRpt = new ReportDocument(); // cryRpt.Load(strReportPath); // s = "{ProgressBillRegister.FlatId}=" + p_FlatId + ""; // DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName}; // } // else // { // p_PlotId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PlotDetailsId")); // p_BillId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PBillId")); // int CCId = Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId").ToString()); // objReport = new frmReport(); // string strReportPath = Application.StartupPath + "\\DemandNote.Rpt"; // cryRpt = new ReportDocument(); // cryRpt.Load(strReportPath); // s = "{PlotProgressBillRegister.FlatId}=" + p_FlatId + ""; // DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName}; // } // objReport.ReportConvert(cryRpt, DataFiles); // if (s.Length > 0) // cryRpt.RecordSelectionFormula = s; // objReport.rptViewer.ReportSource = null; // objReport.rptViewer.SelectionFormula = s; // objReport.rptViewer.ReportSource = cryRpt; // cryRpt.DataDefinition.FormulaFields["Decimal"].Text = string.Format(CommFun.g_iCurrencyDigit.ToString()); // cryRpt.DataDefinition.FormulaFields["Percent"].Text = d_SchPer.ToString(); // objReport.WindowState = FormWindowState.Maximized; // objReport.Show(); //} //catch (Exception ex) //{ // BsfGlobal.CustomException(ex.Message, ex.StackTrace); //} }
private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { grdViewDemand.FocusedRowHandle = grdViewDemand.FocusedRowHandle + 1; if (grdViewDemand.RowCount == 0) { Close(); return; } if (grdViewDemand.FocusedRowHandle < 0) { Close(); return; } Cursor.Current = Cursors.WaitCursor; if (m_sType == "DL") { GetLeadId(); GetBillId(); if (m_sLeadId == "") { Close(); return; } ReportDocument cryRpt = new ReportDocument(); string strReportPath = ""; if (m_sReportName == "") { strReportPath = Application.StartupPath + "\\DemandLetter.Rpt"; } else { strReportPath = Application.StartupPath + "\\" + m_sReportName + ""; } cryRpt.Load(strReportPath); string[] DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sWorkFlowDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sRateAnalDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sRateAnalDBName }; frmReport objReport = new frmReport(); objReport.Text = "Report : " + strReportPath; objReport.ReportConvert(cryRpt, DataFiles); objReport.rptViewer.ReportSource = null; objReport.rptViewer.ReportSource = cryRpt; if (cryRpt.Database.Tables.Count > 1) { string s = "{ProgressBillRegister.LeadId} In [" + m_sLeadId.TrimEnd(',') + "] And {ProgressBillRegister.PBillId} In [" + m_sBillId.TrimEnd(',') + "]"; if (s.Length > 0) { cryRpt.RecordSelectionFormula = s; } objReport.rptViewer.SelectionFormula = s; } else { DataTable dt = new DataTable(); dt = ProgBillBL.GetDemandLetterFirstPrint(m_iCCId, m_sBillId, m_sLeadId); cryRpt.SetDataSource(dt); } if (cryRpt.Subreports.Count != 0) { string[] Sub_DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName }; objReport.Sub_ReportConvert(cryRpt, DataFiles, 0); } objReport.WindowState = FormWindowState.Maximized; objReport.rptViewer.Refresh(); objReport.Show(); } else { if (grdViewDemand.RowCount == 0) { Close(); return; } ProgBillBL.InsertDLStatus(dtStatus, m_iAgeId); FillGridStatus(); } grdViewDemand.FocusedRowHandle = grdViewDemand.FocusedRowHandle - 1; Cursor.Current = Cursors.Default; }
public void FillGrid() { try { iProgRegId = Convert.ToInt32(grdPBRegView.GetFocusedRowCellValue("ProgRegId")); if (Convert.ToInt32(cboProj.EditValue) > 0) { dtBind = new DataTable(); dtBind = ProgBillBL.GetPBRegister(Convert.ToInt32(cboProj.EditValue.ToString()), iProgRegId, m_sBussinessType); grdPBTrans.DataSource = null; grdPBTrans.DataSource = dtBind; grdPBTransView.PopulateColumns(); grdPBTransView.Columns["ProgRegId"].Visible = false; grdPBTransView.Columns["PBillId"].Visible = false; grdPBTransView.Columns["CostCentreId"].Visible = false; grdPBTransView.Columns["LeadId"].Visible = false; grdPBTransView.Columns["Amount"].Visible = false; if (m_sBussinessType == "B") { grdPBTransView.Columns["FlatId"].Visible = false; } else { grdPBTransView.Columns["PlotDetailsId"].Visible = false; } if (m_sBussinessType == "B") { grdPBTransView.Columns["FlatNo"].Width = 100; grdPBTransView.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No"; } else { grdPBTransView.Columns["PlotNo"].Width = 100; } grdPBTransView.Columns["AsOnDate"].Width = 100; grdPBTransView.Columns["PBDate"].Width = 100; grdPBTransView.Columns["PBNo"].Width = 100; grdPBTransView.Columns["CostCentreName"].Width = 200; grdPBTransView.Columns["Description"].Width = 150; grdPBTransView.Columns["BuyerName"].Width = 150; grdPBTransView.Columns["NetAmount"].Width = 100; grdPBTransView.Columns["Approve"].Width = 50; grdPBTransView.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdPBTransView.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdPBTransView.Columns["NetAmount"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; grdPBTransView.Columns["NetAmount"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdPBTransView.Appearance.HeaderPanel.Font = new Font(grdPBTransView.Appearance.HeaderPanel.Font, FontStyle.Bold); grdPBTransView.Appearance.FocusedCell.BackColor = Color.Teal; grdPBTransView.Appearance.FocusedCell.ForeColor = Color.White; grdPBTransView.Appearance.FocusedRow.ForeColor = Color.Black; grdPBTransView.Appearance.FocusedRow.BackColor = Color.White; grdPBTransView.OptionsSelection.EnableAppearanceHideSelection = false; } } catch (Exception ex) { throw ex; } }
private void btnRep_ItemClick(object sender, ItemClickEventArgs e) { if (grdPBTransView.FocusedRowHandle < 0) { return; } int p_FlatId = 0, p_BillId = 0, p_ProgRegId = 0; p_FlatId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "FlatId")); p_ProgRegId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "ProgRegId")); p_BillId = Convert.ToInt32(grdPBTransView.GetRowCellValue(grdPBTransView.FocusedRowHandle, "PBillId")); DataTable dt = new DataTable(); DataTable dtP = new DataTable(); dt = ProgBillBL.GetDNPrint(p_FlatId, p_BillId, p_ProgRegId); dtP = ProgBillBL.GetDNPaymentSchPrint(p_FlatId, p_BillId, p_ProgRegId); DataView view = new DataView(dtP); // Sort by State and ZipCode column in descending order view.Sort = "PaymentSchId ASC"; dtP = view.ToTable(); string strReportPath = string.Empty; Cursor.Current = Cursors.WaitCursor; frmReport objReport = new frmReport() { WindowState = FormWindowState.Maximized }; strReportPath = Application.StartupPath + "\\DemandLetter.rpt"; objReport.Text = "Report : " + strReportPath; ReportDocument cryRpt = new ReportDocument(); cryRpt.Load(strReportPath); cryRpt.SetDataSource(dt); //cryRpt.DataDefinition.FormulaFields["CompanyName"].Text = String.Format("'{0}'", BsfGlobal.g_sCompanyName); int iCnt = 0; foreach (ReportDocument subreport in cryRpt.Subreports) { if (subreport.Name.ToUpper() == "RECEIPT") { cryRpt.Subreports[iCnt].SetDataSource(dtP); } iCnt += 1; } //cryRpt.Subreports[0].SetDataSource(dtP); objReport.rptViewer.ReportSource = cryRpt; objReport.rptViewer.Refresh(); objReport.Show(); //if (gridView1.FocusedRowHandle < 0) return; //int p_FlatId = 0, p_BillId = 0, p_PlotId = 0; //string s = ""; frmReport objReport; ReportDocument cryRpt; //string[] DataFiles; //if (m_sBussinessType == "B") //{ // p_FlatId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FlatId")); // p_BillId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PBillId")); // int CCId = Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId").ToString()); // objReport = new frmReport(); // string strReportPath = Application.StartupPath + "\\ProgressBillMaster.Rpt"; // cryRpt = new ReportDocument(); // cryRpt.Load(strReportPath); // s = "{ProgressBillRegister.PBillId}=" + p_BillId + ""; // DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName}; //} //else //{ // p_PlotId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PlotDetailsId")); // p_BillId = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PBillId")); // int CCId = Convert.ToInt32(gridView1.GetFocusedRowCellValue("CostCentreId").ToString()); // objReport = new frmReport(); // string strReportPath = Application.StartupPath + "\\PlotProgressBill.Rpt"; // cryRpt = new ReportDocument(); // cryRpt.Load(strReportPath); // s = "{PlotProgressBillRegister.PBillId}=" + p_BillId + ""; // DataFiles = new string[] { BsfGlobal.g_sCRMDBName, BsfGlobal.g_sCRMDBName, // BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sWorkFlowDBName,BsfGlobal.g_sCRMDBName,BsfGlobal.g_sRateAnalDBName}; //} //objReport.ReportConvert(cryRpt, DataFiles); //if (s.Length > 0) // cryRpt.RecordSelectionFormula = s; //objReport.rptViewer.ReportSource = null; //objReport.rptViewer.SelectionFormula = s; //objReport.rptViewer.ReportSource = cryRpt; //cryRpt.DataDefinition.FormulaFields["Decimal"].Text = string.Format(CommFun.g_iCurrencyDigit.ToString()); //objReport.WindowState = FormWindowState.Maximized; //objReport.rptViewer.Refresh(); //objReport.Show(); }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { Cursor.Current = Cursors.WaitCursor; string sApprove = CommFun.IsNullCheck(grdPBRegView.GetFocusedRowCellValue("Approve"), CommFun.datatypes.vartypestring).ToString(); if (sApprove != "Y") { MessageBox.Show("Bill not Approved", "Progress Bill", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } #region Mail Alert string sProject = CommFun.IsNullCheck(repositoryItemLookUpEdit3.GetDisplayText(cboProj.EditValue), CommFun.datatypes.vartypestring).ToString(); string sFlatNo = CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("FlatNo"), CommFun.datatypes.vartypestring).ToString(); decimal dCurrentAmount = Convert.ToDecimal(CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("Amount"), CommFun.datatypes.vartypenumeric)); decimal dCurrentNetAmount = Convert.ToDecimal(CommFun.IsNullCheck(grdPBRegView.GetFocusedRowCellValue("NetAmount"), CommFun.datatypes.vartypenumeric)); decimal dGross = 0; decimal dNetAmount = 0; decimal dPaidAmount = 0; string sCompany = ""; string sBuyer = ""; string sEmail = ""; DataTable dtAlertStages = new DataTable(); dtAlertStages.Columns.Add("Stage", typeof(string)); dtAlertStages.Columns.Add("%", typeof(decimal)); dtAlertStages.Columns.Add("Amount", typeof(decimal)); dtAlertStages.Columns.Add("ServiceTax", typeof(decimal)); dtAlertStages.Columns.Add("LateInterest", typeof(decimal)); dtAlertStages.Columns.Add("NetAmount", typeof(decimal)); int iPBillId = Convert.ToInt32(CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("PBillId"), CommFun.datatypes.vartypenumeric)); int iFlatId = Convert.ToInt32(CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("FlatId"), CommFun.datatypes.vartypenumeric)); int iLeadId = Convert.ToInt32(CommFun.IsNullCheck(grdPBTransView.GetFocusedRowCellValue("LeadId"), CommFun.datatypes.vartypenumeric)); DataTable dtAlert = new DataTable(); dtAlert = ProgBillBL.GetProgressBillAlert(Convert.ToInt32(cboProj.EditValue), iPBillId, iFlatId, iLeadId); if (dtAlert != null) { if (dtAlert.Rows.Count > 0) { sCompany = CommFun.IsNullCheck(dtAlert.Rows[0]["CompanyName"], CommFun.datatypes.vartypestring).ToString(); sBuyer = CommFun.IsNullCheck(dtAlert.Rows[0]["LeadName"], CommFun.datatypes.vartypestring).ToString(); sEmail = CommFun.IsNullCheck(dtAlert.Rows[0]["Email"], CommFun.datatypes.vartypestring).ToString(); dGross = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Compute("SUM(Gross)", ""), CommFun.datatypes.vartypenumeric)); dNetAmount = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Compute("SUM(NetAmount)", ""), CommFun.datatypes.vartypenumeric)); dPaidAmount = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Compute("SUM(PaidAmount)", ""), CommFun.datatypes.vartypenumeric)); } for (int j = 0; j <= dtAlert.Rows.Count - 1; j++) { string sStage = CommFun.IsNullCheck(dtAlert.Rows[j]["Description"], CommFun.datatypes.vartypestring).ToString(); decimal dPercentage = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Rows[j]["Percentage"], CommFun.datatypes.vartypenumeric)); decimal dAmt = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Rows[j]["Gross"], CommFun.datatypes.vartypenumeric)); decimal dServiceTax = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Rows[j]["ServiceTax"], CommFun.datatypes.vartypenumeric)); decimal dLateInterst = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Rows[j]["Interest"], CommFun.datatypes.vartypenumeric)); decimal dNetAmt = Convert.ToDecimal(CommFun.IsNullCheck(dtAlert.Rows[j]["NetAmount"], CommFun.datatypes.vartypenumeric)); DataRow drow = dtAlertStages.NewRow(); drow["Stage"] = sStage; drow["%"] = dPercentage; drow["Amount"] = dAmt; drow["ServiceTax"] = dServiceTax; drow["LateInterest"] = dLateInterst; drow["NetAmount"] = dNetAmt; dtAlertStages.Rows.Add(drow); } } List <Mandrill.EmailAddress> toAddress = new List <Mandrill.EmailAddress>(); toAddress.Add(new Mandrill.EmailAddress() { name = sBuyer, email = sEmail }); if (toAddress.Count > 0) { MandrillTemplate.SendProgressBill(toAddress, sCompany, sProject, sFlatNo, dCurrentAmount, dCurrentNetAmount, dGross, dNetAmount, dPaidAmount, dtAlertStages); } #endregion Cursor.Current = Cursors.Default; }