示例#1
0
        public DataTable GetStockInList(ToDoListStockInData data)
        {
            string where = "";
            if (data.CODE.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(REQUESTCODE) LIKE '%" + data.CODE.Trim().ToUpper() + "%' ";

            if (data.DUEDATE.Year != 1)
                where += (where == "" ? "" : "AND ") + "TO_DATE(DUEDATE, 'DDMMYYYY') = " + OracleDB.QRDate(data.DUEDATE) + " ";

            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 LOID, PRODUCT, DUEDATE, NAME, CODE, QTY, REMAIN, UNIT, UNITNAME, PRICE, RECEIVE, ORDERTYPE, SUPPLIER, SUPPLIERNAME, REQUESTCODE, ";
            sql += "REQUESTID, 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_STOCKIN ";
            sql += (where == "" ? "" : " WHERE ") + where;
            sql += "ORDER BY DUEDATE, NAME, LOID, CODE ";
            return OracleDB.ExecListCmd(sql);
        }
示例#2
0
 private ToDoListStockInData GetSearchData()
 {
     ToDoListStockInData data = new ToDoListStockInData();
     data.CODE = this.txtCode.Text.Trim();
     data.DUEDATE = this.dtpDueDate.DateValue;
     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;
 }
示例#3
0
 public DataTable GetStockInkList(ToDoListStockInData data)
 {
     return DALObj.GetStockInList(data);
 }