public void TestLoadCustomerCSV() { string csvData = @"id,created 35410,2015-07-03 22:01:11 35417,2015-07-03 22:11:23 35412,2015-07-03 22:02:52 "; ICollection <ICustomer> customers = CustomerLoader.ParseCsvData(csvData); Assert.AreEqual(3, customers.Count); var customerEnumerator = customers.GetEnumerator(); customerEnumerator.MoveNext(); var customer = customerEnumerator.Current; Assert.AreEqual(35410, customer.Id); Assert.AreEqual(DateTime.Parse("2015-07-03 22:01:11"), customer.CreatedDate); customerEnumerator.MoveNext(); customer = customerEnumerator.Current; Assert.AreEqual(35417, customer.Id); Assert.AreEqual(DateTime.Parse("2015-07-03 22:11:23"), customer.CreatedDate); customerEnumerator.MoveNext(); customer = customerEnumerator.Current; Assert.AreEqual(35412, customer.Id); Assert.AreEqual(DateTime.Parse("2015-07-03 22:02:52"), customer.CreatedDate); }
public bool LoadFromFile(string taskDataFile) { if (!LoadXmlFile(taskDataFile)) { return(false); } if (!VerifyIsoVersion()) { return(false); } LinkedIds = LinkListLoader.Load(this); Units = UnitLoader.Load(this); Customers = CustomerLoader.Load(this); Farms = FarmLoader.Load(this); Crops = CropLoader.Load(this); Fields = FieldLoader.Load(this); Products = ProductLoader.Load(this); ProductMixes = ProductMixLoader.Load(this); Workers = WorkerLoader.Load(this); Comments = CommentLoader.Load(this); Tasks = TaskLoader.Load(this); RasterPrescriptions = PrescriptionLoader.Load(this); Machines = DeviceLoader.Load(this); return(true); }
private void Form1_Load(object sender, System.EventArgs e) { ChannelServices.RegisterChannel(new HttpClientChannel()); custl = (CustomerLoader)Activator.GetObject(typeof(CustomerLoader ), "http://localhost:8228/CustomerLoader"); if (custl == null) { Console.WriteLine("HTTP SERVER OFFLINE ...PLEASE TRY LATER"); return; } // custl.Init("skulkarni" , "" ) ; }