コード例 #1
0
        public DataTable GetDataTableByPartNumber(String PART_NUM)
        {
            String           Query = "SELECT * FROM ADIChild WITH (NOLOCK) WHERE PART_NUM = @PART_NUM";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("PART_NUM", 4000, PART_NUM);
            return(oDm.GetTable());
        }
コード例 #2
0
        public List <ADICategoryExport> GetDataByCatagoryID(String Value)
        {
            String           Query = "SELECT * FROM ADICategoryExport WITH (NOLOCK) WHERE Value = @Value";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("Value", 255, Value);
            return(DataParser.ToList <ADICategoryExport>(oDm.GetTable()));
        }
コード例 #3
0
        public int SetUpdateInterval(String AdiNumber, int UpdateInterval)
        {
            String           Query = "UPDATE ADIProduct1 WITH (ROWLOCK) SET UpdateInterval = @UpdateInterval WHERE AdiNumber = @AdiNumber";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("AdiNumber", 4000, AdiNumber);
            oDm.AddIntegerPara("UpdateInterval", UpdateInterval);
            return(oDm.RunActionQuery());
        }
コード例 #4
0
        public int SetUpdating(String AdiNumber, Boolean IsUpdating)
        {
            String           Query = "UPDATE ADIProduct1 WITH (ROWLOCK) SET IsUpdating = @IsUpdating WHERE AdiNumber = @AdiNumber";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("AdiNumber", 4000, AdiNumber);
            oDm.AddBoolPara("IsUpdating", IsUpdating);
            return(oDm.RunActionQuery());
        }
コード例 #5
0
        public List <TaskDetail> GetDataBySite(Int64 TaskHeaderID, String TaskSite, Int32 TaskStatus)
        {
            String           Query = "SELECT * FROM TaskDetail WHERE TaskSite = @TaskSite AND TaskStatus = @TaskStatus";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("TaskSite", 4000, TaskSite);
            oDm.AddIntegerPara("TaskStatus", TaskStatus);
            return(DataParser.ToList <TaskDetail>(oDm.GetTable()));
        }
コード例 #6
0
        private int Update(String ManufacturerCode, InManufacturerSeries manufacturer)
        {
            String Query = "UPDATE [SecLockManufacturerSeries] SET [Name] = '" + manufacturer.Name
                           + "',[ManufacturerCode] = '" + ManufacturerCode
                           + "' WHERE [Name] = '" + manufacturer.Name + "'";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            return(oDm.RunActionQuery());
        }
コード例 #7
0
        public List <TaskDetail> GetDataScheduledPendingTasks()
        {
            String Query = "SELECT	TD.* FROM	TaskHeader TH WITH (NOLOCK) "
                           + "JOIN TaskDetail TD WITH (NOLOCK) ON TH.ScheduleID = TD.TaskHeaderID "
                           + "WHERE TH.NextRun IS NOT NULL AND TH.NextRun <= GETDATE()";
            SqlCeDataManager oDm = new SqlCeDataManager(ConnectionString, Query, true);

            return(DataParser.ToList <TaskDetail>(oDm.GetTable()));
        }
コード例 #8
0
        public DataTable GetDataTableByPartNumber(String AdiNumber)
        {
            String           Query = "SELECT * FROM ADIInventory WHERE AdiNumber = @AdiNumber";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("AdiNumber", 4000, AdiNumber);

            return(oDm.GetTable());
        }
コード例 #9
0
        public int Insert(String PART_NUM, String PropertyName, String PropertyValue)
        {
            String           Query = "INSERT INTO [ADIChild] WITH (ROWLOCK) ([PART_NUM],[PropertyName],[PropertyValue])VALUES(@PART_NUM, @PropertyName, @PropertyValue)";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("PART_NUM", 4000, PART_NUM);
            oDm.AddVarcharPara("PropertyName", 4000, PropertyName);
            oDm.AddVarcharPara("PropertyValue", 4000, PropertyValue);
            return(oDm.RunActionQuery());
        }
コード例 #10
0
        public FinalExport GetTopBySite(String ExportSite)
        {
            String           Query = "SELECT TOP 1 * FROM FinalExport WHERE ExportSite = @ExportSite ORDER BY CreatedDate";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("ExportSite", 4000, ExportSite);
            List <FinalExport> finalExports = DataParser.ToList <FinalExport>(oDm.GetTable());

            return(finalExports.Count == 0 ? null : finalExports[0]);
        }
