Exemplo n.º 1
0
        public JournalContentData(journal_contentData d)
        {
            this.ID = d.ID;
            this.CodeOborude = d.CodeOborude;
            this.NameOborude = d.NameOborude;
            this.Smena = d.Smena;
            this.Family = d.Family;
            this.Date = d.Date;
            this.Description = d.Description;
            this.Status = d.Status;
            this.Enable = d.Enable;
            this.ModifyDate = d.ModifyDate;

        }
Exemplo n.º 2
0
 public journal_contentData ToStruct()
 {
     var jd = new journal_contentData();
     jd.ID = this.ID;
     jd.CodeOborude = this.CodeOborude;
     jd.NameOborude = this.NameOborude;
     jd.Smena = this.Smena;
     jd.Family = this.Family;
     jd.Date = this.Date;
     jd.Description = this.Description;
     jd.Status = this.Status;
     jd.Enable = this.Enable;
     jd.ModifyDate = this.ModifyDate;
     return jd;
 }
Exemplo n.º 3
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     var scm = new Smc(Smc.ServiceProviderEnum.DES);
     
     var jd = new journal_contentData();
     jd.CodeOborude = codeOborude.Text;
     jd.Date = DateTime.Now.ToShortDateString();
     jd.Description = descriptionText.Text;
     jd.ModifyDate = DateTime.Now.ToShortDateString();
     jd.Enable = true;
     jd.Family = familyText.Text;
     jd.NameOborude = nameText.Text;
     jd.Smena = smenaText.Text;
     jd.Status = statusText.Text;
     jd.ID = EntryID;
     JournalPacket metadata = new JournalPacket(jd);
     string metatype = metadata.GetType().FullName;
     Client.Instance.SendCommand(Client.Instance.ServerIp, (EntryID != -1 ? OpcoDes.CMSG_SEND_JOURNAL_ENTRY : OpcoDes.CMSG_SEND_JOURNAL_ENTRY), metatype, metadata);
 }
Exemplo n.º 4
0
 public JournalPacket(JournalContentData data)
     : base(data.ID.ToString())
 {
     Data = data.ToStruct();
 }
Exemplo n.º 5
0
 public JournalPacket(journal_contentData data)
     : base(data.ID.ToString())
 {
     Data = data;
 }
Exemplo n.º 6
0
 public void Add(int key, journal_contentData value)
 {
     Dictionary.Add(key, value);
 }
Exemplo n.º 7
0
        public void Set(int Id, journal_contentData Data)
        {
            lock (this)
            {
                if (!Contains(Id))
                    return;

                _entries[Id] = Data;
                //Save();
            }
        }
Exemplo n.º 8
0
        public bool Add(int Id, journal_contentData Data)
        {
            try
            {
                if (Contains(Id))
                    return false;

                _entries.Add(Id, Data);
                //Save();
                return true;
            }
            catch (Exception ex)
            {
                Trace.Write(ex.StackTrace);
                return false;
            }
        }
Exemplo n.º 9
0
        public bool Set(journal_contentData Data)
        {
            lock (this)
            {
                try
                {
                    if (!Contains(Data.ID))
                        return false;

                    journalEntries[Data.ID] = Data;
                    Save();
                    return true;
                }
                catch (Exception exc)
                {
                    LogUtil.ErrorException(exc, false, "Set");
                    s_log.ErrorException("Set", exc);
                    return false;
                }
            }
        }
Exemplo n.º 10
0
 public bool Add(ref journal_contentData Data)
 {
     lock (this)
     {
         try
         {
             if (Contains(Data.ID))
                 return false;
             int new_Id = GenerateId();
             Data.ID = new_Id;
             journalEntries.Add(new_Id, Data);
             Save();
             return true;
         }
         catch (Exception ex)
         {
             Trace.Write(ex.StackTrace);
             GenerateFreeGuids();
             return false;
         }
     }
 }