コード例 #1
0
        private static GenericValidator ValidateControl(LeaseType model)
        {
            var gVal = new GenericValidator();

            try
            {
                if (string.IsNullOrEmpty(model.Name.Trim()))
                {
                    gVal.Error = "Please enter Lease Type Name.";
                    gVal.Code  = 0;
                    return(gVal);
                }
                //if (string.IsNullOrEmpty(model.Description.Trim()))
                //{
                //    gVal.Error = "Please provide Incident Description.";
                //    gVal.Code = 0;
                //    return gVal;
                //}

                gVal.Code = 1;
                return(gVal);
            }
            catch (Exception)
            {
                gVal.Error = "Process validation failed. Please supply all required fields and try again.";
                gVal.Code  = 0;
                return(gVal);
            }
        }
コード例 #2
0
ファイル: Lease.cs プロジェクト: ydk2/DnsServer
        internal Lease(BinaryReader bR)
        {
            switch (bR.ReadByte())
            {
            case 1:
                _type             = (LeaseType)bR.ReadByte();
                _clientIdentifier = DhcpOption.Parse(bR.BaseStream) as ClientIdentifierOption;
                _clientIdentifier.ParseOptionValue();

                _hostName = bR.ReadShortString();
                if (_hostName == "")
                {
                    _hostName = null;
                }

                _hardwareAddress = bR.ReadBuffer();
                _address         = IPAddressExtension.Parse(bR);
                _leaseObtained   = bR.ReadDate();
                _leaseExpires    = bR.ReadDate();
                break;

            default:
                throw new InvalidDataException("Lease data format version not supported.");
            }
        }
コード例 #3
0
        public int AddLeaseTypeCheckDuplicate(LeaseType leaseType)
        {
            try
            {
                if (leaseType == null)
                {
                    return(-2);
                }
                using (var db = new DPRDataMigrationEngineDBEntities())
                {
                    if (db.LeaseTypes.Any())
                    {
                        if (db.LeaseTypes.Count(m => m.Name.ToLower().Replace(" ", string.Empty) == leaseType.Name.ToLower().Replace(" ", string.Empty)) > 0)
                        {
                            return(-3);
                        }
                    }

                    var processedItem = db.LeaseTypes.Add(leaseType);
                    db.SaveChanges();
                    return(processedItem.LeaseTypeId);
                }
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                return(0);
            }
        }
コード例 #4
0
        public int GetLeaseTypeIdByName(string leaseTypeName)
        {
            try
            {
                using (var db = new DPRDataMigrationEngineDBEntities())
                {
                    var myObj = db.LeaseTypes.Where(s => s.Name.Trim().ToLower().Replace(" ", "") == leaseTypeName.Trim().ToLower().Replace(" ", "")).ToList();
                    if (!myObj.Any())
                    {
                        var newLeaseType = new LeaseType
                        {
                            Name = leaseTypeName
                        };

                        var processedLeaseType = db.LeaseTypes.Add(newLeaseType);
                        db.SaveChanges();
                        return(processedLeaseType.LeaseTypeId);
                    }

                    return(myObj[0].LeaseTypeId);
                }
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                return(0);
            }
        }
