public PartialViewResult Edit(FirmaHomePageImagePrimaryKey firmaHomePageImagePrimaryKey)
        {
            var firmaHomePageImage = firmaHomePageImagePrimaryKey.EntityObject;
            var viewModel          = new EditViewModel(firmaHomePageImage);

            return(ViewEdit(firmaHomePageImage, viewModel));
        }
        public PartialViewResult DeleteFirmaHomePageImage(FirmaHomePageImagePrimaryKey firmaHomePageImagePrimaryKey)
        {
            var firmaHomePageImage = firmaHomePageImagePrimaryKey.EntityObject;
            var viewModel          = new ConfirmDialogFormViewModel(firmaHomePageImage.FirmaHomePageImageID);

            return(ViewDeleteFirmaHomePageImage(firmaHomePageImage, viewModel));
        }
        public ActionResult Edit(FirmaHomePageImagePrimaryKey firmaHomePageImagePrimaryKey, EditViewModel viewModel)
        {
            var firmaHomePageImage = firmaHomePageImagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewEdit(firmaHomePageImage, viewModel));
            }
            viewModel.UpdateModel(firmaHomePageImage, CurrentFirmaSession);
            return(new ModalDialogFormJsonResult());
        }
        public ActionResult DeleteFirmaHomePageImage(FirmaHomePageImagePrimaryKey firmaHomePageImagePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var firmaHomePageImage = firmaHomePageImagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteFirmaHomePageImage(firmaHomePageImage, viewModel));
            }
            firmaHomePageImage.DeleteFull(HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }
        public ActionResult DeleteFirmaHomePageImage(FirmaHomePageImagePrimaryKey firmaHomePageImagePrimaryKey, ConfirmDialogFormViewModel viewModel)
        {
            var firmaHomePageImage = firmaHomePageImagePrimaryKey.EntityObject;

            if (!ModelState.IsValid)
            {
                return(ViewDeleteFirmaHomePageImage(firmaHomePageImage, viewModel));
            }
            // will delete the File Resource and the FirmaHomePageImage row that references it
            firmaHomePageImage.FileResourceInfo.DeleteFull(HttpRequestStorage.DatabaseEntities);
            return(new ModalDialogFormJsonResult());
        }