public virtual void Delete(VirtualDiskCreation entity)
 {
     this.Service.Delete(entity);
 }
        protected void ButtonClick(object sender, EventArgs e)
        {
            this.HideLabels();
            var VHDPath = txtvhdpath.Text.Trim();
            var VHDSize = txtVHDSize.Text.Trim();
               var VHDType = DDdisktype.SelectedItem.Text;
            var ParentPath = txtParentPath.Text.Trim();

            // Virtual Disk PArameters validation
            if (string.IsNullOrWhiteSpace(VHDPath))
            {
                this.ShowErrorMessage("Please enter Virtual Disk path.");
                return;
            }

            if (string.IsNullOrWhiteSpace(VHDSize))
            {
                this.ShowErrorMessage("Please enter Virtual disk size.");
                return;
            }

            if (VHDType == "--SELECT--")
            {
                this.ShowErrorMessage("Please Select the disk type");
                return;
            }

            if (string.IsNullOrWhiteSpace(ParentPath))
            {
                this.ShowErrorMessage("please enter Parent path");
            }

            try
            {
                //Call PSI file creater Method:
                CreatePSIFile(VHDPath, VHDSize, VHDType, ParentPath);

                if (0 == EditVirtualdiskCreationId)
                {
                    var clientUser = new VirtualDiskCreation()
                    {
                        CreatedBy = Context.User.Identity.Name,
                        CreatedDate = DateTimeHelper.Now,
                        VHDPath=VHDPath,
                        VHDSize=VHDSize,
                        VHDType=VHDType,
                        ParentPath=ParentPath
                    };

                    VirtualdiskCreationService.Create(clientUser);
                    ShowSuccessMessage("Script Generated. Click to download.");
                    txtParentPath.Text = string.Empty;
                    txtvhdpath.Text = string.Empty;
                    txtVHDSize.Text = string.Empty;
                    DDdisktype.SelectedItem.Value = DropdownDefaultText;
                }
                else
                {
                    var virtualDiskCreation = VirtualdiskCreationService.Retrieve(EditVirtualdiskCreationId);
                    virtualDiskCreation.VHDPath = VHDPath;
                    virtualDiskCreation.VHDSize = VHDSize;
                    virtualDiskCreation.VHDType = VHDType;
                    virtualDiskCreation.ParentPath = ParentPath;

                    VirtualdiskCreationService.Update(virtualDiskCreation);
                    ShowSuccessMessage("Script Generated. Click to download.");
                }
            }
            catch (Exception ex)
            {
                this.ShowErrorMessage(
                    ex.Message.Contains(
                        "An error occurred while updating the entries. See the inner exception for details.")
                        ? "Duplicate Entry"
                        : ex.Message);
            }
        }