コード例 #11
0
        public int UpdateIgnitoMode(Int64 TaskID, Boolean IgnitoMode)
        {
            String           Query = "UPDATE TaskDetail SET IgnitoMode = @IgnitoMode, UpdatedOn = @UpdatedOn) WHERE TaskID = @TaskID";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddIntegerBigPara("TaskID", TaskID);
            oDm.AddBoolPara("IgnitoMode", IgnitoMode);
            oDm.AddDateTimePara("UpdatedOn", DateTime.Now);
            return(oDm.RunActionQuery());
        }
コード例 #12
0
        public int UpdateValue(String PART_NUM, String PropertyName, String PropertyValue)
        {
            String           Query = "UPDATE ADIChild WITH (ROWLOCK) SET PropertyValue = @PropertyValue WHERE PART_NUM = @PART_NUM AND PropertyName = @PropertyName";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("PART_NUM", 4000, PART_NUM);
            oDm.AddVarcharPara("PropertyName", 4000, PropertyName);
            oDm.AddVarcharPara("PropertyValue", 4000, PropertyValue);
            return(oDm.RunActionQuery());
        }
コード例 #13
0
        private int  Update(InManufacturer manufacturer)
        {
            String Query = "UPDATE [SecLockManufacturer] SET [Name] = '" + manufacturer.Name
                           + "',[ImagePath] = '" + manufacturer.ImagePath
                           + "', [Url] = '" + manufacturer.Url
                           + "' WHERE [Code] = '" + manufacturer.Code + "'";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            return(oDm.RunActionQuery());
        }
コード例 #14
0
        public int UpdateImageByID(Int64 ID, String SmallImage, String BigImage)
        {
            String           Query = "UPDATE ADIProduct1 WITH (ROWLOCK) SET SmallImage = @SmallImage, BigImage = @BigImage WHERE ID = @ID";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("SmallImage", 4000, SmallImage);
            oDm.AddVarcharPara("BigImage", 4000, BigImage);
            oDm.AddIntegerBigPara("ID", ID);
            return(oDm.RunActionQuery());
        }
コード例 #15
0
        public List <ADICategoryExport> GetExport()
        {
            String Query = "SELECT ROOT.[Value] [RootValue],ROOT.[DisplayName] [RootDisplayName],PARENT.[Value] [ParentValue],PARENT.[DisplayName] [ParentDisplayName],CHILD.[Value] ,CHILD.[DisplayName] ,CHILD.[CategoryUrl] "
                           + "FROM [ADICategory] ROOT WITH (NOLOCK) JOIN [ADICategory] PARENT  WITH (NOLOCK) ON ROOT.[Value] = PARENT.[ParentValue] "
                           + "JOIN [ADICategory] CHILD WITH (NOLOCK) ON PARENT.[Value] = CHILD.[ParentValue] "
                           + "WHERE ROOT.[ParentValue] IS NULL";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            return(DataParser.ToList <ADICategoryExport>(oDm.GetTable()));
        }
コード例 #16
0
        public int SetProductPriority(String AdiNumber, Boolean PriorityProduct, Int32 LeastCount)
        {
            String           Query = "UPDATE ADIProduct1 WITH (ROWLOCK) SET PriorityProduct = @PriorityProduct, LeastCount = @LeastCount WHERE AdiNumber = @AdiNumber";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("AdiNumber", 4000, AdiNumber);
            oDm.AddBoolPara("PriorityProduct", PriorityProduct);
            oDm.AddIntegerPara("LeastCount", LeastCount);
            return(oDm.RunActionQuery());
        }
コード例 #17
0
        public int Insert(String Value, String DisplayName)
        {
            String Query = "INSERT INTO ADIBrands WITH (ROWLOCK) (Value, DisplayName) "
                           + "VALUES (@Value, @DisplayName)";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("@Value", 255, Value);
            oDm.AddVarcharPara("@DisplayName", 255, DisplayName);
            return(oDm.RunActionQuery());
        }
コード例 #18
0
        public ADIInventoryExport GetDataByProduct(String PART_NUM)
        {
            String           Query = "SELECT * FROM ADIInventoryExport WITH (NOLOCK) WHERE PART_NUM = @PART_NUM";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("PART_NUM", 4000, PART_NUM);
            var list = DataParser.ToList <ADIInventoryExport>(oDm.GetTable());

            return(list.Count == 1 ? list[0] : null);
        }
