//select the appropriate vehicle checkboxes for which the shop is certified
        protected void chkVehicles_DataBound(object sender, EventArgs e)
        {
            try
            {
                if (SessionInfo.UserShop.SetInSession)
                {
                    List <BodyShopVehiclesBL> objBodyShopNetworks = BodyShopVehiclesBL.getDataByShopId(Convert.ToInt32(SessionInfo.UserShop.id));

                    if (objBodyShopNetworks != null)
                    {
                        foreach (ListItem lstItem in chkVehicles.Items)
                        {
                            BodyShopVehiclesBL obj = objBodyShopNetworks.Find(c => c.iVehicleId == Convert.ToInt32(lstItem.Value));
                            if (obj != null)
                            {
                                lstItem.Selected = true;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionPolicy.HandleException(ex, Constants.ExceptionPolicy);
            }
        }
        // save the changes if new certification is added save that or if deselected delete this
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (SessionInfo.UserShop.SetInSession)
                {
                    List <BodyShopVehiclesBL> objlstBodyShopNetworks = BodyShopVehiclesBL.getDataByShopId(Convert.ToInt32(SessionInfo.UserShop.id));

                    if (objlstBodyShopNetworks != null)
                    {
                        Boolean flag = true;
                        foreach (ListItem lstItem in chkVehicles.Items)
                        {
                            if (lstItem.Selected)
                            {
                                BodyShopVehiclesBL obj = objlstBodyShopNetworks.Find(c => c.iVehicleId == Convert.ToInt32(lstItem.Value));
                                if (obj == null)
                                {
                                    BodyShopVehiclesBL objBodyShopNetwork = new BodyShopVehiclesBL();
                                    objBodyShopNetwork.iShopId    = Convert.ToInt32(SessionInfo.UserShop.id);
                                    objBodyShopNetwork.iVehicleId = Convert.ToInt32(lstItem.Value);

                                    if (!objBodyShopNetwork.Save())
                                    {
                                        flag = false;
                                    }
                                }
                            }
                            else
                            {
                                BodyShopVehiclesBL obj = objlstBodyShopNetworks.Find(c => c.iVehicleId == Convert.ToInt32(lstItem.Value));
                                if (obj != null)
                                {
                                    if (!obj.Delete())
                                    {
                                        flag = false;
                                    }
                                }
                            }
                        }
                        if (flag == true)
                        {
                            Master.MessageTitle = Constants.SUCCESS;
                            Master.Message      = Constants.SAVE_SUCCESS;
                        }
                        else
                        {
                            Master.MessageTitle = Constants.ERROR;
                            Master.Message      = Constants.SAVE_FAILED;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionPolicy.HandleException(ex, Constants.ExceptionPolicy);
            }
        }