Example #1
0
        public void BuildInsertTest()
        {
            DefTblCustomers             def = new DefTblCustomers();
            Dictionary <ColDef, object> map = new Dictionary <ColDef, object>();

            map.Add(def.Cid, 1);
            map.Add(def.Company, "test");
            String sql = SqlStatements.BuildInsert(def.TblName, map);

            Assert.AreEqual(String.Format("INSERT INTO {0}({1},{2}) VALUES(1,'test');", def.TblName, def.Cid.Name, def.Company.Name), sql);
        }
Example #2
0
        public static void InsertTestNote()
        {
            DefTblNotes def = new DefTblNotes();
            Dictionary <ColDef, object> map = new Dictionary <ColDef, object>();

            map.Add(def.Id, TestNote.id);
            map.Add(def.Cid, TestNote.cid);
            map.Add(def.CreatedBy, TestNote.createdBy);
            map.Add(def.EntryDate, TestNote.entryDate);
            map.Add(def.Memo, TestNote.memo);
            map.Add(def.Category, TestNote.category);
            map.Add(def.Attachment, TestNote.attachment);
            String sql = SqlStatements.BuildInsert(def.TblName, map);

            CRM_web.Models.Model.Model.GetModel().ExecuteActionQuery(sql);
        }
Example #3
0
        public static void InsertTestContactPerson()
        {
            DefTblContactPersons        def = new DefTblContactPersons();
            Dictionary <ColDef, object> map = new Dictionary <ColDef, object>();

            map.Add(def.Id, TestContactPerson.id);
            map.Add(def.Cid, TestContactPerson.cid);
            map.Add(def.Forename, TestContactPerson.forename);
            map.Add(def.Surname, TestContactPerson.surname);
            map.Add(def.Gender, TestContactPerson.gender);
            map.Add(def.Email, TestContactPerson.email);
            map.Add(def.Phone, TestContactPerson.phone);
            map.Add(def.MainContact, TestContactPerson.mainContact);
            String sql = SqlStatements.BuildInsert(def.TblName, map);

            CRM_web.Models.Model.Model.GetModel().ExecuteActionQuery(sql);
        }
Example #4
0
        public static void InsertTestCustomer()
        {
            DefTblCustomers             def = new DefTblCustomers();
            Dictionary <ColDef, object> map = new Dictionary <ColDef, object>();

            map.Add(def.Cid, TestCustomer.cid);
            map.Add(def.Company, TestCustomer.company);
            map.Add(def.Address, TestCustomer.address);
            map.Add(def.Zip, TestCustomer.zip);
            map.Add(def.City, TestCustomer.city);
            map.Add(def.Country, TestCustomer.country);
            map.Add(def.ContractId, TestCustomer.contractId);
            map.Add(def.ContractDate, TestCustomer.contractDate);
            String sql = SqlStatements.BuildInsert(def.TblName, map);

            CRM_web.Models.Model.Model.GetModel().ExecuteActionQuery(sql);
        }