Exemplo n.º 1
0
        public AdditionalInfo UndoCheckOut(Guid contentId)
        {
            var undoCheckOutInfo = new AdditionalInfo();

            try
            {
                PublicApi.Documents.UndoCheckOut(EnsureLibraryId(contentId), new DocumentGetOptions(contentId));
            }
            catch (InvalidOperationException ex)
            {
                undoCheckOutInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.InvalidId, contentId)));
            }
            catch (SPInternalException ex)
            {
                undoCheckOutInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.CannotBeCheckedIn, contentId)));
            }
            catch (Exception ex)
            {
                string message = string.Format("An exception of type {0} occurred in the WidgetApi.V2.SharePointFile.CheckOut() method ContentId: {1}. The exception message is: {2}", ex.GetType(), contentId, ex.Message);
                SPLog.UnKnownError(ex, message);
                undoCheckOutInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.UnknownError)));
            }

            return(undoCheckOutInfo);
        }
        public void checkDefaultValue_LastModified()
        {
            AdditionalInfo ad = new AdditionalInfo();

            ad.LastModified = new DateTime();
            Assert.AreEqual(new DateTime(), ad.LastModified);
        }
        /// <summary>
        /// Returns true if ElectronicChannelIdentification instances are equal
        /// </summary>
        /// <param name="other">Instance of ElectronicChannelIdentification to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ElectronicChannelIdentification other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     Urls == other.Urls ||
                     Urls != null &&
                     Urls.SequenceEqual(other.Urls)
                 ));
        }
Exemplo n.º 4
0
        ///////////////////////////////////////////////////////////////////////////

        public void PrepareSave()
        {
            foreach (var ch in Channels)
            {
                ch.CompressImageData();
            }

            // Create or update the Unicode layer name to be consistent with the
            // ANSI layer name.
            var layerUnicodeNames = AdditionalInfo.Where(x => x is LayerUnicodeName);

            if (layerUnicodeNames.Count() > 1)
            {
                throw new PsdInvalidException("Layer has more than one LayerUnicodeName.");
            }

            var layerUnicodeName = (LayerUnicodeName)layerUnicodeNames.FirstOrDefault();

            if (layerUnicodeName == null)
            {
                layerUnicodeName = new LayerUnicodeName(Name);
                AdditionalInfo.Add(layerUnicodeName);
            }
            else if (layerUnicodeName.Name != Name)
            {
                layerUnicodeName.Name = Name;
            }
        }
Exemplo n.º 5
0
        public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc           = doc;
            _addiInfo      = addiInfo;
            _myLevel       = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems       = new List <PGItem>(4);

            _GypWalls     = new List <RichWall>(10);
            _GeneticWalls = new List <RichWall>(6);

            if (_addiInfo.requiredComp[(byte)PGComponents.GypWall] && _addiInfo.requiredComp[(byte)PGComponents.WallFinish])
            {
                _reportRule = ReportRule.Both;
            }
            else if (_addiInfo.requiredComp[(byte)PGComponents.GypWall])
            {
                _reportRule = ReportRule.Gyp;
            }
            else
            {
                _reportRule = ReportRule.Finish;
            }

            ExtractObjects();
            Process();
            return(_PGItems);
        }
        public void ArchiveAdditionalInfo()
        {
            var infoRepo   = GetAdditionalInfoRepo("Info_ProdTestDb", "Info_ArchTestDb");
            var sourceRepo = GetSourceRepo("Info_ProdTestDb");
            var typeRepo   = GetTypeRepo("Info_ProdTestDb");
            var stateRepo  = GetStateRepo("Info_ProdTestDb");
            var eventRepo  = GetEventRepo("Info_ProdTestDb", "Info_ArchTestDb");

            var checkType = CheckType.Mock();

            typeRepo.CreateType(checkType);
            var state = State.Mock();

            stateRepo.CreateState(state);
            var source = Source.Mock(checkType, state);

            sourceRepo.CreateSource(source);
            var @event = Event.Mock(checkType, state, source);

            eventRepo.CreateEvent(@event);
            var info = AdditionalInfo.Mock();

            info.Event = @event;
            infoRepo.CreateAdditionalInfo(info);

            infoRepo.ArchiveAdditionalInfo(info, @event.Id);
        }
