private void FillDetails() { try { if (DGvTransView.FocusedRowHandle < 0) { return; } DataTable dt = new DataTable(); dt = RentDetBL.FillAgreementTransDetails(m_iRegId); grdDetail.DataSource = dt; //RepositoryItemTextEdit txtEditQuantity = new RepositoryItemTextEdit(); //txtEditQuantity.LookAndFeel.UseDefaultLookAndFeel = false; //txtEditQuantity.Mask.EditMask = CommFun.sFormatAmt; //txtEditQuantity.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; //txtEditQuantity.Mask.UseMaskAsDisplayFormat = true; //RepositoryItemTextEdit txtEditAmt = new RepositoryItemTextEdit(); //txtEditAmt.LookAndFeel.UseDefaultLookAndFeel = false; //txtEditAmt.Mask.EditMask = CommFun.sFormatAmt; //txtEditAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; //txtEditAmt.Mask.UseMaskAsDisplayFormat = true; //grdViewDetail.Columns["Qty"].ColumnEdit = txtEditQuantity; //grdViewDetail.Columns["IOWAmount"].ColumnEdit = txtEditAmt; grdViewDetail.Columns["RentTransId"].Visible = false; grdViewDetail.Columns["RentId"].Visible = false; grdViewDetail.Columns["RefNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["RefNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["RegDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["RegDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["StartDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["StartDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["EndDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["EndDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["RenewType"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdViewDetail.Columns["RenewType"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; grdViewDetail.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; grdViewDetail.OptionsView.ColumnAutoWidth = true; grdViewDetail.Appearance.HeaderPanel.Font = new Font(grdViewDetail.Appearance.HeaderPanel.Font, FontStyle.Bold); } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
private void bTransDelete_ItemClick(object sender, ItemClickEventArgs e) { if (grdViewDetail.FocusedRowHandle < 0) { return; } try { int i_RegTransId = Convert.ToInt32(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "RentTransId"), CommFun.datatypes.vartypenumeric)); int i_RegId = Convert.ToInt32(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "RentId"), CommFun.datatypes.vartypenumeric)); string m_sIssNo = ""; int m_iCCId1 = 0; string Apv = ""; string m_sType = ""; m_iCCId1 = Convert.ToInt32(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "CostCentreId"), CommFun.datatypes.vartypenumeric)); m_sIssNo = Convert.ToString(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "RefNo"), CommFun.datatypes.vartypestring)); m_sType = Convert.ToString(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "RenewType"), CommFun.datatypes.vartypestring)); Apv = Convert.ToString(CommFun.IsNullCheck(grdViewDetail.GetRowCellValue(grdViewDetail.FocusedRowHandle, "Approve"), CommFun.datatypes.vartypestring)); if (Apv == "Y") { MessageBox.Show("Already Approved, Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (RentDetBL.CheckTransId(i_RegTransId, i_RegId) == false) { MessageBox.Show("Do Not Delete", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (MessageBox.Show("Do you want to delete?", "Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (RentDetBL.DeleteRentAgreementRegister(i_RegId, m_iCCId1, m_sIssNo, i_RegTransId, m_sType) == true) { grdViewDetail.DeleteRow(grdViewDetail.FocusedRowHandle); FillData(); } } } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }
public void FillData() { try { m_dt = new DataTable(); m_dt = RentDetBL.PopulateRentRegister(Convert.ToDateTime(dtpFrmDate.EditValue), Convert.ToDateTime(dtpToDate.EditValue)); DGvTrans.DataSource = m_dt; DGvTransView.PopulateColumns(); RepositoryItemTextEdit txtEditAdvAmt = new RepositoryItemTextEdit(); txtEditAdvAmt.LookAndFeel.UseDefaultLookAndFeel = false; txtEditAdvAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat; txtEditAdvAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; txtEditAdvAmt.Mask.UseMaskAsDisplayFormat = true; RepositoryItemTextEdit txtEditAmt = new RepositoryItemTextEdit(); txtEditAmt.LookAndFeel.UseDefaultLookAndFeel = false; txtEditAmt.Mask.EditMask = BsfGlobal.g_sDigitFormat; txtEditAmt.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; txtEditAmt.Mask.UseMaskAsDisplayFormat = true; DGvTransView.Columns["AdvanceAmount"].ColumnEdit = txtEditAdvAmt; DGvTransView.Columns["Rent"].ColumnEdit = txtEditAmt; DGvTransView.Columns["RentId"].Visible = false; DGvTransView.Columns["CostCentreId"].Visible = false; DGvTransView.Columns["FlatNo"].Caption = CommFun.m_sFuncName + " No"; DGvTransView.Columns["Date"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; DGvTransView.Columns["StartDate"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; DGvTransView.Columns["EndDate"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; //DGvTransView.Columns["Approve"].OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; DGvTransView.Columns["RefNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["RefNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["FlatNo"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["FlatNo"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["Date"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["Date"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["StartDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["StartDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["EndDate"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["EndDate"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.Columns["RentType"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; DGvTransView.Columns["RentType"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; //DGvTransView.Columns["Approve"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; //DGvTransView.Columns["Approve"].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; DGvTransView.OptionsCustomization.AllowFilter = true; DGvTransView.OptionsBehavior.AllowIncrementalSearch = true; DGvTransView.OptionsView.ShowAutoFilterRow = true; DGvTransView.OptionsView.ShowViewCaption = false; DGvTransView.OptionsView.ShowFooter = false; DGvTransView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect; DGvTransView.OptionsSelection.InvertSelection = false; DGvTransView.OptionsView.ColumnAutoWidth = true; DGvTransView.Appearance.HeaderPanel.Font = new Font(DGvTransView.Appearance.HeaderPanel.Font, FontStyle.Bold); DGvTransView.FocusedRowHandle = 0; DGvTransView.FocusedColumn = DGvTransView.VisibleColumns[0]; DGvTransView.Appearance.FocusedCell.BackColor = Color.Teal; DGvTransView.Appearance.FocusedCell.ForeColor = Color.White; DGvTransView.Appearance.FocusedRow.ForeColor = Color.Black; DGvTransView.Appearance.FocusedRow.BackColor = Color.White; DGvTransView.OptionsSelection.EnableAppearanceHideSelection = false; } catch (Exception ex) { BsfGlobal.CustomException(ex.Message, ex.StackTrace); } }