Example #1
0
        public static void Insert(Mpcportalprodlist data, SqlConnection conn)
        {
            var sql = @"INSERT INTO [dbo].[mpcportalprodlist](
						warehouse,product,description,long_description,supersession,discount,exvat_price,remap_anal,prod_range,key_core_slow,free_stock)
				VALUES (@warehouse,@product,@description,@long_description,@supersession,@discount,@exvat_price,@remap_anal,@prod_range,@key_core_slow,@free_stock)"                ;

            using (var cmd = new SqlCommand(sql, conn))
            {
                cmd.Parameters.AddWithValue("@warehouse", data.warehouse);
                cmd.Parameters.AddWithValue("@product", data.product);
                cmd.Parameters.AddWithValue("@description", data.description);
                cmd.Parameters.AddWithValue("@long_description", data.long_description);
                cmd.Parameters.AddWithValue("@supersession", data.supersession);
                cmd.Parameters.AddWithValue("@discount", data.discount);
                cmd.Parameters.AddWithValue("@exvat_price", data.exvat_price);
                cmd.Parameters.AddWithValue("@remap_anal", (object)data.remap_anal ?? DBNull.Value);
                cmd.Parameters.AddWithValue("@prod_range", data.prod_range);
                cmd.Parameters.AddWithValue("@key_core_slow", (object)data.key_core_slow ?? DBNull.Value);
                cmd.Parameters.AddWithValue("@free_stock", (object)data.free_stock ?? DBNull.Value);
                cmd.ExecuteNonQuery();
            }
        }
Example #2
0
        private void Initialize(IList <slcustm> custData, IList <Mpcportalprodlist> mpcData,
                                IList <oplistm> oplistData = null, IList <opdscntm> opdscData = null)
        {
            using (var conn = GetAndOpenConnection())
            {
                CleanTables(conn);

                foreach (var mpc in mpcData)
                {
                    Mpcportalprodlist.Insert(mpc, conn);
                }

                if (custData != null)
                {
                    foreach (var c in custData)
                    {
                        slcustm.Insert(c, conn);
                    }
                }

                if (oplistData != null)
                {
                    foreach (var d in oplistData)
                    {
                        oplistm.Insert(d, conn);
                    }
                }

                if (opdscData != null)
                {
                    foreach (var d in opdscData)
                    {
                        opdscntm.Insert(d, conn);
                    }
                }
            }
        }
Example #3
0
        private void Initialize(IList <Mpcportalprodlist> mpcData, IList <PINNstock3> pinnStock3Data = null, IList <poheadm> poHeaders = null, IList <podetm> poDetails = null)
        {
            using (var conn = GetAndOpenConnection())
            {
                CleanTables(conn);

                foreach (var mpc in mpcData)
                {
                    Mpcportalprodlist.Insert(mpc, conn);
                }

                if (pinnStock3Data != null)
                {
                    foreach (var pd in pinnStock3Data)
                    {
                        PINNstock3.Insert(pd, conn);
                    }
                }

                if (poHeaders != null)
                {
                    foreach (var h in poHeaders)
                    {
                        poheadm.Insert(h, conn);
                    }
                }

                if (poDetails != null)
                {
                    foreach (var d in poDetails)
                    {
                        podetm.Insert(d, conn);
                    }
                }
            }
        }
Example #4
0
 public StockTablesData(Mpcportalprodlist mpc)
 {
     Initialize(new List <Mpcportalprodlist> {
         mpc
     });
 }
Example #5
0
        private void Initialize(IList <Mpcportalprodlist> mpcData, IList <opheadm> headers, IList <opdetm> details, IList <opaudm> audits,
                                IList <poheadm> poHeaders = null, IList <podetm> poDetails = null, IList <cevatm> cevatmList = null, IList <slcustm> customers = null)
        {
            using (var conn = GetAndOpenConnection())
            {
                CleanTables(conn);

                if (mpcData != null)
                {
                    foreach (var mpc in mpcData)
                    {
                        Mpcportalprodlist.Insert(mpc, conn);
                    }
                }

                if (headers != null)
                {
                    foreach (var h in headers)
                    {
                        opheadm.Insert(h, conn);
                    }
                }

                if (details != null)
                {
                    foreach (var d in details)
                    {
                        opdetm.Insert(d, conn);
                    }
                }

                if (audits != null)
                {
                    foreach (var a in audits)
                    {
                        opaudm.Insert(a, conn);
                    }
                }

                if (poHeaders != null)
                {
                    foreach (var h in poHeaders)
                    {
                        poheadm.Insert(h, conn);
                    }
                }

                if (poDetails != null)
                {
                    foreach (var d in poDetails)
                    {
                        podetm.Insert(d, conn);
                    }
                }

                if (cevatmList != null)
                {
                    foreach (var c in cevatmList)
                    {
                        cevatm.Insert(c, conn);
                    }
                }

                if (customers != null)
                {
                    foreach (var c in customers)
                    {
                        slcustm.Insert(c, conn);
                    }
                }
            }
        }