Esempio n. 1
0
        public List <StockTransactionType> GetMatches(DBSite site, string value_to_search)
        {
            List <StockTransactionType> trn_list = new List <StockTransactionType>();
            StockTransactionType        trn      = null;


            string qry = " SELECT "
                         + " TransactionId"
                         + ", TransactionName"
                         + ", Flow"
                         + " FROM tblStockTransactionMaster"
                         + " WHERE "
                         + " UserId =" + Util_BLL.User.UserId
                         + " AND FYear=" + Util_BLL.User.fYear + " AND"
                         + "(";

            qry += " (TransactionName LIKE '%" + value_to_search + "%') ";

            if (util.isNumeric(value_to_search))
            {
                qry += "OR ( Flow  ='" + value_to_search + "')";
            }

            qry += ")";


            DataTable dt = site.ExecuteSelect(qry);

            SalePurchase sp = new SalePurchase();


            foreach (DataRow row in dt.Rows)
            {
                StoreBll store = new StoreBll();

                trn.StockTransactionId       = util.CheckNullInt(row["TransactionId"]);
                trn.StockTransactionName     = util.CheckNull(row["TransactionName"]);
                trn.StockTransactionFlow     = util.CheckNullInt(row["Flow"]);
                trn.StockTransactionFlowName = store.stock_transaction_type[trn.StockTransactionFlow];

                trn_list.Add(trn);
            }

            return(trn_list);
        }
Esempio n. 2
0
        public List <TaxEntity> GetMatches(DBSite site, string value_to_search)
        {
            List <TaxEntity> tax_list = new List <TaxEntity>();
            TaxEntity        tax      = null;


            string qry = " SELECT "
                         + " TaxId"
                         + ", TaxName"
                         + ", TaxAmount"
                         + ", TaxPercent"
                         + " FROM tblTaxMaster"
                         + " WHERE "
                         + " UserId =" + Util_BLL.User.UserId
                         + " AND FYear=" + Util_BLL.User.fYear + " AND"
                         + "(";

            qry += " (TaxName LIKE '%" + value_to_search + "%') ";

            if (util.isNumeric(value_to_search))
            {
                qry += "OR ( TaxAmount ='" + value_to_search + "')";
                qry += " OR ( TaxPercent ='" + value_to_search + "')";
            }

            qry += ")";


            DataTable dt = site.ExecuteSelect(qry);

            foreach (DataRow row in dt.Rows)
            {
                tax = new TaxEntity();

                tax.TaxId      = util.CheckNullInt(row["TaxId"]);
                tax.TaxName    = util.CheckNull(row["TaxName"]);
                tax.TaxPercent = util.CheckNullDecimal(row["TaxPercent"]);
                tax.TaxAmount  = util.CheckNullDecimal(row["TaxAmount"]);

                tax_list.Add(tax);
            }

            return(tax_list);
        }