コード例 #1
0
        public int Add(C_STORAGE_ITEM NewStorageItem, OleExec DB)
        {
            Row_C_STORAGE_ITEM NewStorageItemRow = (Row_C_STORAGE_ITEM)NewRow();

            NewStorageItemRow.ID           = NewStorageItem.ID;
            NewStorageItemRow.ITEM_NAME    = NewStorageItem.ITEM_NAME;
            NewStorageItemRow.ITEM_SON     = NewStorageItem.ITEM_SON;
            NewStorageItemRow.STORAGE_CODE = NewStorageItem.STORAGE_CODE;
            NewStorageItemRow.EDIT_EMP     = NewStorageItem.EDIT_EMP;
            NewStorageItemRow.EDIT_TIME    = NewStorageItem.EDIT_TIME;
            int result = DB.ExecuteNonQuery(NewStorageItemRow.GetInsertString(DBType), CommandType.Text);

            return(result);
        }
コード例 #2
0
        public List <string> GetByItemName(string ItemName, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item where item_name=:ItemName ";

            OleDbParameter[] paramet = new OleDbParameter[] { new OleDbParameter(":ItemName", ItemName) };
            List <string>    result  = new List <string>();
            DataTable        res     = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);

            if (res.Rows.Count > 0)
            {
                for (int i = 0; i < res.Rows.Count; i++)
                {
                    Row_C_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                    ret.loadData(res.Rows[i]);
                    result.Add(ret.GetDataObject().STORAGE_CODE);
                }
            }
            return(result);
        }
コード例 #3
0
        public C_STORAGE_ITEM GetById(string id, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item where id=:id";

            OleDbParameter[] paramet = new OleDbParameter[] {
                new OleDbParameter(":id", id)
            };
            DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);

            if (res.Rows.Count > 0)
            {
                Row_C_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                ret.loadData(res.Rows[0]);
                return(ret.GetDataObject());
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
        public C_STORAGE_ITEM GetByItemNameAndItemSonAndStorageCode(string ItemName, string ItemSon, string StorageCode, OleExec DB)
        {
            string strSql = $@"select * from c_storage_item where item_name=:ItemName and item_son=:ItemSon and storage_code=:StorageCode";

            OleDbParameter[] paramet = new OleDbParameter[] {
                new OleDbParameter(":ItemName", ItemName),
                new OleDbParameter(":ItemSon", ItemSon),
                new OleDbParameter(":StorageCode", StorageCode)
            };
            DataTable res = DB.ExecuteDataTable(strSql, CommandType.Text, paramet);

            if (res.Rows.Count > 0)
            {
                Row_C_STORAGE_ITEM ret = (Row_C_STORAGE_ITEM)NewRow();
                ret.loadData(res.Rows[0]);
                return(ret.GetDataObject());
            }
            else
            {
                return(null);
            }
        }