コード例 #5
0
        private IEnumerator <IAsyncResult> AcquireLeaseImpl(LeaseType leaseType, TimeSpan leaseDuration, Guid?proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.InternalContainer.BeginAcquireLease(leaseType, leaseDuration, proposedLeaseId, Helpers.Convert(condition), updateLastModificationTime, useContainerNotFoundError, context.GetResumeCallback(), context.GetResumeState("BaseBlobContainer.AcquireLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.InternalContainer.EndAcquireLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
コード例 #6
0
        public int UpdateLeaseTypeCheckDuplicate(LeaseType leaseType)
        {
            try
            {
                if (leaseType == null)
                {
                    return(-2);
                }
                using (var db = new DPRDataMigrationEngineDBEntities())
                {
                    if (db.LeaseTypes.Any())
                    {
                        if (db.LeaseTypes.Count(m => m.Name.ToLower().Replace(" ", string.Empty) == leaseType.Name.ToLower().Replace(" ", string.Empty) && m.LeaseTypeId != leaseType.LeaseTypeId) > 0)
                        {
                            return(-3);
                        }
                    }

                    db.LeaseTypes.Attach(leaseType);
                    db.Entry(leaseType).State = EntityState.Modified;
                    return(db.SaveChanges());
                }
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);

                return(0);
            }
        }
コード例 #7
0
        private IEnumerator <IAsyncResult> RenewLeaseImpl(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IBlobObjectCondition condition, AsyncIteratorContext <NoResults> context)
        {
            IAsyncResult asyncResult;

            try
            {
                asyncResult = this.blob.BeginRenewLease(leaseType, leaseId, leaseDuration, Helpers.Convert(condition), context.GetResumeCallback(), context.GetResumeState("BaseBlobObject.RenewLeaseImpl"));
            }
            catch (Exception exception)
            {
                StorageStamp.TranslateException(exception);
                throw;
            }
            yield return(asyncResult);

            try
            {
                this.blob.EndRenewLease(asyncResult);
            }
            catch (Exception exception1)
            {
                StorageStamp.TranslateException(exception1);
                throw;
            }
        }
コード例 #8
0
        public IAsyncResult BeginAcquireLease(LeaseType leaseType, TimeSpan leaseDuration, Guid?proposedLeaseId, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state)
        {
            AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("BaseBlobContainer.AcquireLease", callback, state);

            asyncIteratorContext.Begin(this.AcquireLeaseImpl(leaseType, leaseDuration, proposedLeaseId, condition, updateLastModificationTime, useContainerNotFoundError, asyncIteratorContext));
            return(asyncIteratorContext);
        }
コード例 #9
0
        public IAsyncResult BeginRenewLease(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IBlobObjectCondition condition, AsyncCallback callback, object state)
        {
            AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("RealBlobObject.RenewLease", callback, state);

            asyncIteratorContext.Begin(this.RenewLeaseImpl(leaseType, leaseId, leaseDuration, condition, asyncIteratorContext));
            return(asyncIteratorContext);
        }
コード例 #10
0
        private void LeaseTypeComboBox_SelectionChangedHandler(object sender, SelectionChangedEventArgs e)
        {
            FrameworkElement selectedItem = LeaseTypeComboBox.SelectedItem as FrameworkElement;

            LeaseTypeComboBox.ToolTip = selectedItem?.ToolTip ?? "Unknown Selection";

            string    data = selectedItem?.DataContext as string;
            LeaseType previousLeaseType = Settings.LeaseType;

            switch (data)
            {
            case nameof(LeaseType.CloudSqlStorage):
                Settings.LeaseType = LeaseType.CloudSqlStorage;
                break;

            case nameof(LeaseType.LocalDiskStorage):
                Settings.LeaseType = LeaseType.LocalDiskStorage;
                break;

            default:
                Settings.LeaseType = LeaseType.AzureStorageAccount;
                break;
            }

            if (previousLeaseType != Settings.LeaseType)
            {
                RestartReaders();
            }
        }
コード例 #11
0
        public static IList <LeaseType> GetLeaseTypes()
        {
            DataGateWay       access = new DataGateWay(connectionName);
            IList <LeaseType> Types  = new List <LeaseType>();

            string sql = @"use InlandMarina
                           SELECT * FROM LeaseType";

            LeaseType type = null;

            try
            {
                using (var reader = access.ExecuteQuery(sql, null, CommandType.Text))
                {
                    while (reader.Read())
                    {
                        type = new LeaseType()
                        {
                            ID   = reader.GetInt32(reader.GetOrdinal("ID")),
                            Name = reader.GetString(reader.GetOrdinal("Name")),
                            StandardRateAmount = reader.GetDecimal(reader.GetOrdinal("StandardRateAmount"))
                        };
                        Types.Add(type);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error retrieving data from database !", ex);
            }
            return(Types);
        }
コード例 #12
0
        public ActionResult DeleteLeaseType(int id)
        {
            var incidentType = new LeaseType();

            try
            {
                if (id < 1)
                {
                    incidentType.Error     = "Invalid Selection";
                    incidentType.ErrorCode = 0;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }
                if (new LeaseTypeServices().DeleteLeaseTypeCheckReferences(id))
                {
                    incidentType.Error     = "Lease Type Information was successfully deleted.";
                    incidentType.ErrorCode = 1;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                incidentType.Error     = "Process Failed! Please try again later";
                incidentType.ErrorCode = 0;
                return(Json(incidentType, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                incidentType.Error     = "An unknown error was encountered. Please contact the Administrator or try again later.";
                incidentType.ErrorCode = 0;
                return(Json(incidentType, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #13
0
        public ActionResult EditLeaseType(int id)
        {
            var incidentType = new LeaseType();

            try
            {
                if (id < 1)
                {
                    incidentType.Error     = "Invalid Selection!";
                    incidentType.ErrorCode = -1;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                var myViewObj = new LeaseTypeServices().GetLeaseType(id);

                if (myViewObj == null || myViewObj.LeaseTypeId < 1)
                {
                    incidentType.Error     = "Lease Type Information could not be retrieved.";
                    incidentType.ErrorCode = -1;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }
                Session["_product"] = myViewObj;
                myViewObj.ErrorCode = myViewObj.LeaseTypeId;
                return(Json(myViewObj, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                incidentType.Error     = "An unknown error was LeaseType Information could not be retrieved.";
                incidentType.ErrorCode = -1;
                return(Json(incidentType, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #14
0
        private void SetLeaseState()
        {
            switch (this.m_container.LeaseState)
            {
            case 0:
            {
                this.m_LeaseState = new LeaseState?(LeaseState.Available);
                this.m_LeaseType  = LeaseType.None;
                return;
            }

            case 1:
            {
                if (this.m_container.LeaseEndTime.Value <= this.m_InfoValidAt)
                {
                    this.m_LeaseState = new LeaseState?(LeaseState.Expired);
                    this.m_LeaseType  = LeaseType.None;
                    return;
                }
                this.m_LeaseState = new LeaseState?(LeaseState.Leased);
                this.m_LeaseType  = LeaseType.ReadWrite;
                return;
            }

            case 2:
            {
                this.m_LeaseState = new LeaseState?(LeaseState.Expired);
                this.m_LeaseType  = LeaseType.None;
                return;
            }

            case 3:
            {
                if (this.m_container.LeaseEndTime.Value <= this.m_InfoValidAt)
                {
                    this.m_LeaseState = new LeaseState?(LeaseState.Broken);
                    this.m_LeaseType  = LeaseType.None;
                    return;
                }
                this.m_LeaseState = new LeaseState?(LeaseState.Breaking);
                this.m_LeaseType  = LeaseType.ReadWrite;
                return;
            }

            case 4:
            {
                this.m_LeaseState = new LeaseState?(LeaseState.Broken);
                this.m_LeaseType  = LeaseType.None;
                return;
            }

            default:
            {
                return;
            }
            }
        }
コード例 #15
0
ファイル: Lease.cs プロジェクト: ydk2/DnsServer
        internal Lease(LeaseType type, ClientIdentifierOption clientIdentifier, string hostName, byte[] hardwareAddress, IPAddress address, uint leaseTime)
        {
            _type             = type;
            _clientIdentifier = clientIdentifier;
            _hostName         = hostName;
            _hardwareAddress  = hardwareAddress;
            _address          = address;
            _leaseObtained    = DateTime.UtcNow;

            ExtendLease(leaseTime);
        }
コード例 #16
0
        public ActionResult AddLeaseType(LeaseType leaseType)
        {
            ModelState.Clear();
            ViewBag.LoadStatus = "0";
            try
            {
                if (!ModelState.IsValid)
                {
                    leaseType.Error     = "Please supply all required fields and try again";
                    leaseType.ErrorCode = -1;
                    return(Json(leaseType, JsonRequestBehavior.AllowGet));
                }

                var wx = ValidateControl(leaseType);

                if (wx.Code < 1)
                {
                    leaseType.Error     = wx.Error;
                    leaseType.ErrorCode = -1;
                    return(Json(leaseType, JsonRequestBehavior.AllowGet));
                }

                leaseType.Name = leaseType.Name;
                var k = new LeaseTypeServices().AddLeaseTypeCheckDuplicate(leaseType);
                if (k < 1)
                {
                    if (k == -3)
                    {
                        leaseType.Error     = "Lease Type already exists";
                        leaseType.ErrorCode = -3;
                        return(Json(leaseType, JsonRequestBehavior.AllowGet));
                    }

                    leaseType.Error     = "Process Failed! Please contact the Admin or try again later";
                    leaseType.ErrorCode = 0;
                    return(Json(leaseType, JsonRequestBehavior.AllowGet));
                }

                leaseType.Error       = "Record was added successfully";
                leaseType.ErrorCode   = 1;
                leaseType.LeaseTypeId = k;
                return(Json(leaseType, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                leaseType.Error     = "An unknown error was encountered. Request could not be serviced. Please try again later.";
                leaseType.ErrorCode = 0;
                return(Json(leaseType, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #17
0
ファイル: AdvertService.cs プロジェクト: onurid/lemoras
        public Room AddRoom(
            int advertId,
            string title,
            string description,
            RoomType roomType,
            IEnumerable <string> urls,
            LeaseType leaseType,
            decimal rentalFee)
        {
            var advert = Load(advertId);
            var room   = advert.House.AddRoom(title, description, roomType, leaseType, rentalFee);

            foreach (var url in urls)
            {
                room.AddRoomImage(url);
            }

            return(room);
        }
コード例 #18
0
 private IEnumerator <IAsyncResult> RenewLeaseImpl(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IContainerCondition condition, bool updateLastModificationTime, AsyncIteratorContext <NoResults> context)
 {
     //
     // Current member / type: System.Collections.Generic.IEnumerator`1<System.IAsyncResult> Microsoft.WindowsAzure.DevelopmentStorage.Store.DbBlobContainer::RenewLeaseImpl(Microsoft.Cis.Services.Nephos.Common.Storage.LeaseType,System.Guid,System.TimeSpan,Microsoft.Cis.Services.Nephos.Common.Storage.IContainerCondition,System.Boolean,AsyncHelper.AsyncIteratorContext`1<AsyncHelper.NoResults>)
     // File path: C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\Microsoft.Azure.DevelopmentStorage.Store.dll
     //
     // Product version: 2017.3.1005.3
     // Exception in: System.Collections.Generic.IEnumerator<System.IAsyncResult> RenewLeaseImpl(Microsoft.Cis.Services.Nephos.Common.Storage.LeaseType,System.Guid,System.TimeSpan,Microsoft.Cis.Services.Nephos.Common.Storage.IContainerCondition,System.Boolean,AsyncHelper.AsyncIteratorContext<AsyncHelper.NoResults>)
     //
     // The given key was not present in the dictionary.
     //    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
     //    at ›..() in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 61
     //    at ›..() in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 35
     //    at ›..œ(DecompilationContext ™, •Ÿ €–) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\GotoElimination\GotoCancelation.cs:line 26
     //    at ‚–.™“.(MethodBody €–, •Ÿ Ÿ, ILanguage ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 88
     //    at ‚–.™“.‹(MethodBody €–, ILanguage ) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 70
     //    at Telerik.JustDecompiler.Decompiler.Extensions.›“(™“ œ“, ILanguage , MethodBody €–, DecompilationContext& ™) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 95
     //    at Telerik.JustDecompiler.Decompiler.Extensions.š“(MethodBody €–, ILanguage , DecompilationContext& ™,  œ–) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 58
     //    at ——.ƒ˜.—(ILanguage , MethodDefinition €,  œ–) in C:\Builds\556\Behemoth\ReleaseBranch Production Build NT\Sources\OpenSource\Cecil.Decompiler\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 117
     //
     // mailto: [email protected]
 }
コード例 #19
0
ファイル: Lease.cs プロジェクト: Cossey/DnsServer
        internal Lease(BinaryReader bR)
        {
            byte version = bR.ReadByte();

            switch (version)
            {
            case 1:
            case 2:
                _type             = (LeaseType)bR.ReadByte();
                _clientIdentifier = DhcpOption.Parse(bR.BaseStream) as ClientIdentifierOption;
                _clientIdentifier.ParseOptionValue();

                _hostName = bR.ReadShortString();
                if (string.IsNullOrWhiteSpace(_hostName))
                {
                    _hostName = null;
                }

                _hardwareAddress = bR.ReadBuffer();
                _address         = IPAddressExtension.Parse(bR);

                if (version >= 2)
                {
                    _comments = bR.ReadShortString();
                    if (string.IsNullOrWhiteSpace(_comments))
                    {
                        _comments = null;
                    }
                }

                _leaseObtained = bR.ReadDateTime();
                _leaseExpires  = bR.ReadDateTime();
                break;

            default:
                throw new InvalidDataException("Lease data format version not supported.");
            }
        }
コード例 #20
0
 public abstract IAsyncResult BeginAcquireBlobLease(IAccountIdentifier identifier, string account, string container, string blob, LeaseType leaseType, TimeSpan leaseDuration, Guid?proposedLeaseId, BlobObjectCondition condition, TimeSpan timeout, RequestContext requestContext, AsyncCallback callback, object state);
コード例 #21
0
 internal Lease(LeaseType type, string hostName, DhcpMessageHardwareAddressType hardwareAddressType, string hardwareAddress, IPAddress address, string comments)
     : this(type, hostName, hardwareAddressType, ParseHardwareAddress(hardwareAddress), address, comments)
 {
 }
コード例 #22
0
 internal Lease(LeaseType type, string hostName, DhcpMessageHardwareAddressType hardwareAddressType, byte[] hardwareAddress, IPAddress address, string comments)
     : this(type, new ClientIdentifierOption((byte)hardwareAddressType, hardwareAddress), hostName, hardwareAddress, address, comments, 0)
 {
 }
コード例 #23
0
        IAsyncResult Microsoft.Cis.Services.Nephos.Common.Storage.IBaseBlobContainer.BeginRenewLease(LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, IContainerCondition condition, bool updateLastModificationTime, bool useContainerNotFoundError, AsyncCallback callback, object state)
        {
            AsyncIteratorContext <NoResults> asyncIteratorContext = new AsyncIteratorContext <NoResults>("DbBlobContainer.RenewLease", callback, state);

            asyncIteratorContext.Begin(this.RenewLeaseImpl(leaseType, leaseId, leaseDuration, condition, updateLastModificationTime, asyncIteratorContext));
            return(asyncIteratorContext);
        }
コード例 #24
0
ファイル: Lease.cs プロジェクト: Cossey/DnsServer
 internal void ConvertToReserved()
 {
     _type = LeaseType.Reserved;
 }
コード例 #25
0
ファイル: Lease.cs プロジェクト: Cossey/DnsServer
 internal void ConvertToDynamic()
 {
     _type = LeaseType.Dynamic;
 }
コード例 #26
0
ファイル: Lease.cs プロジェクト: ydk2/DnsServer
 internal Lease(LeaseType type, string hostName, byte[] hardwareAddress, IPAddress address)
     : this(type, new ClientIdentifierOption(1, hardwareAddress), hostName, hardwareAddress, address, 0)
 {
 }
コード例 #27
0
        public ActionResult EditLeaseType(LeaseType incidentType)
        {
            ModelState.Clear();
            ViewBag.LoadStatus = "0";
            try
            {
                if (Session["_product"] == null)
                {
                    incidentType.Error     = "Session has expired";
                    incidentType.ErrorCode = 0;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                var oldLeaseType = Session["_product"] as LeaseType;

                if (oldLeaseType == null || oldLeaseType.LeaseTypeId < 1)
                {
                    incidentType.Error     = "Session has expired";
                    incidentType.ErrorCode = 0;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                if (!ModelState.IsValid)
                {
                    incidentType.Error     = "Please supply all required fields and try again";
                    incidentType.ErrorCode = -1;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                var wx = ValidateControl(incidentType);

                if (wx.Code < 1)
                {
                    incidentType.Error     = wx.Error;
                    incidentType.ErrorCode = -1;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                oldLeaseType.Name        = incidentType.Name.Trim();
                oldLeaseType.Description = incidentType.Description.Trim();

                var k = new LeaseTypeServices().UpdateLeaseTypeCheckDuplicate(oldLeaseType);
                if (k < 1)
                {
                    if (k == -3)
                    {
                        incidentType.Error     = "Lease Type already exists";
                        incidentType.ErrorCode = 0;
                        return(Json(incidentType, JsonRequestBehavior.AllowGet));
                    }

                    incidentType.Error     = "Process Failed! Please contact the Admin or try again later";
                    incidentType.ErrorCode = 0;
                    return(Json(incidentType, JsonRequestBehavior.AllowGet));
                }

                incidentType.Error     = "Lease Type Information was successfully updated";
                incidentType.ErrorCode = 1;
                return(Json(incidentType, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                ErrorLogger.LogEror(ex.StackTrace, ex.Source, ex.Message);
                incidentType.Error     = "An unknown error was encountered. Request could not be serviced. Please try again later.";
                incidentType.ErrorCode = 0;
                return(Json(incidentType, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #28
0
ファイル: Lease.cs プロジェクト: ydk2/DnsServer
 internal Lease(LeaseType type, string hostName, string hardwareAddress, IPAddress address)
     : this(type, hostName, ParseHardwareAddress(hardwareAddress), address)
 {
 }
コード例 #29
0
 public abstract IAsyncResult BeginRenewContainerLease(IAccountIdentifier identifier, string account, string container, LeaseType leaseType, Guid leaseId, TimeSpan leaseDuration, ContainerCondition condition, TimeSpan timeout, RequestContext requestContext, AsyncCallback callback, object state);