private void btnEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (grdBrokerView.FocusedRowHandle < 0) { return; } if (BsfGlobal.FindPermission("Broker Details-Modify") == false) { MessageBox.Show("You don't have Rights to Broker-Modify"); return; } int iBrokerId = Convert.ToInt32(grdBrokerView.GetFocusedRowCellValue("BrokerId")); int iVendorId = Convert.ToInt32(grdBrokerView.GetFocusedRowCellValue("VendorId")); frmBrokerDet frmBr = new frmBrokerDet(); if (frmBr.Execute(iBrokerId, iVendorId) == true) { string sql = "SELECT BrokerId,A.VendorId,B.VendorName BrokerName " + " FROM BrokerDet A Inner Join [" + BsfGlobal.g_sVendorDBName + "].dbo.VendorMaster B On A.VendorId=B.VendorId" + " Where BrokerId= " + iBrokerId; DataTable dt = new DataTable(); dt = CommFun.FillRecord(sql); grdBrokerView.Columns["BrokerId"].Visible = false; grdBrokerView.Columns["VendorId"].Visible = false; if (dt.Rows.Count > 0) { grdBrokerView.SetRowCellValue(grdBrokerView.FocusedRowHandle, "BrokerName", dt.Rows[0]["BrokerName"].ToString()); } dt.Dispose(); } }
private void btnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (BsfGlobal.FindPermission("Broker Details-Add") == false) { MessageBox.Show("You don't have Rights to Broker-Add"); return; } frmBrokerDet frmBr = new frmBrokerDet(); if (frmBr.Execute(0, 0) == true) { fillData(); } }