/// <summary> /// Zrób ramkę z danymi do edycji kontaktu /// </summary> /// <param name="number"></param> /// <param name="comment"></param> /// <param name="name"></param> /// <param name="id"></param> /// <param name="rid"></param> /// <returns></returns> public string EditContact(string number, string comment, string name, string id, out string rid) { XCTIP packet = new XCTIP(); XCTIPSync xCTIPSync = new XCTIPSync(); XCTIPSyncSendChange_REQ sendChange_REQ = new XCTIPSyncSendChange_REQ(); XCTIPSyncRecords_ANSRow row = new XCTIPSyncRecords_ANSRow(); XCTIPSyncRecords_ANSRowContact contact = new XCTIPSyncRecords_ANSRowContact(); ContactPhone phone = new ContactPhone(); sendChange_REQ.CId = id; sendChange_REQ.Row = new XCTIPSyncRecords_ANSRow[] { row }; row.RowType = "AddField"; row.Contact = new XCTIPSyncRecords_ANSRowContact[] { contact }; //phone.Number = textBox1.Text; phone.Number = number; //phone.Comment = textBox2.Text; phone.Comment = comment; phone.PhoneId = "1"; contact.Phone = new ContactPhone[] { phone }; //contact.Name = label3.Text; contact.Name = name; //contact.ContactId = contactId[label3.Text]; // TODO: fix it //contact.ContactId = StaticFields.contactId[id]; xCTIPSync.SendChange_REQ = new XCTIPSyncSendChange_REQ[] { sendChange_REQ }; packet.SyncItems = new XCTIPSync[] { xCTIPSync }; String xml = ServiceXML.GenericSerialize(packet, true); rid = sendChange_REQ.CId; return(xml); }
/// <summary> /// Zrób ramkę z zapytaniem o automatyczne otrzymywanie informacji o zmianach /// </summary> /// <param name="type"></param> /// <param name="rid"></param> /// <returns></returns> public string SyncAutoChange_REQ(string type, out string rid) { XCTIP packet = new XCTIP(); XCTIPSync xCTIPSync = new XCTIPSync(); XCTIPSyncAutoChange_REQ req = new XCTIPSyncAutoChange_REQ { CId = id++.ToString(), SyncType = type }; xCTIPSync.AutoChange_REQ = new XCTIPSyncAutoChange_REQ[] { req }; packet.SyncItems = new XCTIPSync[] { xCTIPSync }; String xml = ServiceXML.GenericSerialize(packet, true); rid = req.CId; return(xml); }
/// <summary> /// Zrób ramkę rejestrującą do modułu Sync /// </summary> /// <param name="rid"></param> /// <returns></returns> public string SyncRegister_REQ(out string rid) { XCTIP packet = new XCTIP(); XCTIPSync xCTIPSync = new XCTIPSync(); XCTIPSyncRegister_REQ register_REQ = new XCTIPSyncRegister_REQ { CId = id++.ToString(), SyncType = "HistoryMsg", SendOnline = "" }; xCTIPSync.Register_REQ = new XCTIPSyncRegister_REQ[] { register_REQ }; packet.SyncItems = new XCTIPSync[] { xCTIPSync }; String xml = ServiceXML.GenericSerialize(packet, true); rid = register_REQ.CId; return(xml); }