예제 #1
0
            public XElement GenerateAddRq(decimal?TotalValue = null, DateTime?InventoryDate = null)
            {
                XElement Add = new XElement(typeof(ItemInventory).Name + "Add");

                Add.Add(Name?.ToQBXML(nameof(Name)));
                Add.Add(BarCode?.ToQBXML(nameof(BarCode)));
                Add.Add(IsActive.ToQBXML(nameof(IsActive)));
                Add.Add(ClassRef?.ToQBXML(nameof(ClassRef)));
                Add.Add(ParentRef?.ToQBXML(nameof(ParentRef)));
                Add.Add(ManufacturerPartNumber?.ToQBXML(nameof(ManufacturerPartNumber)));
                Add.Add(UnitOfMeasureSetRef?.ToQBXML(nameof(UnitOfMeasureSetRef)));
                Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef)));
                Add.Add(SalesDesc?.ToQBXML(nameof(SalesDesc)));
                Add.Add(SalesPrice?.ToQBXML(nameof(SalesPrice)));
                Add.Add(IncomeAccountRef?.ToQBXML(nameof(IncomeAccountRef)));
                Add.Add(PurchaseDesc?.ToQBXML(nameof(PurchaseDesc)));
                Add.Add(PurchaseCost?.ToQBXML(nameof(PurchaseCost)));
                Add.Add(COGSAccountRef?.ToQBXML(nameof(COGSAccountRef)));
                Add.Add(PrefVendorRef?.ToQBXML(nameof(PrefVendorRef)));
                Add.Add(AssetAccountRef?.ToQBXML(nameof(AssetAccountRef)));
                Add.Add(ReorderPoint?.ToQBXML(nameof(ReorderPoint)));
                Add.Add(Max?.ToQBXML(nameof(Max)));
                Add.Add(QuantityOnHand?.ToQBXML(nameof(QuantityOnHand)));
                Add.Add(TotalValue?.ToQBXML(nameof(TotalValue)));
                Add.Add(InventoryDate?.ToQBXML(nameof(InventoryDate)));
                Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID)));

                XElement AddRq = new XElement(typeof(ItemInventory).Name + "AddRq", Add);

                foreach (var value in IncludeRetElement)
                {
                    AddRq.Add(value.ToQBXML(nameof(IncludeRetElement)));
                }
                return(AddRq);
            }
예제 #2
0
        /// <summary>
        /// 激活或锁定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnActive_Click(object sender, EventArgs e)
        {
            try
            {
                IsActive upStatus = IsActive.冻结;//更改状态
                switch (currantSatus)
                {
                case (int)IsActive.激活:
                    upStatus = IsActive.冻结;
                    break;

                case (int)IsActive.冻结:
                    upStatus = IsActive.激活;
                    break;
                }
                AutofacConfig AutofacConfig = new AutofacConfig();
                //更新成本中心状态
                ReturnInfo result = AutofacConfig.costCenterService.UpdateCostCenterStatus(CCID, upStatus, Client.Session ["U_ID"].ToString());
                if (result.IsSuccess == false)
                {
                    throw new Exception(result.ErrorInfo);
                }
                else
                {
                    Toast("已" + btnActive.Text + "成功!", ToastLength.SHORT);
                    Bind();
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message, ToastLength.SHORT);
            }
        }
예제 #3
0
        /// <summary>
        /// 更新成本中心类型的状态
        /// </summary>
        /// <param name="TypeID">成本中心类型的ID</param>
        /// <param name="IsActive">是否激活</param>
        public ReturnInfo UpdateCC_TypeStatus(string TypeID, IsActive IsActive)
        {
            ReturnInfo      RInfo  = new ReturnInfo();
            StringBuilder   sb     = new StringBuilder();
            CostCenter_Type entity = GetTypeByID(TypeID);

            if (entity != null)
            {
                try
                {
                    entity.CC_T_IsActive = (int)IsActive;
                    _unitOfWork.RegisterDirty(entity);
                    bool result = _unitOfWork.Commit();
                    RInfo.IsSuccess = result;
                    RInfo.ErrorInfo = sb.ToString();
                    return(RInfo);
                }
                catch (Exception ex)
                {
                    _unitOfWork.RegisterClean(entity);
                    _unitOfWork.Rollback();
                    sb.Append(ex.Message);
                    RInfo.IsSuccess = false;
                    RInfo.ErrorInfo = sb.ToString();
                    return(RInfo);
                }
            }
            else
            {
                RInfo.IsSuccess = false;
                RInfo.ErrorInfo = "该成本中心类型的ID不存在";
                return(RInfo);
            }
        }
