/// <summary> /// Валидация /// </summary> /// <param name="element"></param> /// <returns></returns> public ValidationResult Validate(BasisAction element) { //if (string.IsNullOrEmpty(elementю)) //{ // return new ValidationResult(ValidatorResources.CharacteristicValidator_NameIsNull); //} return(new ValidationResult()); }
/// <summary> /// Добавить юр клиентов /// </summary> private void AddCustomerLegal() { using (var uf = new ApplicationDbContext()) { var basisAction = new BasisAction() { Guid = Guid.NewGuid(), Name = "Какое-то действие", }; uf.Set <BasisAction>().Add(basisAction); uf.SaveChanges(); var client = new CustomerLegal() { Guid = Guid.NewGuid(), Address = "г. Саратов, ул. Техническая", Name = "Пиво балтика", Phone = "(8452)11-11-11", BasisActionId = basisAction.Id, DocDate = DateTime.Now, DocNumber = "# 123456", Face = "Директор", Inn = "123456", Kpp = "654321", Position = "Директор" }; uf.Set <CustomerLegal>().Add(client); uf.SaveChanges(); var client2 = new CustomerLegal() { Guid = Guid.NewGuid(), Address = "г. Энгельс, ул. Техническая", Name = "ООО керамика", Phone = "(8453)22-11-11", BasisActionId = basisAction.Id, DocDate = DateTime.Now, DocNumber = "# авввву", Face = "Директор", Inn = "123456", Kpp = "654321", Position = "Директор" }; uf.Set <CustomerLegal>().Add(client2); uf.SaveChanges(); } }