示例#1
0
 private StockInReturnSearchData GetSearchData()
 {
     StockInReturnSearchData data = new StockInReturnSearchData();
     data.DATEFROM = this.dtpDateFrom.Value.Date;
     data.DATETO = this.dtpDateTo.Value.Date;
     data.CODE = this.txtStockInCode.Text.Trim();
     return data;
 }
示例#2
0
 public DataTable GetStockInList(StockInReturnSearchData data)
 {
     DataTable dt = SearchObj.GetStockInList(data);
     int i = 1;
     foreach (DataRow dRow in dt.Rows)
     {
         dRow["ORDERNO"] = i;
         i += 1;
     }
     return dt;
 }
示例#3
0
        public DataTable GetStockInList(StockInReturnSearchData data)
        {
            string where = "S.DOCTYPE = " + Constz.DocType.RetShop.LOID.ToString() + " ";
            if (data.CODE.Trim() != "")
                where += (where == "" ? "" : "AND ") + "UPPER(S.CODE) LIKE '%" + data.CODE.Trim().ToUpper() + "%' ";

            if (data.DATEFROM.Year != 1)
                where += (where == "" ? "" : "AND ") + "TO_DATE(S.RECEIVEDATE, 'DD/MM/YYYY') >= " + OracleDB.QRDate(data.DATEFROM) + " ";

            if (data.DATETO.Year != 1)
                where += (where == "" ? "" : "AND ") + "TO_DATE(S.RECEIVEDATE, 'DD/MM/YYYY')  <= " + OracleDB.QRDate(data.DATETO) + " ";

            string sql = "SELECT 0 ORDERNO, S.CODE, S.RECEIVEDATE, R.CODE INVOICECODE, TITLE.NAME || C.NAME || ' ' || C.LASTNAME CUSTOMERNAME, S.TOTAL, S.LOID, ";
            sql += "CASE S.STATUS WHEN '" + Constz.Requisition.Status.Waiting.Code + "' THEN '" + Constz.Requisition.Status.Waiting.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Approved.Code + "' THEN '" + Constz.Requisition.Status.Approved.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Void.Code + "' THEN '" + Constz.Requisition.Status.Void.Name + "' END STATUSNAME ";
            sql += "FROM STOCKIN S LEFT JOIN REQUISITION R ON R.LOID = S.REFLOID AND S.REFTABLE = 'REQUISITION' ";
            sql += "LEFT JOIN CUSTOMER C ON C.LOID = R.CUSTOMER ";
            sql += "LEFT JOIN TITLE ON TITLE.LOID = C.TITLE ";
            sql += (where == "" ? "" : "WHERE ") + where;
            sql += "ORDER BY S.CODE ";
            return OracleDB.ExecListCmd(sql);
        }