예제 #4
0
 public void SetXmlAttribs(XmlElement e)
 {
     e.SetAttribute("slot", Slot.ToString());
     e.SetAttribute("key", ((int)Key.CurrentKey).ToString());
     e.SetAttribute("active", IsActive.ToString());
     e.SetAttribute("func", AvailableFunctions.StringifyType(Type));
 }
예제 #5
0
        internal void SaveGeneralInfo(XmlDocument serverConfigDocument)
        {
            XmlNode companies = serverConfigDocument.SelectSingleNode("/configuration/companies");
            XmlNode company   = companies.SelectSingleNode(string.Concat("company[@id='", Id, "']"));

            if (company == null)
            {
                company = companies.AppendChild(serverConfigDocument.CreateElement("company"));
            }

            XmlHelper.SetAttributeValue(company, "id", Id);
            XmlHelper.SetAttributeValue(company, "isActive", IsActive.ToString());
            XmlHelper.SetAttributeValue(company, "scheme", Scheme);
            XmlHelper.SetAttributeValue(company, "host", Host);
            XmlHelper.SetAttributeValue(company, "port", Port);
            XmlHelper.SetAttributeValue(company, "database", Database);
            XmlHelper.SetAttributeValue(company, "defaultLocale", _defaultLanguage.Locale);
            XmlHelper.SetAttributeValue(company, "codePath", CodePath);
            XmlHelper.SetAttributeValue(company, "codeVersion", CodeVersion.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "siteId", SiteId.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "imPool", IMPool);
            XmlHelper.SetAttributeValue(company, "portalPool", PortalPool);
            XmlHelper.SetAttributeValue(company, "portalPoolCreated", IsPortalPoolCreated.ToString());
            XmlHelper.SetAttributeValue(company, "created", Created.ToString(CultureInfo.InvariantCulture));
            XmlHelper.SetAttributeValue(company, "scheduleServiceEnabled", IsScheduleServiceEnabled.ToString());
        }
예제 #6
0
        public override bool Equals(object o)
        {
            if (!(o is DefaultViewer))
            {
                return(false);
            }
            DefaultViewer v = o as DefaultViewer;

            if (!IsActive.Equals(v.IsActive))
            {
                return(false);
            }
            if (!OutputFormat.Equals(v.OutputFormat))
            {
                return(false);
            }
            if (!Parameters.Equals(v.Parameters))
            {
                return(false);
            }
            if (!Path.Equals(v.Path))
            {
                return(false);
            }

            return(true);
        }
예제 #7
0
 public void StoreValues(Data data, string path)
 {
     data.SetValue(@"" + path + @"IsActive", IsActive.ToString());
     data.SetValue(@"" + path + @"OutputFormat", OutputFormat.ToString());
     data.SetValue(@"" + path + @"Parameters", Data.EscapeString(Parameters));
     data.SetValue(@"" + path + @"Path", Data.EscapeString(Path));
 }
예제 #8
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Linkid * 397) ^ IsActive.GetHashCode());
     }
 }
예제 #9
0
        public bool Equals(DestinyPerkReference input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     PerkHash == input.PerkHash ||
                     (PerkHash.Equals(input.PerkHash))
                     ) &&
                 (
                     IconPath == input.IconPath ||
                     (IconPath != null && IconPath.Equals(input.IconPath))
                 ) &&
                 (
                     IsActive == input.IsActive ||
                     (IsActive != null && IsActive.Equals(input.IsActive))
                 ) &&
                 (
                     Visible == input.Visible ||
                     (Visible != null && Visible.Equals(input.Visible))
                 ));
        }