Exemplo n.º 7
0
        public static List <PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc           = doc;
            _addiInfo      = addiInfo;
            _myLevel       = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems       = new List <PGItem>(4);
            _Storefronts   = new List <Wall>(10);
            _isSetPGItem   = new bool[4];

            double Price         = addiInfo.prices[(byte)PGComponents.Storefront];
            bool   IfDefinePrice = Price == 0.0 ? false : true;

            string[]    temp_code = { "B2023.001", "B2023.002" };
            Direction[] temp_dire = { Direction.X, Direction.Y };
            for (int i = 0; i < 2; ++i)
            {
                for (int j = 0; j < 2; ++j)
                {
                    PGItem pgItem = new PGItem();
                    pgItem.Code          = temp_code[i];
                    pgItem.direction     = temp_dire[j];
                    pgItem.PGName        = "店面";
                    pgItem.PinYinSuffix  = "DianMian";
                    pgItem.IfDefinePrice = IfDefinePrice;
                    pgItem.Price         = Price;

                    _PGItems.Add(pgItem);
                }
            }

            ExtractObjects();
            Process();
            return(_PGItems);
        }
Exemplo n.º 8
0
        public AdditionalInfo Delete(Guid libraryId, bool deleteLibrary)
        {
            var errorInfo = new AdditionalInfo();

            try
            {
                var library = PublicApi.Libraries.Get(new LibraryGetOptions(libraryId));
                PublicApi.Libraries.Delete(library, deleteLibrary);
            }
            catch (InvalidOperationException ex)
            {
                errorInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointLibraryExtension.Translations.InvalidId, libraryId)));
            }
            catch (SPInternalException ex)
            {
                // The library has been already deleted
                errorInfo = new AdditionalInfo(new Error(ex.GetType().ToString(), plugin.Translate(SharePointLibraryExtension.Translations.NotFoundBecauseDeleted, libraryId)));
            }
            catch (Exception ex)
            {
                string message = string.Format("An exception of type {0} occurred in the WidgetApi.V2.SharePointLibrary.Delete() method for LibraryId: {1}. The exception message is: {2}", ex.GetType(), libraryId, ex.Message);
                SPLog.UnKnownError(ex, message);
                errorInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointLibraryExtension.Translations.UnknownError)));
            }

            return(errorInfo);
        }
Exemplo n.º 9
0
        public AdditionalInfo GetAdditionalInfoByUserId(int id)
        {
            //string connectionString = @"Data Source=DESKTOP-AGFJ699\SQLSERVER;Initial Catalog=BitBook;Integrated Security=true";

            SqlConnection connection = new SqlConnection(connectionString);


            string query = "SELECT * FROM AdditionalInfo WHERE UserId=" + id;

            SqlCommand command = new SqlCommand(query, connection);

            AdditionalInfo aInfo = null;

            connection.Open();

            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                aInfo = new AdditionalInfo();

                aInfo.UserId = Convert.ToInt32(reader["UserId"].ToString());

                aInfo.ProfilePhoto = reader["ProfilePhoto"].ToString();
                aInfo.CoverPhoto   = reader["CoverPhoto"].ToString();
                aInfo.Gender       = reader["Gender"].ToString();
                aInfo.Education    = reader["Education"].ToString();
                aInfo.Location     = reader["Location"].ToString();
            }
            connection.Close();

            return(aInfo);
        }
Exemplo n.º 10
0
 public PFireSprinkler(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(200);
     _mepComp  = MEPComponents.FireSprinkler;
     _mepRecog = new FireSprinkler();
 }
Exemplo n.º 11
0
        internal static Suppression GenerateSuppression(AdditionalInfo additionalInfo)
        {
            // If this sentinel key does not exist, we have no suppression data.
            if (!additionalInfo.ContainsKey("SuppressedMatch"))
            {
                return(null);
            }

            additionalInfo.TryGetValue("HashKey", out string hashKey);
            additionalInfo.TryGetValue("MatchingScore", out string matchingScore);
            additionalInfo.TryGetValue("SuppressJustification", out string justification);

            var suppression = new Suppression
            {
                Kind          = SuppressionKind.External,
                Justification = justification
            };

            if (!string.IsNullOrEmpty(matchingScore))
            {
                suppression.SetProperty("MatchingScore", matchingScore);
            }

            if (!string.IsNullOrEmpty(hashKey))
            {
                suppression.SetProperty("HashKey", hashKey);
            }

            return(suppression);
        }
