public void IntegrationTest_TrackViaClient_Scenario_CreateAndUpdateRecord_SimpleCRMAccount() { TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW <= 0); TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME, IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY); // Create a record we can update Record record = Integration_CreateRecordStep(client); // Lets leave one field unchanged, update one field and add a new field value RecordData updatedData = new RecordData(); updatedData.Add("Primary Contact", "Updated Primary Contact"); updatedData.Add("Contact Phone", "555-555-5555"); // Act Record updatedResult = client.updateRecord(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW, record.Data.Id, updatedData); // Assert updatedResult.ShouldNotBeNull(); updatedResult.Data.ShouldNotBeNull(); updatedResult.Data.Id.ShouldEqual(record.Data.Id); updatedResult.Data["Account Name"].ShouldEqual(record.Data["Account Name"]); updatedResult.Data["Primary Contact"].ShouldEqual(updatedData["Primary Contact"]); updatedResult.Data["Contact Phone"].ShouldEqual(updatedData["Contact Phone"]); }
public static RecordData IntegrationTest_SimpleCrmContact_GetCreateRecordData() { RecordData result = new RecordData(); result.Add("Account Name", "Integration Test"); result.Add("Primary Contact", "Test User"); return(result); }
public static Record getUnitTestRecord1() { List <FieldMetadata> structure = new List <FieldMetadata>(new FieldMetadata[] { new FieldMetadata(RecordData.INTERNAL_ID_FIELD_NAME, TrackViaDataType.Number, true, false, new string[] { }), new FieldMetadata("ContactName", TrackViaDataType.ShortAnswer, true, false, new string[] { }), new FieldMetadata("CompanyName", TrackViaDataType.ShortAnswer, true, false, new string[] { }), new FieldMetadata("Locations", TrackViaDataType.CheckBox, true, false, new string[] { "CO", "CA" }), new FieldMetadata("IsCustomer", TrackViaDataType.Number, true, false, new string[] { }), new FieldMetadata("Revenue", TrackViaDataType.Currency, true, false, new string[] { }), new FieldMetadata("RevenueCaptured", TrackViaDataType.Percentage, true, false, new string[] { }), new FieldMetadata("TestFile", TrackViaDataType.Document, true, false, new string[] { }), new FieldMetadata("LastContactDate", TrackViaDataType.Date, true, false, new string[] { }) }); RecordData data = new RecordData(); data.Add(RecordData.INTERNAL_ID_FIELD_NAME, 1L); data.Add("ContactName", "James Randall"); data.Add("CompanyName", "Cryogenic Futures"); data.Add("Locations", new String[] { "CA" }); data.Add("IsCustomer", true); data.Add("Revenue", 100000.0); data.Add("RevenueCaptured", 0.35); data.Add("TestFile", 222L); data.Add("LastContactDate", DateTime.Now.ToString()); return(new Record(structure, data)); }
public void AddData() { Record r = new Record(); r.name = namebox.text; r.score = Score.Get().GetScore(); data.Add(r); ShowRankText(); Save(); }
private void Button_Click_AddEventColor(object sender, RoutedEventArgs e) { if (Text_EventKey.Text != "" && Text_EventColor.Text != "") { eventColor.Add(Text_EventKey.Text, Text_EventColor.Text); RecordManager.SaveRecordData(Const.EventColorConfig, eventColor); Text_EventKey.Text = ""; Text_EventColor.Text = ""; } }
public PrintDataMessage GenSingleTrayLabel(string trayId, string dateFormat, string[] keepers) { PrintDataMessage pdm = new PrintDataMessage(); ValidateMsg <Trays> msg = TraysHelper.TrayCanPrint(trayId); if (msg.Valid) { List <TrayPackView> tpv = TrayPackViewHelper.GetTPVByTrayIdsGropSumPartNr(new List <string>() { trayId }); string[] dateFormats = dateFormat.Split(','); List <PrintTask> tasks = new List <PrintTask>(); foreach (string keeper in keepers) { RecordSet rs = new RecordSet(); PrintTask task = new PrintTask() { DataSet = rs }; foreach (TrayPackView t in tpv) { RecordData label = new RecordData(); label.Add("TrayId", t.trayId); label.Add("Warehouse", t.warehouse); label.Add("Position", t.position); label.Add("customerPNr", t.customerPartNr); label.Add("PartNr", t.partNr); label.Add("Capa", t.capa.ToString()); label.Add("Keeper", keeper); label.Add("CreateTime", t.createTime.ToString(dateFormats[0])); label.Add("StoreCreateTime", t.createTime.ToString(dateFormats[1])); rs.Add(label); } tasks.Add(task); } pdm.PrintTask = tasks; pdm.ReturnedResult = true; } else { pdm.ReturnedResult = false; pdm.ReturnedMessage.Add(msg.ToString()); } return(pdm); }
private static Record Integration_UpdateRecordStep(TrackViaClient client, Record record) { RecordData updateData = new RecordData(); updateData.Add("Primary Contact", "Updated Primary Contact"); updateData.Add("Contact Phone", "555-555-5555"); // Act Record updatedRecord = client.updateRecord(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW, record.Data.Id, updateData); // Assert updatedRecord.ShouldNotBeNull(); updatedRecord.Data.ShouldNotBeNull(); updatedRecord.Data.Id.ShouldEqual(record.Data.Id); updatedRecord.Data["Account Name"].ShouldEqual(record.Data["Account Name"]); updatedRecord.Data["Primary Contact"].ShouldEqual(updateData["Primary Contact"]); updatedRecord.Data["Contact Phone"].ShouldEqual(updateData["Contact Phone"]); return(updatedRecord); }
public static void SaveRecord(string recordName, string key, string value) { RecordData data = GetRecord(recordName); if (data.ContainsKey(key)) { data[key] = value; } else { data.Add(key, value); } SaveData(recordName, data); }
public PrintDataMessage GenSingleTrayLabel(string trayId,string dateFormat,string[] keepers) { PrintDataMessage pdm = new PrintDataMessage(); ValidateMsg<Trays> msg = TraysHelper.TrayCanPrint(trayId); if (msg.Valid) { List<TrayPackView> tpv = TrayPackViewHelper.GetTPVByTrayIdsGropSumPartNr(new List<string>() { trayId }); string[] dateFormats = dateFormat.Split(','); List<PrintTask> tasks = new List<PrintTask>(); foreach (string keeper in keepers) { RecordSet rs = new RecordSet(); PrintTask task = new PrintTask() { DataSet = rs }; foreach (TrayPackView t in tpv) { RecordData label = new RecordData(); label.Add("TrayId", t.trayId); label.Add("Warehouse", t.warehouse); label.Add("Position", t.position); label.Add("customerPNr", t.customerPartNr); label.Add("PartNr", t.partNr); label.Add("Capa", t.capa.ToString()); label.Add("Keeper", keeper); label.Add("CreateTime",t.createTime.ToString(dateFormats[0])); label.Add("StoreCreateTime", t.createTime.ToString(dateFormats[1])); rs.Add(label); } tasks.Add(task); } pdm.PrintTask = tasks; pdm.ReturnedResult = true; } else { pdm.ReturnedResult = false; pdm.ReturnedMessage.Add(msg.ToString()); } return pdm; }
private void InsertRecord() { using (new WaitCursor()) { Record clsRecord = new Record(); if (VerifyData() == true) { SetData(clsRecord); Boolean bSucess = new Boolean(); bSucess = RecordData.Add(clsRecord); if (bSucess == true) { GoBack_To_Grid(); } else { MessageBox.Show("Insert failed.", "Error"); } } } }
static RecordData LoadData(string recordName) { string path = GetSavePath(recordName); if (File.Exists(path)) { string content = FileTool.ReadStringByFile(path); Dictionary <string, string> table = des.Deserialize <Dictionary <string, string> >(content); RecordData data = new RecordData(); foreach (var item in table) { data.Add(item.Key, item.Value); } return(data); } else { return(new RecordData()); } }
static void Main(string[] args) { colorHash.Add("R", "Red"); colorHash.Add("Y", "Yellow"); colorHash.Add("Br", "Brown"); colorHash.Add("W", "White"); colorHash.Add("Gr", "Grey"); colorHash.Add("Or", "Orange"); colorHash.Add("B", "Black"); //string pattern = "^SIDE"; //Regex r = new Regex(pattern, RegexOptions.IgnoreCase); //Regex rr = new Regex("\\w+", RegexOptions.IgnoreCase); //Match m = rr.Match("SIDE8"); //Regex rrr = new Regex("^P", RegexOptions.IgnoreCase); //Match mm = rr.Match("PP00"); //Console.WriteLine(mm.Groups[1].Value); //Console.WriteLine(r.Match("SIDE8").Success); //List<string> cs = Converts("YBr"); //Console.WriteLine("--------------------YBr"); //foreach (string c in cs) { // Console.WriteLine(c); //} //Console.WriteLine("--------------------Y"); //cs = Converts("Y"); //foreach (string c in cs) //{ // Console.WriteLine(c); //} //cs = Converts("BY"); //Console.WriteLine("--------------------BY"); //foreach (string c in cs) //{ // Console.WriteLine(c); //} //cs = Converts("BrY"); //Console.WriteLine("--------------------BrY"); //foreach (string c in cs) //{ // Console.WriteLine(c); //} //cs = Converts("BrBrBrR"); //Console.WriteLine("--------------------BrBrBrR"); //foreach (string c in cs) //{ // Console.WriteLine(c); //} //Console.Read(); string printer = Console.ReadLine(); // Console.WriteLine(printer); // ConfigUtil config = new ConfigUtil("help.sdc"); //// Console.WriteLine(config.Get("Host")); // Console.WriteLine(config.Notes()); // foreach (string node in config.Notes()) { // Console.WriteLine(node); // Console.WriteLine(config.Get("Host",node)); // } // foreach (string f in Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.sdc").ToList()) { // Console.WriteLine(f); // } // Console.WriteLine(DateTime.Now.ToString("HHmmsss")); // Console.WriteLine("J_0001,9".Split(',')[0].TrimStart("J_".ToCharArray())); try { RecordSet rs = new RecordSet(); RecordData rd = new RecordData(); rd.Add("A", "AAA"); rs.Add(rd); if (printer.Length == 0) { printer = "Zebra ZM400 (203 dpi) - ZPL (副本 7)"; } IReportGen gen = new TecITGener(); ReportGenConfig config = new ReportGenConfig() { //Printer = "Microsoft XPS Document Writer", //Printer = "Zebra ZM400 (203 dpi) - ZPL (副本 3)", Printer = printer, NumberOfCopies = 1, PrinterType = (PrinterType)0, Template = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Template\\t2.tff") }; gen.Print(rs, config); } catch (Exception e) { Console.WriteLine(e.Message); Console.Read(); } }