Ejemplo n.º 1
0
 public int Delete(LensProtection entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Delete(entityToInsert));
     }
 }
Ejemplo n.º 2
0
        private void GetLensProtection()
        {
            string message = "LensProtectionCommand/Get\r\n";

            byte[] data = Encoding.UTF8.GetBytes(message);
            if (CommunicationClass.stream2 == null)
            {
                return;
            }
            CommunicationClass.stream2.Write(data, 0, data.Length);
            data = new byte[1024 * 100];
            int bytes = CommunicationClass.stream2.Read(data, 0, data.Length);

            message = Encoding.UTF8.GetString(data, 0, bytes).Replace("\r\n", "");
            List <LensProtection> lensProtectionList = JsonConvert.DeserializeObject <List <LensProtection> >(message);

            lensProtection = lensProtectionList[0];
            Action action = delegate()
            {
                textBox1.Text    = lensProtection.SummerMonth.Split('-')[0];
                textBox2.Text    = lensProtection.SummerMonth.Split('-')[1];
                textBox3.Text    = lensProtection.WinterMonth.Split('-')[0];
                textBox4.Text    = lensProtection.WinterMonth.Split('-')[1];
                S_startTime.Text = lensProtection.SummerTimeBegin;
                S_endTime.Text   = lensProtection.SummerTimeEnd;
                W_startTime.Text = lensProtection.WinterTimeBegin;
                W_endTime.Text   = lensProtection.WinterTimeEnd;
            };

            Invoke(action);
        }
Ejemplo n.º 3
0
 public Guid Insert(LensProtection entityToInsert)
 {
     using (Conn)
     {
         return(Conn.Insert <Guid>(entityToInsert));
     }
 }