예제 #10
0
        public override int GetHashCode()
        {
            int hashCode = 1803674884;

            hashCode = hashCode * -1521134295 + Id.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + IsIntermediate.GetHashCode();
            hashCode = hashCode * -1521134295 + IsDanger.GetHashCode();
            hashCode = hashCode * -1521134295 + IsProduction.GetHashCode();
            hashCode = hashCode * -1521134295 + IsActive.GetHashCode();
            hashCode = hashCode * -1521134295 + IntermediateNrD.GetHashCode();
            hashCode = hashCode * -1521134295 + ClpSignalWordId.GetHashCode();
            hashCode = hashCode * -1521134295 + ClpMsdsId.GetHashCode();
            hashCode = hashCode * -1521134295 + FunctionId.GetHashCode();
            hashCode = hashCode * -1521134295 + Price.GetHashCode();
            hashCode = hashCode * -1521134295 + CurrencyId.GetHashCode();
            hashCode = hashCode * -1521134295 + UnitId.GetHashCode();
            hashCode = hashCode * -1521134295 + Density.GetHashCode();
            hashCode = hashCode * -1521134295 + Solids.GetHashCode();
            hashCode = hashCode * -1521134295 + Ash450.GetHashCode();
            hashCode = hashCode * -1521134295 + VOC.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Remarks);

            hashCode = hashCode * -1521134295 + LoginId.GetHashCode();
            hashCode = hashCode * -1521134295 + DateCreated.GetHashCode();
            hashCode = hashCode * -1521134295 + DateUpdated.GetHashCode();
            return(hashCode);
        }
예제 #11
0
        public async Task ShouldInsert_ExternalAgentAndEmployee()
        {
            Guid id = Guid.NewGuid();

            Employee employee = new Employee
                                (
                new ExternalAgent(id, AgentType.Employee),
                SupervisorId.Create(id),
                PersonName.Create("George", "Orwell", "J"),
                SSN.Create("623789999"),
                PhoneNumber.Create("817-987-1234"),
                MaritalStatus.Create("M"),
                TaxExemption.Create(5),
                PayRate.Create(40.00M),
                StartDate.Create(new DateTime(1998, 12, 2)),
                IsActive.Create(true)
                                );

            await _employeeRepo.AddAsync(employee);

            await _unitOfWork.Commit();

            var employeeResult = await _employeeRepo.Exists(employee.Id);

            Assert.True(employeeResult);
        }
예제 #12
0
        private void load()
        {
            dependencies.CacheAs(this);

            dependencies.Cache(SentryLogger);

            dependencies.Cache(osuLogo = new OsuLogo {
                Alpha = 0
            });

            // bind config int to database RulesetInfo
            configRuleset = LocalConfig.GetBindable <int>(OsuSetting.Ruleset);

            var preferredRuleset = RulesetStore.GetRuleset(configRuleset.Value);

            try
            {
                Ruleset.Value = preferredRuleset ?? RulesetStore.AvailableRulesets.First();
            }
            catch (Exception e)
            {
                // on startup, a ruleset may be selected which has compatibility issues.
                Logger.Error(e, $@"Failed to switch to preferred ruleset {preferredRuleset}.");
                Ruleset.Value = RulesetStore.AvailableRulesets.First();
            }

            Ruleset.ValueChanged += r => configRuleset.Value = r.NewValue.ID ?? 0;

            // bind config int to database SkinInfo
            configSkin = LocalConfig.GetBindable <int>(OsuSetting.Skin);
            SkinManager.CurrentSkinInfo.ValueChanged += skin => configSkin.Value = skin.NewValue.ID;
            configSkin.ValueChanged += skinId =>
            {
                var skinInfo = SkinManager.Query(s => s.ID == skinId.NewValue);

                if (skinInfo == null)
                {
                    switch (skinId.NewValue)
                    {
                    case -1:
                        skinInfo = DefaultLegacySkin.Info;
                        break;

                    default:
                        skinInfo = SkinInfo.Default;
                        break;
                    }
                }

                SkinManager.CurrentSkinInfo.Value = skinInfo;
            };
            configSkin.TriggerChange();

            IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);

            Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);

            SelectedMods.BindValueChanged(modsChanged);
            Beatmap.BindValueChanged(beatmapChanged, true);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         return((IsActive.GetHashCode() * 397) ^ (Range != null ? Range.GetHashCode() : 0));
     }
 }
