Beispiel #1
0
 public DataTable GetPlanSaleList(PlanOrderSearchData data)
 {
     DataTable dt = SaleDAL.GetPlanSaleList(data);
     double rowIndex = 1;
     foreach (DataRow dRow in dt.Rows)
     {
         dRow["ORDERNO"] = rowIndex;
         rowIndex += 1;
     }
     return dt;
 }
Beispiel #2
0
 private PlanOrderSearchData GetData()
 {
     PlanOrderSearchData data = new PlanOrderSearchData();
     data.YEARFROM = this.txtYearFrom.Text.Trim();
     data.YEARTO = this.txtYearTo.Text.Trim();
     data.CREATEFROM = ctlCreateFrom.DateValue;
     data.CREATETO = ctlCreateTo.DateValue;
     data.CONFIRMFROM = ctlConfirmFrom.DateValue;
     data.CONFIRMTO = ctlConfirmTo.DateValue;
     data.STATUSFROM = this.cmbStatusFrom.SelectedItem.Value;
     data.STATUSTO = this.cmbStatusTo.SelectedItem.Value;
     return data;
 }
Beispiel #3
0
        public DataTable GetPlanMarketList(PlanOrderSearchData data)
        {
            string sql = "SELECT * FROM (SELECT 0 ORDERNO, LOID, CREATEBY, CREATEON, CODE, PLANTYPE, CONFIRMDATE, YEAR, ";
            sql += "CASE STATUS WHEN '" + Constz.Requisition.Status.Approved.Code + "' THEN '" + Constz.Requisition.Status.Approved.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Waiting.Code + "' THEN '" + Constz.Requisition.Status.Waiting.Name + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Void.Code + "' THEN '" + Constz.Requisition.Status.Void.Name + "' ";
            sql += "ELSE '' END AS STATUSNAME, ";
            sql += "CASE STATUS WHEN '" + Constz.Requisition.Status.Approved.Code + "' THEN '" + Constz.Requisition.Status.Approved.Rank + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Waiting.Code + "' THEN '" + Constz.Requisition.Status.Waiting.Rank + "' ";
            sql += "WHEN '" + Constz.Requisition.Status.Void.Code + "' THEN '" + Constz.Requisition.Status.Void.Rank + "' ";
            sql += "ELSE '0' END AS RANK ";
            sql += "FROM PLAN) A ";
            string where = "PLANTYPE = '" + Constz.PlanType.MK + "' ";
            if (data.YEARFROM != "")
                where += (where == "" ? "" : "AND ") + "YEAR >= '" + data.YEARFROM + "' ";

            if (data.YEARTO != "")
                where += (where == "" ? "" : "AND ") + "YEAR <= '" + data.YEARFROM + "' ";

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

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

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

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

            if (data.STATUSFROM != "")
                where += (where == "" ? "" : "AND ") + "RANK >= '" + data.STATUSFROM + "' ";

            if (data.STATUSTO != "")
                where += (where == "" ? "" : "AND ") + "RANK <= '" + data.STATUSTO + "' ";

            sql += (where == "" ? "" : "WHERE " + where) + " ORDER BY CODE ";
            return OracleDB.ExecListCmd(sql);
        }