public ActionResult Upsert(int?id)
        {
            FranchiseUpModel model = null;

            try
            {
                using (var repository = new FranchiseRepository())
                {
                    if (id.HasValue)
                    {
                        model            = repository.FindModelById(id.Value);
                        ViewBag.Resource = JsonConvert.SerializeObject(model.Resource);
                    }
                    else
                    {
                        model = new FranchiseUpModel
                        {
                            FranchiseId = EntityConstants.NULL_VALUE
                        };
                    }

                    ViewBag.Model = JsonConvert.SerializeObject(model);
                }

                ViewBag.PropertyFile = "Resource";
            }
            catch (Exception ex)
            {
                SharedLogger.LogError(ex, id);
            }
            return(View(model));
        }