Exemplo n.º 1
0
 public static bool Update(POCXml pxml)
 {
     return(Update(new List <POCXml>()
     {
         pxml
     }));
 }
Exemplo n.º 2
0
 public static bool Insert(POCXml pxml)
 {
     return(Insert(new List <POCXml>()
     {
         pxml
     }));
 }
Exemplo n.º 3
0
        private static SqlCommand CreateInsertCommand(POCXml pXml)
        {
            // insert statement
            const string INSERT_STATEMENT = "INSERT INTO ConversionXml " +
                                            "(Xml_TypeId, XmlFile) VALUES " +
                                            "(@TypeId, @XmlFile)";

            // create insert command
            SqlCommand cmd = new SqlCommand(INSERT_STATEMENT);

            // add values to command
            cmd.Parameters.AddWithValue("@TypeId", pXml.Xml_TypeId);
            cmd.Parameters.Add(new SqlParameter("@XmlFile", SqlDbType.Xml)
            {
                Value = pXml.XmlFile,
            });

            // return command
            return(cmd);
        }
Exemplo n.º 4
0
        public static SqlCommand CreateUpdateCommand(POCXml pXml)
        {
            // update statement
            const string UPDATE_STATEMENT = "UPDATE ConversionXml " +
                                            "SET Xml_TypeId = @TypeId, XmlFile = @XmlFile " +
                                            "WHERE Xml_Id = @Id";

            // create insert command
            SqlCommand cmd = new SqlCommand(UPDATE_STATEMENT);

            // add values to command
            cmd.Parameters.AddWithValue("@Id", pXml.Xml_Id);
            cmd.Parameters.AddWithValue("@TypeId", pXml.Xml_TypeId);
            cmd.Parameters.Add(new SqlParameter("@XmlFile", SqlDbType.Xml)
            {
                Value = pXml.XmlFile,
            });

            // return command
            return(cmd);
        }