示例#1
0
        public static ContactpersonType VerwerkRij(IDataRecord rij)
        {
            ContactpersonType type = new ContactpersonType();

            type.ID = Convert.ToInt32(rij["ID"].ToString());
            type.Name = rij["Name"].ToString();

            return type;

        }
示例#2
0
        public static ContactpersonType GetContactPersonTypeByID(int i)
        {
            ContactpersonType nieuw = new ContactpersonType();
            string sql = "SELECT * FROM ContactPersonType WHERE ID like @ID";
            DbParameter paramID = Database.AddParameter("@ID", i);
            DbDataReader reader = Database.GetData(sql,paramID);

            while (reader.Read())
            {
             nieuw =  VerwerkRijSpecial(reader);
            }
            return nieuw;
        }
示例#3
0
        public static void DeleteType(ContactpersonType SelectedContactPerson)
        {
            try
            {
                DbParameter paramName = Database.AddParameter("@Name", SelectedContactPerson.Name);

                Database.ModifyData("DELETE FROM ContactPersonType WHERE Name = @Name", paramName);
            }
            catch (Exception e)
            {

                throw e;
            }
        }
示例#4
0
        public static void AddType(ContactpersonType SelectedContactPerson)
        {
            try
            {

                DbParameter paramName = Database.AddParameter("@Name", SelectedContactPerson.Name);
                Database.ModifyData("INSERT INTO ContactPersonType (Name) values (@Name)", paramName);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

        }