コード例 #1
0
 public virtual void Delete(Rdsinstallation entity)
 {
     this.Service.Delete(entity);
 }
コード例 #2
0
        protected void ButtonClick(object sender, EventArgs e)
        {
            this.HideLabels();
            var Connectionbroker = txtConnectionbroker.Text.Trim();
            var Webaccessserver = txtWebaccessserver.Text.Trim();
            var Sessionhost = txtSessionhost.Text.Trim();
            var Gatewayserver = txtGatewayserver.Text.Trim();
            var Gatewayfqdn = txtGatewayfqdn.Text.Trim();

            // RDS Parameters validation
            if (string.IsNullOrWhiteSpace(Connectionbroker))
            {
                this.ShowErrorMessage("Please enter Connection Borker Server name.");
                return;
            }

            if (string.IsNullOrWhiteSpace(Webaccessserver))
            {
                this.ShowErrorMessage("Please enter Web access server name.");
                return;
            }

            if (string.IsNullOrWhiteSpace(Sessionhost))
            {
                this.ShowErrorMessage("Please enter Session Host Server name.");
                return;
            }

            if (string.IsNullOrWhiteSpace(Gatewayserver))
            {
                this.ShowErrorMessage("Please enter Gateway server name.");
                return;
            }

            if (string.IsNullOrWhiteSpace(Gatewayfqdn))
            {
                this.ShowErrorMessage("Please enter Gateway server FQDN.");
                return;
            }

            try
            {
                //Call PSI file creater Method:
                CreatePSIFile(Connectionbroker, Webaccessserver, Sessionhost, Gatewayserver, Gatewayfqdn);

                if (0 == EditrdsinstallationId)
                {
                    var clientUser = new Rdsinstallation()
                    {
                        CreatedBy = Context.User.Identity.Name,
                        CreatedDate = DateTimeHelper.Now,
                        Connectionbroker=Connectionbroker,
                        Webaccessserver=Webaccessserver,
                        Sessionhost=Sessionhost,
                        Gatewayserver=Gatewayserver,
                        Gatewayfqdn=Gatewayfqdn
                    };

                    RdsinstallationService.Create(clientUser);
                    ShowSuccessMessage("Script Generated. Click to download.");
                    txtConnectionbroker.Text = string.Empty;
                    txtWebaccessserver.Text = string.Empty;
                    txtSessionhost.Text = string.Empty;
                    txtGatewayserver.Text = string.Empty;
                    txtGatewayfqdn.Text = string.Empty;
                }
                else
                {
                    var Rdsinstallation = RdsinstallationService.Retrieve(EditrdsinstallationId);
                    Rdsinstallation.Connectionbroker = Connectionbroker;
                    Rdsinstallation.Webaccessserver = Webaccessserver;
                    Rdsinstallation.Sessionhost = Sessionhost;
                    Rdsinstallation.Gatewayserver = Gatewayserver;
                    Rdsinstallation.Gatewayfqdn = Gatewayfqdn;

                    RdsinstallationService.Update(Rdsinstallation);
                    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);
            }
        }