Exemple #1
0
        public DataTable GetMinimumStockList(ToDoListMinimumStockData data)
        {
            string where = "";
            if (data.ORDERTYPE.Trim() != "")
                where += (where == "" ? "" : "AND ") + "ORDERTYPE = '" + data.ORDERTYPE + "' ";

            if (data.PRODUCTNAME.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(NAME) LIKE '%" + data.PRODUCTNAME.Trim().ToUpper() + "%' ";

            if (data.STATUS.Trim() != "")
                where += (where == "" ? "" : "AND ") + "STATUS = '" + data.STATUS + "' ";

            if (data.WAREHOUSE != 0)
                where += (where == "" ? "" : "AND ") + "WAREHOUSE = " + data.WAREHOUSE.ToString() + " ";

            string sql = "SELECT WAREHOUSE, LOID, BARCODE, NAME, QTY, UNITNAME, LEADTIME, LOTSIZE, MINIMUM, REQUESTID, REQUESTCODE, ORDERTYPE, UNIT, REFTABLE, ";
            sql += "CASE ORDERTYPE WHEN '" + Constz.OrderType.PD.Code + "' THEN '" + Constz.OrderType.PD.Name + "' ";
            sql += "WHEN '" + Constz.OrderType.PO.Code + "' THEN '" + Constz.OrderType.PO.Name + "' ";
            sql += "ELSE '' END ORDERTYPENAME, CASE STATUS WHEN '" + Constz.Requisition.Status.Approved.Code + "' THEN '" + Constz.Requisition.Status.Approved.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Finish.Code + "' THEN '" + Constz.Requisition.Status.Finish.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Void.Code + "' THEN '" + Constz.Requisition.Status.Void.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Waiting.Code + "' THEN '" + Constz.Requisition.Status.Waiting.Name + "' ";
            sql += "ELSE '' END STATUS ";
            sql += "FROM V_TODOLIST_WH_MINSTOCK ";
            sql += (where == "" ? "" : " WHERE ") + where;
            sql += "ORDER BY BARCODE,  REQUESTCODE ";
            return OracleDB.ExecListCmd(sql);
        }
 private ToDoListMinimumStockData GetSearchData()
 {
     ToDoListMinimumStockData data = new ToDoListMinimumStockData();
     data.ORDERTYPE = this.cmbOrderType.SelectedItem.Value;
     data.PRODUCTNAME = this.txtName.Text.Trim();
     data.STATUS = this.cmbStatus.SelectedItem.Value;
     data.WAREHOUSE = Authz.CurrentUserInfo.Warehouse;
     return data;
 }
Exemple #3
0
 public DataTable GetMinimumStockList(ToDoListMinimumStockData data)
 {
     return DALObj.GetMinimumStockList(data);
 }