public Character( IRepository <Features> feature, IRepository <Skills> skill, IRepository <SpecialAbilities> special, ICorporation corporation) { this._feature = feature ?? throw new ArgumentNullException(nameof(feature)); this._skill = skill ?? throw new ArgumentNullException(nameof(skill)); this._special = special ?? throw new ArgumentNullException(nameof(special)); this._corporation = corporation ?? throw new ArgumentNullException(nameof(corporation)); Init(); }
public ResCorporation(ICorporation corp) { if (corp == null) { return; } this.Id = corp.Id; this.Signature = corp.Signature; this.TimeStamp = corp.TimeStamp; this.CorporationName = corp.Name; this.Address = corp.Address; this.FixPhone = corp.FixPhone; this.CorporationImage = corp.Image; this.Presentation = corp.Presentation; this.CorporationState = corp.State; }
private void CreateEmployee(string[] employee) { string name = employee[1].ToUpper().Trim(); string stGrade = employee[0].ToLower().Trim(); int qty = stGrade.Length; Category category; switch (stGrade.Substring(0, 1)) { case "o": category = Category.Circle; break; case "^": category = Category.Triangle; break; case "*": category = Category.Star; break; default: category = Category.Circle; break; } using (var scope = _container.BeginLifetimeScope()) { ICorporation corpo = scope.Resolve <ICorporation>(); IGrade grade = scope.Resolve <IGrade>(); grade.Category = category; grade.Qty = qty; grade.Rank = SetRank(category, qty); corpo.Name = name; corpo.Grade = grade; Corporation = corpo; } }
private ICorporation CheckCorpo(ICorporation corpo) { string[] noCorpo = { "freelance", "none", "n/a", string.Empty }; if (corpo.Name == null) { corpo.Name = "freelance"; } foreach (var no in noCorpo) { if (Array.Exists(noCorpo, a => Regex.IsMatch(corpo.Name, no.ToString(), RegexOptions.IgnoreCase))) { corpo.Name = "Freelance"; corpo.Grade = new Grade() { Category = Category.Star, Qty = 5 }; } } return(corpo); }