public virtual void Delete(Webserverinstallation entity)
 {
     this.Service.Delete(entity);
 }
        protected void ButtonClick(object sender, EventArgs e)
        {
            this.HideLabels();
            bool returnResult = false;
            var Ipaddress = this.txtIPAddress.Text.Trim();
            var Hostname = this.txthostname.Text.Trim();

            // Input validation
            if (string.IsNullOrWhiteSpace(Ipaddress))
            {
                this.ShowErrorMessage("Please enter IP Address.");
                return;
            }

            if (string.IsNullOrWhiteSpace(Hostname))
            {
                this.ShowErrorMessage("Please enter Hostname.");
                return;
            }

            try
            {
                //Call PSI file creater Method:
                CreatePSIFile(Ipaddress, Hostname);

                if (0 == EditWebserinstallationId)
                {
                    var clientUser = new Webserverinstallation()
                    {
                        CreatedBy = Context.User.Identity.Name,
                        CreatedDate = DateTimeHelper.Now,
                        Ipaddress = Ipaddress,
                        Hostname = Hostname,
                     };

                    WebserverinstallationService.Create(clientUser);
                    ShowSuccessMessage("Script Generated. Click to download.");

                    txtIPAddress.Text = string.Empty;
                    txthostname.Text = string.Empty;

                }
                else
                {
                    var WebserverInstallation = WebserverinstallationService.Retrieve(EditWebserinstallationId);
                    WebserverInstallation.Ipaddress = Ipaddress;
                    WebserverInstallation.Hostname = Hostname;

                    WebserverinstallationService.Update(WebserverInstallation);
                    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);
            }
        }