Example #1
0
        public List <C_SKU_VER_MAPPING> GetMappingListBySku(string sku, OleExec sfcdb)
        {
            string sql = "";

            if (string.IsNullOrEmpty(sku))
            {
                sql = $@" select * from C_SKU_VER_MAPPING  ";
            }
            else
            {
                sql = $@" select * from C_SKU_VER_MAPPING where fox_skuno='{sku}' ";
            }
            DataTable dataTable = sfcdb.ExecSelect(sql).Tables[0];
            List <C_SKU_VER_MAPPING> skuMappingList = new List <C_SKU_VER_MAPPING>();
            Row_C_SKU_VER_MAPPING    rowMapping     = null;

            if (dataTable.Rows.Count > 0)
            {
                foreach (DataRow row in dataTable.Rows)
                {
                    rowMapping = (Row_C_SKU_VER_MAPPING)this.NewRow();
                    rowMapping.loadData(row);
                    skuMappingList.Add(rowMapping.GetDataObject());
                }
            }
            return(skuMappingList);
        }
Example #2
0
        public C_SKU_VER_MAPPING GetMappingBySkuAndVersion(string sku, string version, OleExec sfcdb)
        {
            string                sql        = $@" select * from C_SKU_VER_MAPPING where fox_skuno='{sku}' and fox_version1='{version}' ";
            DataTable             dataTable  = sfcdb.ExecSelect(sql).Tables[0];
            C_SKU_VER_MAPPING     skuMapping = null;
            Row_C_SKU_VER_MAPPING rowMapping = null;

            if (dataTable.Rows.Count > 0)
            {
                rowMapping = (Row_C_SKU_VER_MAPPING)this.NewRow();
                rowMapping.loadData(dataTable.Rows[0]);
                skuMapping = rowMapping.GetDataObject();
            }

            return(skuMapping);
        }