Exemplo n.º 1
0
 void gridViewOperation_AfterAdd(gps_device obj)
 {
     gridView1.BestFitColumns();
 }
Exemplo n.º 2
0
        public g_device GetDevice(g_device dev) {
            g_device device = null;
            string IMEI = dev.IMEI;
            if (IMEI == "0") {
                device = new g_device() {
                    id = 0, IMEI = "0", state = "0"
                };
            } else if(IMEI.Length>10) {
                gps_device gpsdevice = Client.ClientHelper.PlatformSqlMap.GetOne<gps_device>("where device_serial='" + IMEI + "'");
                if (gpsdevice == null) {
                    gpsdevice = new gps_device() {
                        device_serial = IMEI,phone_number=dev.jsonData, device_state = "1", device_type = "phone", device_expire = DateTime.Now, device_desc = "程序自动注册"
                    };
                    Client.ClientHelper.PlatformSqlMap.Create<gps_device>(gpsdevice);
                }
                if (gpsdevice.device_id > 0) {
                    device = new g_device();
                    device.id = gpsdevice.device_id;
                    device.state = gpsdevice.device_state;
                    device.IMEI = IMEI;
                }
            }

            Console.WriteLine("{0},调用方法:{1}", DateTime.Now.ToString(), this.GetType().Name + "/GetDevice/"+dev.ToString());
            return device;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(gps_device newobj)
 {
     newobj.device_expire = DateTime.Now;
     newobj.device_made_date = DateTime.Now;
    
 }