예제 #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (FirstName.Length != 0)
            {
                hash ^= FirstName.GetHashCode();
            }
            if (LastName.Length != 0)
            {
                hash ^= LastName.GetHashCode();
            }
            if (EmailAddress.Length != 0)
            {
                hash ^= EmailAddress.GetHashCode();
            }
            if (IsActive != false)
            {
                hash ^= IsActive.GetHashCode();
            }
            if (Age != 0)
            {
                hash ^= Age.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #15
0
        public string this[int i]
        {
            get
            {
                switch (i)
                {
                case 0:
                    return(CustomerId.ToString());

                case 1:
                    return(FirstName);

                case 2:
                    return(LastName);

                case 3:
                    return(PhoneNumber);

                case 4:
                    return(Email);

                case 5:
                    return(Address);

                case 6:
                    return(IsActive.ToString());

                default:
                    return(string.Empty);
                }
            }
        }
 public void Configure(EntityTypeBuilder <Financier> entity)
 {
     entity.ToTable("Financiers", schema: "Finance");
     entity.HasKey(e => e.Id);
     entity.Property(p => p.Id).HasColumnType("UNIQUEIDENTIFIER").HasColumnName("FinancierId");
     entity.Property(p => p.FinancierName)
     .HasConversion(p => p.Value, p => OrganizationName.Create(p))
     .HasColumnType("NVARCHAR(50)")
     .HasColumnName("FinancierName")
     .IsRequired();
     entity.Property(p => p.Telephone)
     .HasConversion(p => p.Value, p => PhoneNumber.Create(p))
     .HasColumnType("NVARCHAR(14)")
     .HasColumnName("Telephone")
     .IsRequired();
     entity.Property(p => p.IsActive)
     .HasConversion(p => p.Value, p => IsActive.Create(p))
     .HasColumnType("BIT")
     .HasColumnName("IsActive")
     .IsRequired();
     entity.Property(p => p.UserId)
     .HasColumnType("UNIQUEIDENTIFIER")
     .HasColumnName("UserId")
     .IsRequired();
     entity.Property(e => e.CreatedDate)
     .HasColumnType("datetime2(7)")
     .ValueGeneratedOnAdd()
     .HasDefaultValueSql("sysdatetime()");
     entity.Property(e => e.LastModifiedDate).HasColumnType("datetime2(7)");
 }
예제 #17
0
        /// <summary>
        /// Returns true if StoreActivationStatus instances are equal
        /// </summary>
        /// <param name="input">Instance of StoreActivationStatus to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StoreActivationStatus input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     IsActive == input.IsActive ||
                     IsActive != null &&
                     IsActive.Equals(input.IsActive)
                     ) &&
                 (
                     Reason == input.Reason ||
                     Reason != null &&
                     Reason.Equals(input.Reason)
                 ) &&
                 (
                     Notes == input.Notes ||
                     Notes != null &&
                     Notes.Equals(input.Notes)
                 ) &&
                 (
                     ShouldSendEmail == input.ShouldSendEmail ||
                     ShouldSendEmail != null &&
                     ShouldSendEmail.Equals(input.ShouldSendEmail)
                 ));
        }
예제 #18
0
        /// <summary>
        /// Returns true if MenuDetails instances are equal
        /// </summary>
        /// <param name="input">Instance of MenuDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MenuDetails input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     MenuId == input.MenuId ||
                     MenuId != null &&
                     MenuId.Equals(input.MenuId)
                     ) &&
                 (
                     Name == input.Name ||
                     Name != null &&
                     Name.Equals(input.Name)
                 ) &&
                 (
                     Subtitle == input.Subtitle ||
                     Subtitle != null &&
                     Subtitle.Equals(input.Subtitle)
                 ) &&
                 (
                     IsActive == input.IsActive ||
                     IsActive != null &&
                     IsActive.Equals(input.IsActive)
                 ) &&
                 (
                     IsPosMenu == input.IsPosMenu ||
                     IsPosMenu != null &&
                     IsPosMenu.Equals(input.IsPosMenu)
                 ) &&
                 (
                     LatestMenuUpdate == input.LatestMenuUpdate ||
                     LatestMenuUpdate != null &&
                     LatestMenuUpdate.Equals(input.LatestMenuUpdate)
                 ) &&
                 (
                     LastSuccessfulMenuUpdateAt == input.LastSuccessfulMenuUpdateAt ||
                     LastSuccessfulMenuUpdateAt != null &&
                     LastSuccessfulMenuUpdateAt.Equals(input.LastSuccessfulMenuUpdateAt)
                 ) &&
                 (
                     Url == input.Url ||
                     Url != null &&
                     Url.Equals(input.Url)
                 ) &&
                 (
                     OpenHours == input.OpenHours ||
                     OpenHours != null &&
                     OpenHours.SequenceEqual(input.OpenHours)
                 ) &&
                 (
                     SpecialHours == input.SpecialHours ||
                     SpecialHours != null &&
                     SpecialHours.SequenceEqual(input.SpecialHours)
                 ));
        }