Exemplo n.º 12
0
        public void AddDocumentToReportResponse(string reposponseId, AdditionalInfo document)
        {
            if (_currentTask.TaskReport.Find(t => t._id == _reportId) != null)
            {
                _currentReport = _currentTask.TaskReport.Find(t => t._id == _reportId);
            }
            else
            {
                throw new InvalidOperationException("не могу добавить ответ на отчет к несуществующему отчету");
            }

            if (_currentReport.ReportResponse == null)
            {
                _currentReport.ReportResponse = new ReportResponse
                {
                    _id       = reposponseId,
                    ProjectId = _projectId,
                    TaskId    = _taskId,
                    ReportId  = _reportId,
                    Info      = new List <AdditionalInfo>()
                };
            }

            _currentReport.Info.Add(document);
            RepositoryContext.Current.Update(_currentProject);
        }
Exemplo n.º 13
0
        public AdditionalInfo Restore(Guid contentId, string version)
        {
            var restoreInfo = new AdditionalInfo();

            try
            {
                PublicApi.Documents.Restore(EnsureLibraryId(contentId), new DocumentRestoreOptions(contentId)
                {
                    Version = version
                });
            }
            catch (InvalidOperationException ex)
            {
                restoreInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.InvalidId, contentId)));
            }
            catch (SPInternalException ex)
            {
                restoreInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.NotFound, contentId)));
            }
            catch (Exception ex)
            {
                string message = string.Format("An exception of type {0} occurred in the WidgetApi.V2.SharePointFile.Restore() method ContentId: {1} Version: {2}. The exception message is: {3}", ex.GetType(), contentId, version, ex.Message);
                SPLog.UnKnownError(ex, message);
                restoreInfo.Errors.Add(new Error(ex.GetType().ToString(), plugin.Translate(SharePointFileExtension.Translations.UnknownError)));
            }
            return(restoreInfo);
        }
Exemplo n.º 14
0
 public PHVACFan(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(100);
     _mepComp  = MEPComponents.HVACFan;
     _mepRecog = new HVACFanRecognizer();
 }
Exemplo n.º 15
0
        public ActionResult EditAdditionalInfo()
        {
            int            id             = Convert.ToInt32(Session["UserId"]);
            AdditionalInfo additionalInfo = aManager.GetAdditionalInfoByUserId(id);

            return(View(additionalInfo));
        }
Exemplo n.º 16
0
 public PBatteryRack(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(20);
     _mepComp  = MEPComponents.BatteryRack;
     _mepRecog = new BatteryRackRecognizer();
 }
        public void InvalidAdditionalInfoValuesShouldReturnBadRequest()
        {
            var controller = GetFunctionalEventController("info", "info");
            var result     = controller.CreateAdditionalInfo(AdditionalInfo.Mock(), Event.Mock(CheckType.Mock(), State.Mock(), Source.Mock(CheckType.Mock(), State.Mock())).Id);

            Assert.IsType <BadRequestResult>(result);
        }
        public static DateTimeBoundary <bool> GetFeature(this IEnumerable <AdditionalInfo> items)
        {
            AdditionalInfo          result  = items.GetInfosByClass(AdditionalInfoClass.Feature).FirstOrDefault();
            DateTimeBoundary <bool> feature = new DateTimeBoundary <bool>();

            if (result != null)
            {
                feature.Id        = result.Id;
                feature.StartDate = result.StartDate;
                feature.EndDate   = result.EndDate;
                DateTime now       = DateTime.Now;
                DateTime?startDate = result.StartDate;
                int      status;
                if (now >= startDate)
                {
                    now       = DateTime.Now;
                    startDate = result.EndDate;
                    status    = ((now <= startDate) ? 1 : 0);
                }
                else
                {
                    status = 0;
                }
                feature.Status = (byte)status != 0;
            }
            return(feature);
        }
