Пример #1
0
 public int UpdateDnsRecord(GlobalDnsRecord record)
 {
     return ServerController.UpdateDnsRecord(record);
 }
        private void SaveRecord()
        {
            GlobalDnsRecord record = new GlobalDnsRecord();
            record.RecordId = (int)ViewState["RecordID"];
            record.RecordType = ddlRecordType.SelectedValue;
            record.RecordName = txtRecordName.Text.Trim();
            record.RecordData = txtRecordData.Text.Trim();
            record.MxPriority = Utils.ParseInt(txtMXPriority.Text, 0);
            record.IpAddressId = ipAddress.AddressId;

            if (ServiceIdParam != null)
                record.ServiceId = Utils.ParseInt(Request[ServiceIdParam], 0);
            else if (ServerIdParam != null)
                record.ServerId = Utils.ParseInt(Request[ServerIdParam], 0);
            else if (PackageIdParam != null)
                record.PackageId = Utils.ParseInt(Request[PackageIdParam], 0);

            if (record.RecordId == 0)
            {
                // add record
                try
                {
                    int result = ES.Services.Servers.AddDnsRecord(record);
                    if (result < 0)
                    {
                        HostModule.ShowResultMessage(result);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    HostModule.ShowErrorMessage("GDNS_ADD_RECORD", ex);
                    return;
                }
            }
            else
            {
                // update record
                try
                {
                    int result = ES.Services.Servers.UpdateDnsRecord(record);
                    if (result < 0)
                    {
                        HostModule.ShowResultMessage(result);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    HostModule.ShowErrorMessage("GDNS_UPDATE_RECORD", ex);
                    return;
                }
            }

            // rebind and switch
            BindDnsRecords();
            ShowPanels(false);
        }
Пример #3
0
        public static int UpdateDnsRecord(GlobalDnsRecord record)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsReseller
                | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            TaskManager.StartTask("GLOBAL_DNS", "UPDATE", record.RecordName);
            TaskManager.WriteParameter("Type", record.RecordType);
            TaskManager.WriteParameter("Data", record.RecordData);

            DataProvider.UpdateDnsRecord(SecurityContext.User.UserId, record.RecordId,
                record.RecordType, record.RecordName, record.RecordData, record.MxPriority, record.IpAddressId);

            TaskManager.CompleteTask();

            return 0;
        }
Пример #4
0
 public int AddDnsRecord(GlobalDnsRecord record)
 {
     return ServerController.AddDnsRecord(record);
 }
Пример #5
0
 public int AddDnsRecord(GlobalDnsRecord record)
 {
     return(ServerController.AddDnsRecord(record));
 }
Пример #6
0
 public int UpdateDnsRecord(GlobalDnsRecord record)
 {
     return(ServerController.UpdateDnsRecord(record));
 }
Пример #7
0
 /// <remarks/>
 public void UpdateDnsRecordAsync(GlobalDnsRecord record, object userState) {
     if ((this.UpdateDnsRecordOperationCompleted == null)) {
         this.UpdateDnsRecordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateDnsRecordOperationCompleted);
     }
     this.InvokeAsync("UpdateDnsRecord", new object[] {
                 record}, this.UpdateDnsRecordOperationCompleted, userState);
 }
Пример #8
0
 /// <remarks/>
 public void UpdateDnsRecordAsync(GlobalDnsRecord record) {
     this.UpdateDnsRecordAsync(record, null);
 }
Пример #9
0
 /// <remarks/>
 public System.IAsyncResult BeginUpdateDnsRecord(GlobalDnsRecord record, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("UpdateDnsRecord", new object[] {
                 record}, callback, asyncState);
 }
Пример #10
0
 public int UpdateDnsRecord(GlobalDnsRecord record) {
     object[] results = this.Invoke("UpdateDnsRecord", new object[] {
                 record});
     return ((int)(results[0]));
 }
Пример #11
0
 /// <remarks/>
 public void AddDnsRecordAsync(GlobalDnsRecord record) {
     this.AddDnsRecordAsync(record, null);
 }