예제 #19
0
        public override int GetHashCode()
        {
            int result = 17;

            unchecked
            {
                if (RuleId != default(string))
                {
                    result = (result * 31) + RuleId.GetHashCode();
                }

                if (Rule != default(Rule))
                {
                    result = (result * 31) + Rule.GetHashCode();
                }

                if (Guid != default(string))
                {
                    result = (result * 31) + Guid.GetHashCode();
                }

                if (IsActive != default(bool))
                {
                    result = (result * 31) + IsActive.GetHashCode();
                }

                if (Message != default(string))
                {
                    result = (result * 31) + Message.GetHashCode();
                }

                if (StartLine != default(int))
                {
                    result = (result * 31) + StartLine.GetHashCode();
                }

                if (WhenDetectedUtc != default(DateTime))
                {
                    result = (result * 31) + WhenDetectedUtc.GetHashCode();
                }

                if (BaselineState != default(BaselineState))
                {
                    result = (result * 31) + BaselineState.GetHashCode();
                }

                if (Properties != default(IDictionary <String, String>))
                {
                    result = (result * 31) + Properties.GetHashCode();
                }

                if (Tags != default(IList <int>))
                {
                    result = (result * 31) + Tags.GetHashCode();
                }
            }

            return(result);
        }
예제 #20
0
 public override string ToString()
 {
     if (BundleData == null)
     {
         return(string.Format("Name:{0},BundleData:{null}", IsActive.ToString()));
     }
     return($"Name:{BundleData.SymbolicName},IsActive:{IsActive.ToString()},State:{State.ToString()}");
 }
예제 #21
0
        public void Serialize(XmlNode node)
        {
            var node2 = node.OwnerDocument.CreateElement("NonlinearDistortion");

            node2.SetAttribute("exponentiation", powerExponentiation.ToString(CultureInfo.InvariantCulture));
            node2.SetAttribute("isActive", IsActive.ToString(CultureInfo.InvariantCulture));
            node.AppendChild(node2);
        }
예제 #22
0
 public HotkeySettingsControlHook(KeyEvent keyDown, KeyEvent keyUp, IsActive isActive)
 {
     this.keyDown  = keyDown;
     this.keyUp    = keyUp;
     this.isActive = isActive;
     hook          = new KeyboardHook(HotkeySettingsHookCallback, IsActive, null);
     hook.Start();
 }
예제 #23
0
    private void ClearNodeIfAlwaysHighlightedIsOn()
    {
        var tempStore = _alwaysHighlighted;

        _alwaysHighlighted = IsActive.No;
        LastHighlighted.UnHighlightAlwaysOn();
        _alwaysHighlighted = tempStore;
    }
예제 #24
0
파일: OsuGame.cs 프로젝트: moccy/osu
        private void load()
        {
            if (!Host.IsPrimaryInstance && !DebugUtils.IsDebugBuild)
            {
                Logger.Log(@"osu! does not support multiple running instances.", LoggingTarget.Runtime, LogLevel.Error);
                Environment.Exit(0);
            }

            if (args?.Length > 0)
            {
                var paths = args.Where(a => !a.StartsWith('-')).ToArray();
                if (paths.Length > 0)
                    Task.Run(() => Import(paths));
            }

            dependencies.CacheAs(this);

            dependencies.Cache(SentryLogger);

            dependencies.Cache(osuLogo = new OsuLogo { Alpha = 0 });

            // bind config int to database RulesetInfo
            configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
            Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
            Ruleset.ValueChanged += r => configRuleset.Value = r.NewValue.ID ?? 0;

            // bind config int to database SkinInfo
            configSkin = LocalConfig.GetBindable<int>(OsuSetting.Skin);
            SkinManager.CurrentSkinInfo.ValueChanged += skin => configSkin.Value = skin.NewValue.ID;
            configSkin.ValueChanged += skinId =>
            {
                var skinInfo = SkinManager.Query(s => s.ID == skinId.NewValue);

                if (skinInfo == null)
                {
                    switch (skinId.NewValue)
                    {
                        case -1:
                            skinInfo = DefaultLegacySkin.Info;
                            break;

                        default:
                            skinInfo = SkinInfo.Default;
                            break;
                    }
                }

                SkinManager.CurrentSkinInfo.Value = skinInfo;
            };
            configSkin.TriggerChange();

            IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);

            Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);

            SelectedMods.BindValueChanged(modsChanged);
            Beatmap.BindValueChanged(beatmapChanged, true);
        }
