Example #1
0
        public static ArrayList GetReturnSearch(string WHLoid,string SiCode, string DateFrom, string DateTo)
        {
            string str = "";
            ArrayList arrResult = new ArrayList();

            str = " SELECT SICODE, APPROVEDATE, CUSNAME, RQCODE, GRANDTOT, SILOID ";
            str += " FROM V_RETURN_LIST " ;
            str += " WHERE WAREHOUSE = " + WHLoid + " ";

            if (SiCode != "")
            {
                str += " AND UPPER(SICODE) = UPPER ('" + SiCode + "')";
            }

            if (DateFrom != null && DateTo != null)
            {
                str += " AND APPROVEDATE BETWEEN TO_DATE('" + DateFrom + "','DD/MM/YYYY') AND TO_DATE('" + DateTo + "','DD/MM/YYYY')";
            }
            try
            {
                OracleDataReader zRd = OracleDB.ExecQueryCmd(str);
                arrResult.Clear();
                int i = 1;
                while (zRd.Read())
                {
                    ReturnSearchData irData = new ReturnSearchData();
                    irData.SICODE = zRd["SICODE"].ToString();
                    irData.APPROVEDATE = Convert.ToDateTime(zRd["APPROVEDATE"]);
                    irData.CUSNAME = zRd["CUSNAME"].ToString();
                    irData.RQCODE = zRd["RQCODE"].ToString();
                    irData.GRANDTOT = Convert.ToDouble(zRd["GRANDTOT"]);
                    irData.SILOID = Convert.ToDouble(zRd["SILOID"]);
                    arrResult.Add(irData);
                    i = i + 1;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return arrResult;
        }
Example #2
0
        public static ArrayList GetReturnPopup(string WHLoid, string RQCODE_FROM, string RQCODE_TO, string DATEFROM, string DATETO,string CUSCODE, string PDLOID )
        {
            string str = "";
            ArrayList arrResult = new ArrayList();

            str = " SELECT DISTINCT CODE RQCODE ,INVCODE, REQDATE, CFULLNAME ";
            str += " FROM V_INVRETURN_LIST ";
            str += " WHERE WAREHOUSE =" + WHLoid + "";

            if ((RQCODE_FROM != "") && (RQCODE_TO != ""))
                str += " AND CODE BETWEEN '" + RQCODE_FROM + "' AND '" + RQCODE_TO + "'";

            if ((DATEFROM != "") && (DATETO != ""))
                str += " AND TO_DATE(REQDATE,'DD/MM/YYYY') BETWEEN TO_DATE('" + DATEFROM + "','DD/MM/YYYY') AND TO_DATE('" + DATETO + "','DD/MM/YYYY')";

            if (CUSCODE != "")
                str += " AND CCODE ='" + CUSCODE + "'";

            if (PDLOID != "0")
                str += " AND PRODUCT =" + PDLOID + "";


            try
            {
                OracleDataReader zRd = OracleDB.ExecQueryCmd(str);
                arrResult.Clear();
                int i = 1;
                while (zRd.Read())
                {
                    ReturnSearchData irData = new ReturnSearchData();
                    irData.ORDERNO = i;
                    irData.RQCODE = zRd["RQCODE"].ToString();
                    irData.INVCODE = zRd["INVCODE"].ToString();
                    irData.REQDATE = Convert.ToDateTime(zRd["REQDATE"]);
                    irData.CUSNAME = zRd["CFULLNAME"].ToString();
                    arrResult.Add(irData);
                    i = i + 1;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return arrResult;
        }