コード例 #19
0
        public List <TaskDetail> GetDataByTaskDetail(Int64 TaskHeaderID, String TaskSite, String TaskMode, String TaskType, String TaskNameValue)
        {
            String           Query = "SELECT * FROM TaskDetail WHERE TaskSite = @TaskSite AND TaskType = @TaskType AND TaskMode = @TaskMode AND TaskNameValue = @TaskNameValue";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("TaskSite", 4000, TaskSite);
            oDm.AddVarcharPara("TaskType", 4000, TaskType);
            oDm.AddVarcharPara("TaskMode", 4000, TaskMode);
            oDm.AddVarcharPara("TaskNameValue", 4000, TaskNameValue);
            return(DataParser.ToList <TaskDetail>(oDm.GetTable()));
        }
コード例 #20
0
        public int UpdateStatus(Int64 TaskID, String TaskStatusText, int TaskStatus)
        {
            String           Query = "UPDATE TaskDetail SET TaskStatusText = @TaskStatusText, TaskStatus = @TaskStatus, UpdatedOn = @UpdatedOn WHERE TaskID = @TaskID";
            SqlCeDataManager oDm   = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddIntegerBigPara("TaskID", TaskID);
            oDm.AddVarcharPara("TaskStatusText", 4000, TaskStatusText);
            oDm.AddIntegerPara("TaskStatus", TaskStatus);
            oDm.AddDateTimePara("UpdatedOn", DateTime.Now);
            return(oDm.RunActionQuery());
        }
コード例 #21
0
        public int UpdateByBrandValue(String Value, String DisplayName)
        {
            String Query = "UPDATE ADIBrands WITH (ROWLOCK) "
                           + "SET DisplayName = @DisplayName "
                           + "WHERE Value = @Value";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("Value", 255, Value);
            oDm.AddVarcharPara("DisplayName", 255, DisplayName);
            return(oDm.RunActionQuery());
        }
コード例 #22
0
        public void GenerateExport()
        {
            String Query = "INSERT INTO [ADICategoryExport] ([RootValue] ,[RootDisplayName] ,[ParentValue] ,[ParentDisplayName] ,[Value] ,[DisplayName] ,[CategoryUrl]) "
                           + "SELECT ROOT.[Value] ,ROOT.[DisplayName] ,PARENT.[Value] ,PARENT.[DisplayName] ,CHILD.[Value] ,CHILD.[DisplayName] ,CHILD.[CategoryUrl] "
                           + "FROM [ADICategory] ROOT WITH (NOLOCK) JOIN [ADICategory] PARENT  WITH (NOLOCK) ON ROOT.[Value] = PARENT.[ParentValue] "
                           + "JOIN [ADICategory] CHILD WITH (NOLOCK) ON PARENT.[Value] = CHILD.[ParentValue] "
                           + "WHERE ROOT.[ParentValue] IS NULL";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.RunActionQuery();
        }
コード例 #23
0
        public List <TaskDetail> GetDataBySite(Int64 TaskHeaderID, String TaskSite, Int32[] TaskStatus)
        {
            String Query = "SELECT * FROM TaskDetail WHERE TaskHeaderID = @TaskHeaderID AND TaskSite = @TaskSite AND TaskStatus IN ({0})";

            Query = String.Format(Query, String.Join(",", TaskStatus.Select(x => x.ToString()).ToArray()));
            SqlCeDataManager oDm = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddIntegerBigPara("TaskHeaderID", TaskHeaderID);
            oDm.AddVarcharPara("TaskSite", 4000, TaskSite);
            return(DataParser.ToList <TaskDetail>(oDm.GetTable()));
        }
コード例 #24
0
        public int Insert(String Value, String DisplayName, String ParentValue, String CategoryUrl)
        {
            String Query = "INSERT INTO ADICategory WITH (ROWLOCK) (ParentValue, Value, DisplayName, CategoryUrl) "
                           + "VALUES (@ParentValue, @Value, @DisplayName, @CategoryUrl)";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("ParentValue", 255, ParentValue);
            oDm.AddVarcharPara("Value", 255, Value);
            oDm.AddVarcharPara("DisplayName", 4000, DisplayName);
            oDm.AddVarcharPara("CategoryUrl", 4000, CategoryUrl);
            return(oDm.RunActionQuery());
        }
コード例 #25
0
        public int Insert(String ExportSite, String ExportType, String ExportValue)
        {
            String Query = "INSERT INTO FinalExport (ExportSite, ExportType, ExportValue, CreatedDate) "
                           + "VALUES (@ExportSite, @ExportType, @ExportValue, @CreatedDate)";
            SqlCeDataManager oDm = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("ExportSite", 4000, ExportSite);
            oDm.AddVarcharPara("ExportType", 4000, ExportType);
            oDm.AddVarcharPara("ExportValue", 4000, ExportValue);
            oDm.AddDateTimePara("CreatedDate", DateTime.Now);
            return(oDm.RunActionQuery());
        }
