Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
          //  LumexDBPlayer db = LumexDBPlayer.Start();
            DataTable dt = new DataTable();
            ProductBLL product = new ProductBLL();
            dt = product.GetProductNamesOnly();

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string employee = dt.Rows[i]["ProductNameOnly"].ToString() + ";";
                sb.Append(employee).Append(Environment.NewLine);
            }

            context.Response.Write(sb.ToString());
        }
        public static string GetProductNamesOnly()
        {
            ProductBLL product = new ProductBLL();

            try
            {
                DataTable dt = product.GetProductNamesOnly();

                if (dt.Rows.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();

                    string volume = "";

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        volume = dt.Rows[i]["ProductNameOnly"].ToString().Trim();
                        sb.Append(volume).Append(Environment.NewLine);
                    }

                    return sb.ToString();
                }
                else
                {
                    return "No Product saved yet!";
                }
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            finally
            {
                product = null;
            }
        }