Beispiel #1
0
        // override object.Equals
        public override bool Equals(object obj)
        {
            //
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            // TODO: write your implementation of Equals() here

            cmemorandum memorandum = obj as cmemorandum;

            if (memorandum.id == id && memorandum.MTIME == MTIME &&
                memorandum.PLACE == PLACE &&
                memorandum.incident == incident &&
                memorandum.CONTACTSID == CONTACTSID)
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        public void dmemorandum(cmemorandum memorandum)
        {
            string       strsql;
            const string MEMORANDUM = "memorandum";

            strsql = $"{usesql}{line}DELETE FROM [dbo].[{MEMORANDUM}] WHERE id='{memorandum.id}';";
            write(strsql);
        }
Beispiel #3
0
 public object Clone(cmemorandum memorandum)
 {
     if (memorandum == null)
     {
         memorandum = new cmemorandum();
     }
     memorandum.id         = id;
     memorandum.MTIME      = MTIME;
     memorandum.PLACE      = PLACE;
     memorandum.incident   = incident;
     memorandum.CONTACTSID = CONTACTSID;
     return(memorandum);
 }
Beispiel #4
0
        public void newmemorandum(cmemorandum memorandum)
        {
            string name = memorandum.CONTACTSID;

            const string contacts = "CONTACTS";
            string       strsql;
            string       id;

            strsql = $"{usesql} SELECT ID FROM {contacts} WHERE NAME='{name}';";
            id     = write(strsql);
            if (string.IsNullOrEmpty(id))
            {
                strsql = $"{usesql}{line}insert into {contacts}(name){line}values('{name}') SELECT @@IDENTITY AS Id;";
                id     = write(strsql);
            }

            string MEMORANDUM = "memorandum";

            strsql = $" UPDATE [dbo].[{MEMORANDUM}]  SET [MTIME] = '{memorandum.MTIME}' ,[PLACE] = '{memorandum.PLACE}' ,[INCIDENT] = '{memorandum.incident}' ,[CONTACTSID] = '{id}' WHERE id='{memorandum.id}'";
            write(strsql);
        }
Beispiel #5
0
        public void addmemorandum(cmemorandum memorandum)
        {
            string       strsql;
            const string MEMORANDUM = "MEMORANDUM";
            const string contacts   = "CONTACTS";
            string       id;

            if (memorandum == null)
            {
                reminder = "添加备忘,添加的备忘空";
                return;
            }

            strsql = $"{usesql}{line} SELECT ID FROM {contacts} WHERE NAME='{memorandum.CONTACTSID}';";
            id     = write(strsql);
            if (string.IsNullOrEmpty(id))
            {
                strsql = $"{usesql}{line}insert into {contacts}(name){line}values('{memorandum.CONTACTSID}') SELECT @@IDENTITY AS Id;";
                id     = write(strsql);
            }

            strsql = $"{usesql}{line}insert into {MEMORANDUM} (Mtime,PLACE,INCIDENT,contactsid){line}values('{memorandum.MTIME}','{memorandum.PLACE}','{memorandum.incident}','{id}');";
            write(strsql);
        }
Beispiel #6
0
        public object Clone()
        {
            cmemorandum memorandum = new cmemorandum();

            return(Clone(memorandum));
        }