예제 #25
0
        public void Configure(EntityTypeBuilder <Employee> entity)
        {
            entity.ToTable("Employees", schema: "HumanResources");
            entity.HasKey(e => e.Id);
            entity.Property(p => p.Id).HasColumnType("UNIQUEIDENTIFIER").HasColumnName("EmployeeId");
            entity.Property(p => p.SupervisorId)
            .HasConversion(p => p.Value, p => SupervisorId.Create(p))
            .HasColumnType("UNIQUEIDENTIFIER")
            .HasColumnName("SupervisorId")
            .IsRequired();
            entity.OwnsOne(p => p.EmployeeName, p =>
            {
                p.Property(pp => pp.LastName).HasColumnType("NVARCHAR(25)").HasColumnName("LastName").IsRequired();
                p.Property(pp => pp.FirstName).HasColumnType("NVARCHAR(25)").HasColumnName("FirstName").IsRequired();
                p.Property(pp => pp.MiddleInitial).HasColumnType("NCHAR(1)").HasColumnName("MiddleInitial");
            });

            entity.Property(p => p.SSN)
            .HasConversion(p => p.Value, p => SSN.Create(p))
            .HasColumnType("NVARCHAR(9)")
            .HasColumnName("SSN")
            .IsRequired();
            entity.Property(p => p.Telephone)
            .HasConversion(p => p.Value, p => PhoneNumber.Create(p))
            .HasColumnType("NVARCHAR(14)")
            .HasColumnName("Telephone")
            .IsRequired();
            entity.Property(p => p.MaritalStatus)
            .HasConversion(p => p.Value, p => MaritalStatus.Create(p))
            .HasColumnType("NCHAR(1)")
            .HasColumnName("MaritalStatus")
            .IsRequired();
            entity.Property(p => p.TaxExemption)
            .HasConversion(p => p.Value, p => TaxExemption.Create(p))
            .HasColumnType("int")
            .HasColumnName("Exemptions")
            .IsRequired();
            entity.Property(p => p.PayRate)
            .HasConversion(p => p.Value, p => PayRate.Create(p))
            .HasColumnType("DECIMAL(18,2)")
            .HasColumnName("PayRate")
            .IsRequired();
            entity.Property(p => p.StartDate)
            .HasConversion(p => p.Value, p => StartDate.Create(p))
            .HasColumnType("datetime2(0)")
            .HasColumnName("StartDate")
            .IsRequired();
            entity.Property(p => p.IsActive)
            .HasConversion(p => p.Value, p => IsActive.Create(p))
            .HasColumnType("BIT")
            .HasColumnName("IsActive")
            .IsRequired();
            entity.Property(e => e.CreatedDate)
            .HasColumnType("datetime2(7)")
            .ValueGeneratedOnAdd()
            .HasDefaultValueSql("sysdatetime()");
            entity.Property(e => e.LastModifiedDate).HasColumnType("datetime2(7)");
        }
