Esempio n. 1
0
        public DataTable GetPlanDetailList(PlanDetailSearchData data)
        {
            string sql = "SELECT V.* FROM V_PLANPURCHASE V ";
            string where = "";
            if (data.YEAR != 0)
                where += (where == "" ? "" : " AND ") + "V.YEAR = " + data.YEAR.ToString() + " ";

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

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

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

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

            sql += (where == "" ? "" : "WHERE " + where) + " ORDER BY PLAN, PRODUCTNAME ";
            return OracleDB.ExecListCmd(sql);
        }
Esempio n. 2
0
 private PlanDetailSearchData GetSearchData()
 {
     PlanDetailSearchData data = new PlanDetailSearchData();
     data.YEAR = Convert.ToDouble(this.txtYear.Text == "" ? "0" : this.txtYear.Text);
     data.PRODUCTGROUP = Convert.ToDouble(this.cmbProductGroup.SelectedItem.Value);
     data.PRODUCTTYPE = Convert.ToDouble(this.cmbProductType.SelectedItem.Value);
     data.PRODUCTNAME = this.txtProductKey.Text.Trim();
     data.MONTH = Convert.ToDouble(this.cmbMonth.SelectedItem.Value);
     return data;
 }
Esempio n. 3
0
 public DataTable GetPlanDetailList(PlanDetailSearchData data)
 {
     return PlanObj.GetPlanDetailList(data);
 }