コード例 #26
0
        public int Delete(String ExportSite, String ExportType, String ExportValue, DateTime CreatedDate)
        {
            String Query = "DELETE FROM FinalExport WHERE "
                           + "ExportSite = @ExportSite AND ExportType = @ExportType AND ExportValue = @ExportValue AND CreatedDate = @CreatedDate";
            SqlCeDataManager oDm = new SqlCeDataManager(ConnectionString, Query, true);

            oDm.AddVarcharPara("ExportSite", 4000, ExportSite);
            oDm.AddVarcharPara("ExportType", 4000, ExportType);
            oDm.AddVarcharPara("ExportValue", 4000, ExportValue);
            oDm.AddDateTimePara("CreatedDate", CreatedDate);
            return(oDm.RunActionQuery());
        }
コード例 #27
0
        public int UpdateByCatagoryID(String Value, String DisplayName, String ParentValue, String CategoryUrl)
        {
            String Query = "UPDATE ADICategory WITH (ROWLOCK) "
                           + "SET ParentValue = @ParentValue, DisplayName = @DisplayName, CategoryUrl = @CategoryUrl "
                           + "WHERE Value = @Value";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("ParentValue", 255, ParentValue);
            oDm.AddVarcharPara("Value", 255, Value);
            oDm.AddVarcharPara("DisplayName", 4000, DisplayName);
            oDm.AddVarcharPara("CategoryUrl", 4000, CategoryUrl);
            return(oDm.RunActionQuery());
        }
コード例 #28
0
        private int Insert(InProduct product)
        {
            String Query = "INSERT INTO [SecLockProduct] ([Code] ,[Name] ,[Url] ,[ManufacturerCode],[ManufacturerName],[ManufacturerSeries],[CategoyCode],[CategoryName], [YourPrice] ,[ListPrice] ,[ImageUrl1],[ImageUrl2] ,[Stock] ,[Description] ,[TechDoc]) "
                           + "VALUES ('" + product.Code + "' ,'" + product.Name + "' ,'" + product.Url + "' ,'"
                           + product.ManufacturerCode + "', '" + product.ManufacturerName + "', '" + product.ManufacturerSeries + "',  '"
                           + product.CategoyCode + "', '" + product.CategoryName + "', '"
                           + product.YourPrice + "' ,'" + product.ListPrice + "' ,'" + product.ImageUrl1 + "' ,'" + product.ImageUrl2 + "', '"
                           + product.Stock + "' ,'" + (String.IsNullOrEmpty(product.Description) ? String.Empty : product.Description.Replace("\'", "\'\'"))
                           + "' ,'" + (String.IsNullOrEmpty(product.TechDoc) ? String.Empty : product.TechDoc.Replace("'", "''")) + "')";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            return(oDm.RunActionQuery());
        }
コード例 #29
0
        public List <AdiCategory> GetData(Boolean ClearanceZone, Boolean SaleCenter, Boolean OnlineSpecials, Boolean HotDeals, Boolean InStock)
        {
            String Query = "SELECT * FROM ADICategory WITH (NOLOCK) "
                           + "WHERE ClearanceZone = @ClearanceZone AND SaleCenter = @SaleCenter AND OnlineSpecials = @OnlineSpecials AND HotDeals = @HotDeals AND InStock = @InStock";
            SqlCeDataManager oDm = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddBoolPara("ClearanceZone", ClearanceZone);
            oDm.AddBoolPara("SaleCenter", SaleCenter);
            oDm.AddBoolPara("OnlineSpecials", OnlineSpecials);
            oDm.AddBoolPara("HotDeals", HotDeals);
            oDm.AddBoolPara("InStock", InStock);
            return(DataParser.ToList <AdiCategory>(oDm.GetTable()));
        }
コード例 #30
0
        public Int64?GetIDByPartNumber(String AdiNumber)
        {
            String           Query = "SELECT ID FROM ADIProduct1 WITH (NOLOCK) WHERE AdiNumber = @AdiNumber";
            SqlCeDataManager oDm   = new SqlCeDataManager(this.ConnectionString, Query, true);

            oDm.AddVarcharPara("@AdiNumber", 4000, AdiNumber);
            var oDt = oDm.GetTable();

            if (oDt.Rows.Count == 0)
            {
                return(null);
            }
            else
            {
                return((Int64)oDt.Rows[0][0]);
            }
        }