コード例 #1
0
        public void dproperty(cproperty property)
        {
            string       strsql;
            const string PROPERTY = "property";

            strsql = $"{usesql}{line}DELETE FROM [dbo].[{PROPERTY}] WHERE id='{property.id}';";
            write(strsql);
        }
コード例 #2
0
        public void newproperty(cproperty property)
        {
            string name = property.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 PROPERTY = "property";

            strsql = $" UPDATE [dbo].[{PROPERTY}]  SET [terminal] ='{property.terminal}' ,[PMONEY] = '{property.PMONEY}',[MTIME] ='{property.MTIME}',[CONTACTSID] = '{id}' WHERE id='{property.id}'";
            write(strsql);
        }
コード例 #3
0
        public void addproperty(cproperty property)
        {
            string       strsql;
            const string PROPERTY = "property";
            const string contacts = "CONTACTS";
            string       id;

            if (property == null)
            {
                return;
            }

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

            strsql = $"{usesql}{line}insert into {PROPERTY}(PMONEY,MTIME,terminal,[CONTACTSID]) values('{property.PMONEY}','{property.MTIME}','{property.terminal}','{id}')";
            write(strsql);
        }