private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { bool m_bAManualCode = false; DataTable dtAssICode = new DataTable(); dtAssICode = m_oCheckList.GetVendorCodeTypeSetup(); if (dtAssICode.Rows.Count > 0) { m_bAManualCode = Convert.ToBoolean(dtAssICode.Rows[0]["CodeType"].ToString()); } if (m_bAManualCode == true) { m_oVendor.MaxVendorMasterUpdate(); DataTable dtComp = new DataTable(); dtComp = VendorBL.GetVendorCodeRegen(); if (dtComp.Rows.Count > 0) { for (int i = 0; i < dtComp.Rows.Count; i++) { int iVendId = Convert.ToInt32(clsStatic.IsNullCheck(dtComp.Rows[i]["VendorId"], clsStatic.datatypes.vartypenumeric)); string s_Code = ""; s_Code = VendorBL.GetCodeCheckVendor(); VendorBL.MaxIncVendorMasterUpdate(iVendId, s_Code); } } MessageBox.Show("Code Regeneration Successfully"); } }