예제 #26
0
            public override XElement GenerateAddRq()
            {
                XElement Add = new XElement("CustomerAdd");

                Add.Add(Name?.ToQBXML(nameof(Name)));
                Add.Add(IsActive.ToQBXML(nameof(IsActive)));
                Add.Add(ClassRef?.ToQBXML(nameof(ClassRef)));
                Add.Add(ParentRef?.ToQBXML(nameof(ParentRef)));
                Add.Add(CompanyName?.ToQBXML(nameof(CompanyName)));
                Add.Add(Salutation?.ToQBXML(nameof(Salutation)));
                Add.Add(FirstName?.ToQBXML(nameof(FirstName)));
                Add.Add(MiddleName?.ToQBXML(nameof(MiddleName)));
                Add.Add(LastName?.ToQBXML(nameof(LastName)));
                Add.Add(JobTitle?.ToQBXML(nameof(JobTitle)));
                Add.Add(BillAddress?.ToQBXML(nameof(BillAddress)));
                Add.Add(ShipAddress?.ToQBXML(nameof(ShipAddress)));
                Add.Add(ShipToAddress?.ToQBXML(nameof(ShipToAddress)));
                Add.Add(Phone?.ToQBXML(nameof(Phone)));
                Add.Add(AltPhone?.ToQBXML(nameof(AltPhone)));
                Add.Add(Fax?.ToQBXML(nameof(Fax)));
                Add.Add(Email?.ToQBXML(nameof(Email)));
                Add.Add(Cc?.ToQBXML(nameof(Cc)));
                Add.Add(Contact?.ToQBXML(nameof(Contact)));
                Add.Add(AltContact?.ToQBXML(nameof(AltContact)));
                Add.Add(AdditionalContactRef?.ToQBXML(nameof(AdditionalContactRef)));
                Add.Add(Contacts?.ToQBXML <Contacts>(nameof(Contacts)));
                Add.Add(CustomerTypeRef?.ToQBXML(nameof(CustomerTypeRef)));
                Add.Add(TermsRef?.ToQBXML(nameof(TermsRef)));
                Add.Add(SalesRepRef?.ToQBXML(nameof(SalesRepRef)));
                Add.Add(OpenBalance?.ToQBXML(nameof(OpenBalance)));
                Add.Add(OpenBalanceDate?.ToQBXML(nameof(OpenBalanceDate)));
                Add.Add(SalesTaxCodeRef?.ToQBXML(nameof(SalesTaxCodeRef)));
                Add.Add(ItemSalesTaxRef?.ToQBXML(nameof(ItemSalesTaxRef)));
                Add.Add(ResaleNumber?.ToQBXML(nameof(ResaleNumber)));
                Add.Add(AccountNumber?.ToQBXML(nameof(AccountNumber)));
                Add.Add(CreditLimit?.ToQBXML(nameof(CreditLimit)));
                Add.Add(PreferredPaymentMethodRef?.ToQBXML(nameof(PreferredPaymentMethodRef)));
                Add.Add(CreditCardInfo?.ToQBXML(nameof(CreditCardInfo)));
                Add.Add(JobStatus.ToQBXML(nameof(JobStatus)));
                Add.Add(JobStartDate?.ToQBXML(nameof(JobStartDate)));
                Add.Add(JobProjectedEndDate?.ToQBXML(nameof(JobProjectedEndDate)));
                Add.Add(JobEndDate?.ToQBXML(nameof(JobEndDate)));
                Add.Add(JobDesc?.ToQBXML(nameof(JobDesc)));
                Add.Add(JobTypeRef?.ToQBXML(nameof(JobTypeRef)));
                Add.Add(Notes?.ToQBXML(nameof(Notes)));
                Add.Add(AdditionalNotes?.ToQBXML(nameof(AdditionalNotes)));
                Add.Add(PreferredDeliveryMethod.ToQBXML(nameof(PreferredDeliveryMethod)));
                Add.Add(PriceLevelRef?.ToQBXML(nameof(PriceLevelRef)));
                Add.Add(ExternalGUID?.ToQBXML(nameof(ExternalGUID)));
                Add.Add(CurrencyRef?.ToQBXML(nameof(CurrencyRef)));

                XElement AddRq = new XElement("CustomerAddRq");

                AddRq.Add(Add);
                AddRq.Add(IncludeRetElement?.ToQBXML(nameof(IncludeRetElement)));

                return(AddRq);
            }
예제 #27
0
 private User(UserId id, FirstName firstName, LastName lastName, Email email, Role role)
 {
     Id        = id;
     FirstName = firstName;
     LastName  = lastName;
     Email     = email;
     Role      = role;
     IsActive  = new IsActive(true);
 }
예제 #28
0
        public void ShouldReturn_Valid_IsActiveStatus()
        {
            bool status = true;

            var result = IsActive.Create(status);

            Assert.IsType <IsActive>(result);
            Assert.Equal(status, result.Value);
        }
예제 #29
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = IsActive.GetHashCode();
         hashCode = (hashCode * 397) ^ Duration.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Type;
         return(hashCode);
     }
 }
예제 #30
0
 public HotkeySettingsControlHook(KeyEvent keyDown, KeyEvent keyUp, IsActive isActive, FilterAccessibleKeyboardEvents filterAccessibleKeyboardEvents)
 {
     _keyDown             = keyDown;
     _keyUp               = keyUp;
     _isActive            = isActive;
     _filterKeyboardEvent = filterAccessibleKeyboardEvents;
     _hook = new KeyboardHook(HotkeySettingsHookCallback, IsActive, FilterKeyboardEvents);
     _hook.Start();
 }