コード例 #1
0
        /// <summary>
        /// Gets the list of invoices that an item code is currently associated with.
        /// </summary>
        /// <param name="itemCode"></param>
        /// <returns></returns>
        public string getExistingInvoicesOfItemCode(string itemCode)
        {
            try
            {
                List <String> Ret   = new List <String>();
                string        toRet = "";
                int           num   = 0;
                int           cnt   = 0;
                ds = db.ExecuteSQLStatement(SQLQueries.RetrieveLineItems_MatchingIC_InvNum(itemCode), ref num);
                for (int i = 0; i < num; ++i)
                {
                    Ret.Add(ds.Tables[0].Rows[i][0].ToString());
                }
                foreach (string st in Ret)
                {
                    toRet += st;
                    if (num > 0 && cnt != num - 1)
                    {
                        toRet += ", ";
                        cnt++;
                    }
                }

                toRet += ".";

                return(toRet);
            }
            catch (Exception ex)
            {
                //Just throw the exception
                throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "." +
                                    MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
            }
        }