Exemplo n.º 19
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = AlertID;
         hashCode = (hashCode * 397) ^ Code;
         hashCode = (hashCode * 397) ^ (Source != null ? Source.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Severity != null ? Severity.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Created.GetHashCode();
         hashCode = (hashCode * 397) ^ SnoozedEndDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (ThresholdValue1 != null ? ThresholdValue1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue2 != null ? ThresholdValue2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue3 != null ? ThresholdValue3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue4 != null ? ThresholdValue4.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ThresholdValue5 != null ? ThresholdValue5.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeviceGuid != null ? DeviceGuid.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AdditionalInfo != null ? AdditionalInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AlertCategoryID != null ? AlertCategoryID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Archived.GetHashCode();
         hashCode = (hashCode * 397) ^ ArchivedDate.GetHashCode();
         hashCode = (hashCode * 397) ^ TicketID.GetHashCode();
         hashCode = (hashCode * 397) ^ (AlertMessage != null ? AlertMessage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DeviceName != null ? DeviceName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomerID;
         hashCode = (hashCode * 397) ^ (CustomerName != null ? CustomerName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MessageTemplate != null ? MessageTemplate.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ FolderID.GetHashCode();
         hashCode = (hashCode * 397) ^ PollingCyclesCount.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 20
0
        static void Main(string[] args)
        {
        	//Eid: 1111 Replace with your eid. You can find it in Billmate-Online
        	//Secret: 111111111111 Replace with your secret. You can find it in Billmate-Online
        	//SSL: false SSl should be enabled or not
        	//Debug: true View more detailed information about the server communication
        	//Invoiceid: 111 View more detailed information about the server communication
        	//Personal number: 556000-0753
        	
            Console.WriteLine("Start");
            Billmate bm = new Billmate(1111, "111111111111", false, true);
            Address adress = new Address("*****@*****.**", "0760123456", "0760123456", "Test.net", "test api", "streetname no", "zipcode", "city", 209);
            AdditionalInfo ai = new AdditionalInfo("");

            Article[] articles = new Article[3];
            articles[0] = new Article(1, "VGN-TXN27N/B", "Sony VAIO VGN-TXN27N/B 11.1 Notebook PC", 337499, 25, 0, 32);
            articles[1] = new Article(1, "flatrate_flatrate", "Frakt - Fixed", 6250, 25, 0, 40);
            articles[2] = new Article(1, "invoice_fee", "Faktureringsavgift", 3625, 25, 0, 48);
            object[] result = (object[])bm.ActivateReservation("111", "556000-0753", adress, adress, articles, ai);

            foreach (object row in result)
            {
                Console.WriteLine(row.ToString());
            }

            Console.ReadLine();
        }
Exemplo n.º 21
0
        //public AdditionalInfo Get(int id)
        //{
        //    using (EmployeeDBContext dbContext = new EmployeeDBContext())
        //    {
        //        return dbContext.AdditionalInfoes.FirstOrDefault(e => e.AdditionalInfo_Id == id);
        //    }
        //}
        public object Post([FromBody] AdditionalInfo employee)
        {
            try
            {
                using (myGenieNetworkDBEntities1 dbContext = new myGenieNetworkDBEntities1())
                {
                    dbContext.AdditionalInfoes.Add(employee);
                    dbContext.SaveChanges();

                    // var message = Request.CreateResponse(HttpStatusCode.Created, employee);
                    // message.Headers.Location = new Uri(Request.RequestUri +
                    // employee.AdditionalInfo_Id.ToString());


                    Message message = new Message();
                    message.Status = "details added";



                    return(message.Status);
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
                //throw new MyCustomException("message");
            }
        }
Exemplo n.º 22
0
        public static DateTimeBoundary <bool> GetFeature(this IEnumerable <AdditionalInfo> items)
        {
            !0 valueOrDefault;
            AdditionalInfo          result  = items.GetInfosByClass(AdditionalInfoClass.Feature).FirstOrDefault <AdditionalInfo>();
            DateTimeBoundary <bool> feature = new DateTimeBoundary <bool>();

            if (result != null)
            {
                feature.Id        = result.Id;
                feature.StartDate = result.StartDate;
                feature.EndDate   = result.EndDate;
                DateTimeBoundary <bool> dateTimeBoundary = feature;
                DateTime now       = DateTime.Now;
                DateTime?startDate = result.StartDate;
                if ((startDate.HasValue ? now < startDate.GetValueOrDefault() : true))
                {
                    valueOrDefault = 0;
                }
                else
                {
                    now       = DateTime.Now;
                    startDate = result.EndDate;
                    if (startDate.HasValue)
                    {
                        valueOrDefault = now <= startDate.GetValueOrDefault();
                    }
                    else
                    {
                        valueOrDefault = 0;
                    }
                }
                dateTimeBoundary.Status = valueOrDefault;
            }
            return(feature);
        }
Exemplo n.º 23
0
        public ActionResult ChangeProfilePhoto(HttpPostedFileBase file)
        {
            try
            {
                string filename = System.IO.Path.GetFileName(file.FileName);

                file.SaveAs(Server.MapPath("~/Images/" + filename));
                string filepathtosave = "Images/" + filename;

                AdditionalInfo aiInfo = new AdditionalInfo();
                aiInfo.UserId       = Convert.ToInt32(Session["UserId"]);
                aiInfo.ProfilePhoto = filepathtosave;


                aManager.UpdateProfilePhoto(aiInfo);

                ViewBag.Message = "File Uploaded successfully.";
                return(RedirectToAction("LoggedIn"));
            }
            catch
            {
                ViewBag.Message = "Error while uploading the files.";
            }
            return(View());
        }
Exemplo n.º 24
0
 public PDieselGen(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(20);
     _mepComp  = MEPComponents.DieselGen;
     _mepRecog = new DieselGenRecognizer();
 }
        /// <summary>
        /// Returns true if BankingAccountDiscountEligibility instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingAccountDiscountEligibility to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingAccountDiscountEligibility other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DiscountEligibilityType == other.DiscountEligibilityType ||
                     DiscountEligibilityType != null &&
                     DiscountEligibilityType.Equals(other.DiscountEligibilityType)
                     ) &&
                 (
                     AdditionalValue == other.AdditionalValue ||
                     AdditionalValue != null &&
                     AdditionalValue.Equals(other.AdditionalValue)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ) &&
                 (
                     AdditionalInfoUri == other.AdditionalInfoUri ||
                     AdditionalInfoUri != null &&
                     AdditionalInfoUri.Equals(other.AdditionalInfoUri)
                 ));
        }
Exemplo n.º 26
0
        public static List <AdditionalInfo> GetAdditionalInfo(this SqlDataReader reader)
        {
            List <AdditionalInfo> result = new List <AdditionalInfo>();

            while (reader.Read())
            {
                bool?isActive = reader.GetNullableValue <bool>("IsActive");
                if (!isActive.HasValue || !isActive.Value)
                {
                    continue;
                }
                AdditionalInfo item = new AdditionalInfo()
                {
                    Id                   = reader.GetNullableValue <long>("AdditionalInformationId"),
                    CommunityId          = reader.GetNullableValue <long>("CommunityId"),
                    CommunityUnitId      = reader.GetNullableValue <long>("CommunityUnitId"),
                    ServiceId            = reader.GetNullableValue <long>("ServiceId"),
                    AdditionalInfoClass  = reader.GetEnum <AdditionalInfoClass>("AdditionalInformationClassId"),
                    AdditionalInfoTypeId = reader.GetNullableValue <int>("AdditionalInformationTypeId"),
                    Description          = reader["Description"].ToString(),
                    ShortText            = reader["ShortText"].ToString(),
                    LongText             = reader["LongText"].ToString(),
                    StartDate            = reader.GetNullableValue <DateTime>("StartDate"),
                    EndDate              = reader.GetNullableValue <DateTime>("EndDate"),
                    Sequence             = (int)reader["Sequence"]
                };
                result.Add(item);
            }
            return(result);
        }
Exemplo n.º 27
0
 public PTransformer(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(100);
     _mepComp  = MEPComponents.Transformer;
     _mepRecog = new TransformerRecognizer();
 }
        /// <summary>
        /// Additional operations to be performed when cloning an instance of <see cref="AzureUtilizationRecord" /> to an instance of <see cref="PSAzureUtilizationRecord" />.
        /// </summary>
        /// <param name="utilizationRecord">The utilization record being cloned.</param>
        private void CloneAdditionalOperations(AzureUtilizationRecord utilizationRecord)
        {
            this.CopyFrom(utilizationRecord?.InstanceData);
            this.CopyFrom(utilizationRecord?.Resource);

            if (utilizationRecord?.InstanceData != null && utilizationRecord.InstanceData.AdditionalInfo != null)
            {
                foreach (KeyValuePair <string, string> item in utilizationRecord.InstanceData.AdditionalInfo)
                {
                    AdditionalInfo.Add(item);
                }
            }

            if (utilizationRecord?.InfoFields != null)
            {
                foreach (KeyValuePair <string, string> item in utilizationRecord.InfoFields)
                {
                    InfoFields.Add(item);
                }
            }

            if (utilizationRecord?.InstanceData != null && utilizationRecord.InstanceData.Tags != null)
            {
                foreach (KeyValuePair <string, string> item in utilizationRecord.InstanceData.Tags)
                {
                    Tags.Add(item);
                }
            }
        }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            var txtReport = new TxtReportBuider()
                            .WithHeader("header")
                            .WithBody("Body")
                            .WithFooter("Footer")
                            .GetReport();

            var director       = new ReportDirector(new TxtReportBuider());
            var txtEmptyReport = director.GetEmptyReport();

            director.ChangeBuilder(new HtmlReportBuilder());
            var htmlReport = director.GetReport("Header", "Body", "Footer");

            //Console.WriteLine(txtReport);
            //Console.WriteLine(txtEmptyReport);
            //Console.WriteLine(htmlReport);

            var bookInfo          = new AdditionalInfo(50, "Alan Wake");
            var book              = new Book("Max Payne", 100, bookInfo);
            var shallowClonedBook = (Book)book.ShallowClone();
            var deepClonedBook    = (Book)book.DeepClone();

            PrintBooksInfo(book, shallowClonedBook, deepClonedBook);

            book.Info.Author  = "Daria dontsova";
            book.Info.PageNum = 10;

            Console.WriteLine("\nAfter change of initial book:\n");

            PrintBooksInfo(book, shallowClonedBook, deepClonedBook);

            Console.ReadKey();
        }
Exemplo n.º 30
0
 public PCoolingTower(Document doc, AdditionalInfo addiInfo) : base(doc, addiInfo)
 {
     _PGItems  = new List <PGItem>(1);
     _equips   = new List <FamilyInstance>(20);
     _mepComp  = MEPComponents.CoolingTower;
     _mepRecog = new CoolingTowerRecognizer();
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (DiscountEligibilityType != null)
         {
             hashCode = hashCode * 59 + DiscountEligibilityType.GetHashCode();
         }
         if (AdditionalValue != null)
         {
             hashCode = hashCode * 59 + AdditionalValue.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (AdditionalInfoUri != null)
         {
             hashCode = hashCode * 59 + AdditionalInfoUri.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 32
0
 public PControlPanel(Document doc, AdditionalInfo addiInfo)
     : base(doc, addiInfo)
 {
     _PGItems = new List<PGItem>(1);
     _equips = new List<FamilyInstance>(100);
     _mepComp = MEPComponents.ControlPanel;
     _mepRecog = new ControlPanelRecognizer();
 }
Exemplo n.º 33
0
 public PFireSprinkler(Document doc, AdditionalInfo addiInfo)
     : base(doc, addiInfo)
 {
     _PGItems = new List<PGItem>(1);
     _equips = new List<FamilyInstance>(200);
     _mepComp = MEPComponents.FireSprinkler;
     _mepRecog = new FireSprinkler();
 }
Exemplo n.º 34
0
 public PMCC(Document doc, AdditionalInfo addiInfo)
     : base(doc, addiInfo)
 {
     _PGItems = new List<PGItem>(1);
     _equips = new List<FamilyInstance>(20);
     _mepComp = MEPComponents.MCC;
     _mepRecog = new MCCRecognizer();
 }
Exemplo n.º 35
0
 public PBatteryRack(Document doc, AdditionalInfo addiInfo)
     : base(doc, addiInfo)
 {
     _PGItems = new List<PGItem>(1);
     _equips = new List<FamilyInstance>(20);
     _mepComp = MEPComponents.BatteryRack;
     _mepRecog = new BatteryRackRecognizer();
 }
Exemplo n.º 36
0
 public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc = doc;
     _addiInfo = addiInfo;
     _myLevel = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _slabs = new List<Floor>(20);
     _PGItems = new List<PGItem>(10);
     ExtractObjects();
     Process();
     return _PGItems;
 }
Exemplo n.º 37
0
 public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
 {
     _doc = doc;
     _addiInfo = addiInfo;
     _myLevel = MyLevel.GetMyLevel();
     _abandonWriter = AbandonmentWriter.GetWriter();
     _PGItems = new List<PGItem>(1);
     _StruColumns = new List<ElementId>(50);
     _StruBeams = new List<ElementId>(150);
     ExtractObjects();
     Process();
     return _PGItems;
 }
Exemplo n.º 38
0
        static void Main(string[] args)
        {
            Console.WriteLine("Start");
            //Eid: 1111 Replace with your eid. You can find it in Billmate-Online
            //Secret: 111111111111 Replace with your secret. You can find it in Billmate-Online
            //SSL: false SSl should be enabled or not
            //Debug: true View more detailed information about the server communication
            //Invoiceid: 111 View more detailed information about the server communication
            
            Billmate bm = new Billmate(1111, "111111111111", false, true);
            AdditionalInfo ai = new AdditionalInfo("");

            string result = (string)bm.ActivateInvoice("111", ai);

            Console.WriteLine(result);
            Console.ReadLine();
        }
Exemplo n.º 39
0
        public static List<PGItem> GetPG(Document doc, AdditionalInfo addiInfo)
        {
            _doc = doc;
            _addiInfo = addiInfo;
            _myLevel = MyLevel.GetMyLevel();
            _abandonWriter = AbandonmentWriter.GetWriter();
            _PGItems = new List<PGItem>(4);

            _GypWalls = new List<RichWall>(10);
            _GeneticWalls = new List<RichWall>(6);

            if (_addiInfo.requiredComp[(byte)PGComponents.GypWall] && _addiInfo.requiredComp[(byte)PGComponents.WallFinish])
                _reportRule = ReportRule.Both;
            else if (_addiInfo.requiredComp[(byte)PGComponents.GypWall]) _reportRule = ReportRule.Gyp;
            else _reportRule = ReportRule.Finish;

            ExtractObjects();
            Process();
            return _PGItems;
        }
Exemplo n.º 40
0
        static void Main(string[] args)
        {
            //Eid: 1111 Replace with your eid. You can find it in Billmate-Online
            //Secret: 111111111111 Replace with your secret. You can find it in Billmate-Online
            //SSL: false SSl should be enabled or not
            //Debug: true View more detailed information about the server communication
            
            Console.WriteLine("Start");
            Billmate bm = new Billmate(1111, "111111111111", false, true);
            

            AdditionalInfo ai = new AdditionalInfo("0", "209", "138");

            object[] result = (object[])bm.FetchCampaigns(ai);

            foreach (object[] row in result)
            {
                foreach (object cell in row)
                    Console.WriteLine(cell.ToString());
            }

            Console.ReadLine();
        }
Exemplo n.º 41
0
 public PollVote(AdditionalInfo additionalInfo)
     : base(additionalInfo)
 {
 }
 public static void insertAdditionalInfo(AdditionalInfo info)
 {
     string sql = "insert into cvformat_additionalinfo(cvformatid,notes,userid,created) values (?cvformatid,?notes,?userid,?created)";
     DAO.ExecuteNonQuery(sql, new MySqlParameter("cvformatid", info.CVFormatId), new MySqlParameter("notes", info.Notes), new MySqlParameter("userid", info.UserId), new MySqlParameter("created", info.Created));
 }
Exemplo n.º 43
0
        public Result Execute(ExternalCommandData revit, ref string message, ElementSet elements)
        {
            ErrorWriter.SetWriter();
            ErrorWriter errorWriter = ErrorWriter.GetWriter();
            //FireProtectionColl fireProColl = new FireProtectionColl();
            try
            {
                //Get Doc
                UIDocument uidoc = revit.Application.ActiveUIDocument;
                Document doc = uidoc.Document;
                //Set Level
                FilteredElementCollector LevelCollector = new FilteredElementCollector(doc);
                ElementFilter LevelFilter = new ElementClassFilter(typeof(Level));
                LevelCollector.WherePasses(LevelFilter);
                MyLevel.SetMyLevel(LevelCollector);
                //IO
                DoOutput(doc);
                //fireProColl.OutputIN2(doc);
                Process process = Process.Start(PGPath.exeDirectory + "PGCreator.exe", PGPath.exeDirectory);
                process.WaitForExit();
                char[] outFile = IOHelper.Input("PGCTF.OUT");
                IOHelper.Output("1", "PGCTF.OUT");
                IOHelper.TryHideFile("PGCTF.OUT");
                //Process
                if (outFile[0] == '0')
                {
                    MEPHelper.ReadBinFile();
                    AdditionalInfo addiInfo = new AdditionalInfo(outFile);
                    MyLevel.AdjustLevels(addiInfo);
                    PGWriter.SetWriter(addiInfo);
                    AbandonmentWriter.SetWriter(addiInfo);
                    PGWriter pgWriter = PGWriter.GetWriter();

                    if (addiInfo.requiredComp[(byte)PGComponents.BeamColumnJoint])  pgWriter.UpdatePGs(PBeamColumnJoints.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.ShearWall])        pgWriter.UpdatePGs(PShearWall.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.GypWall]
                     || addiInfo.requiredComp[(byte)PGComponents.WallFinish])       pgWriter.UpdatePGs(PGypWall.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.CurtainWall])      pgWriter.UpdatePGs(PCurtainWall.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Storefront])       pgWriter.UpdatePGs(PStorefront.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Ceiling]
                     || addiInfo.requiredComp[(byte)PGComponents.CeilingLighting])  pgWriter.UpdatePGs(PCeiling.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.MasonryWall])      pgWriter.UpdatePGs(PMasonryWall.GetPG(doc, addiInfo));

                    if (addiInfo.requiredComp[(byte)PGComponents.Duct])             pgWriter.UpdatePGs(PDuct.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Pipe])             pgWriter.UpdatePGs(PPipe.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Chiller])          pgWriter.UpdatePGs((new PChiller(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.CoolingTower])     pgWriter.UpdatePGs((new PCoolingTower(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.Compressor])       pgWriter.UpdatePGs((new PCompressor(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.HVACFan_InLine])   pgWriter.UpdatePGs((new PHVACFan_InLine(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.Diffuser])         pgWriter.UpdatePGs((new PDiffuser(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.VAV])              pgWriter.UpdatePGs((new PVAV(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.HVACFan])          pgWriter.UpdatePGs((new PHVACFan(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.AHU])              pgWriter.UpdatePGs((new PAHU(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.ControlPanel])     pgWriter.UpdatePGs((new PControlPanel(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.FireSprinkler])    pgWriter.UpdatePGs((new PFireSprinkler(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.Transformer])      pgWriter.UpdatePGs((new PTransformer(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.MCC])              pgWriter.UpdatePGs((new PMCC(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.LVS])              pgWriter.UpdatePGs((new PLVS(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.DistPanel])        pgWriter.UpdatePGs((new PDistPanel(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.BatteryRack])      pgWriter.UpdatePGs((new PBatteryRack(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.BatteryCharger])   pgWriter.UpdatePGs((new PBatteryCharger(doc, addiInfo)).GetPG());
                    if (addiInfo.requiredComp[(byte)PGComponents.DieselGen])        pgWriter.UpdatePGs((new PDieselGen(doc, addiInfo)).GetPG());

                    if (addiInfo.requiredComp[(byte)PGComponents.BracedFrame])      pgWriter.UpdatePGs(PBracedFrame.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.SteelBCJoint])     pgWriter.UpdatePGs(PStealBCJoints.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.FlatSlab])         pgWriter.UpdatePGs(PFlatSlab.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.LinkBeam])         pgWriter.UpdatePGs(PLinkBeam.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Stair])            pgWriter.UpdatePGs(PStair.GetPG(doc, addiInfo));
                    if (addiInfo.requiredComp[(byte)PGComponents.Roof])             pgWriter.UpdatePGs(PRoof.GetPG(doc, addiInfo));
                    normalExit = true;
                }
            }
            catch (Exception e)
            {
                errorWriter.WriteError(e);
                normalExit = false;
                TaskDialog.Show("PGCreator", "未能正确导出性能组,请与软件提供者联系");
            }
            finally
            {
                ErrorWriter.Output();
                if (normalExit)
                {
                    AbandonmentWriter.Output();
                    PGWriter.Output();
                    TaskDialog.Show("PGCreator", "性能组导出成功!");
                }
            }
            return Result.Succeeded;
        }
Exemplo n.º 44
0
 public PollAnswer(AdditionalInfo additionalInfo)
     : base(additionalInfo)
 {
 }
 public ApiMetaData(AdditionalInfo additionalInfo):base(additionalInfo) { }