示例#1
0
 private static void SaveToDB(CSource.CMobilePhone phone_,
                              List <Contact> contacts_, List <Call> calls_, List <Sms> sms_)
 {
     using (DataStore ds = new DataStore())
     {
         DeviceInfo devInfo = new DeviceInfo();
         devInfo.Label = phone_.Label;
         Device dev1 = ds.createDevice(phone_.UniqueIdentifier, "phone", devInfo);
         if (contacts_ != null)
         {
             foreach (var c in contacts_)
             {
                 var contact = dev1.createContact(c.Name, 0);
                 contact.addTextProp(257, c.Number);
             }
         }
         if (calls_ != null)
         {
             foreach (var c in calls_)
             {
                 dev1.addCall(c.Number, c.Duration, c.Status, c.StartTime, c.StopTime, (int)c.Type);
             }
         }
         if (sms_ != null)
         {
             foreach (var s in sms_)
             {
                 dev1.addSMS((int)s.SendReceive, s.SMSInfo);
             }
         }
         ds.commit();
     }
 }
示例#2
0
 private static void SaveToDB(CSource source_, string rootFolder_)
 {
     using (DataStore ds = new DataStore())
     {
         DeviceInfo devInfo = new DeviceInfo();
         devInfo.Label = source_.Label;
         Device dev1 = ds.createDevice(source_.UniqueIdentifier, "simcard", devInfo);
         if (rootFolder_ != null)
         {
             dDevFileSystem devFS = dev1.createDevFileSystem(rootFolder_);
             ds.commit();
         }
     }
 }