Example #1
0
        public void ImportInfoPosisInfo()
        {
            string tableName = "POSISINFO";

            using (DataTable impTable = GetData("DemoData." + tableName))
            {
                foreach (DataRow row in impTable.Select())
                {
                    SqlInsert sqlInsert = new SqlInsert(tableName);
                    if (row["ID"] != DBNull.Value)
                    {
                        sqlInsert.Add("ID", Convert.ToString(row["ID"]));
                    }
                    if (row["TEXT"] != DBNull.Value)
                    {
                        sqlInsert.Add("TEXT", Convert.ToString(row["TEXT"]));
                    }

                    dbUtil.Execute(sqlInsert);
                }
            }
            RaiseTableImported(tableName);
        }
Example #2
0
        private void ImportIntoPosisErrors()
        {
            string tableName = "RETAILERRORS";

            using (DataTable impTable = GetData("DemoData." + tableName))
            {
                foreach (DataRow row in impTable.Select())
                {
                    SqlInsert sqlInsert = new SqlInsert(tableName);
                    if (row["ERRORID"] != DBNull.Value)
                    {
                        sqlInsert.Add("ERRORID", Convert.ToInt32(row["ERRORID"]));
                    }
                    if (row["ERRORMESSAGEID"] != DBNull.Value)
                    {
                        sqlInsert.Add("ERRORMESSAGEID", Convert.ToInt32(row["ERRORMESSAGEID"]));
                    }
                    if (row["DESCRIPTION"] != DBNull.Value)
                    {
                        sqlInsert.Add("DESCRIPTION", Convert.ToString(row["DESCRIPTION"]));
                    }
                    if (row["CODEUNIT"] != DBNull.Value)
                    {
                        sqlInsert.Add("CODEUNIT", Convert.ToString(row["CODEUNIT"]));
                    }
                    if (row["ACTIVE"] != DBNull.Value)
                    {
                        sqlInsert.Add("ACTIVE", Convert.ToInt32(row["ACTIVE"]));
                    }
                    if (row["FIRSTINVERSION"] != DBNull.Value)
                    {
                        sqlInsert.Add("FIRSTINVERSION", Convert.ToString(row["FIRSTINVERSION"]));
                    }
                    if (row["DATECREATED"] != DBNull.Value)
                    {
                        sqlInsert.Add("DATECREATED", Convert.ToDateTime(row["DATECREATED"]));
                    }

                    dbUtil.Execute(sqlInsert);
                }
            }
            RaiseTableImported(tableName);
        }