public static List<string> getProductsById(int PID) { 
     List<string> list = new List<string>();
     Entity.Products product = new BLL.Products().GetProductInfo(PID);
     list.Add(product.getCategoryID().ToString());
     list.Add(product.getName());
     list.Add(product.getDescription());  
     return list;
 }
Exemple #2
0
 public void ProcessRequest(HttpContext context)
 {
     BLL.Products bllPro=new BLL.Products();
     int cid = Convert.ToInt32(context.Request.Form["catid"]);
     List<MODEL.Products> list = bllPro.GetProductsByCid(cid);
     JavaScriptSerializer jss = new JavaScriptSerializer();
     context.Response.Write(jss.Serialize(list));
 }
Exemple #3
0
        static void Main(string[] args)
        {
            BLL.Products p = new BLL.Products();

            Console.WriteLine("TestApp");
            Console.WriteLine();
            Console.WriteLine(p.ToString());
            Console.ReadKey();
        }
        // GET: /<controller>/
        public IActionResult Index()
        {
            BLL.Products products = new BLL.Products();

            ViewData["Message"] = "Products List";
            //ViewData["List"] = products.ToString();

            return(View(products.GetProducts()));
        }
Exemple #5
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     BLL.Products bllPro = new BLL.Products();
     int id = Convert.ToInt32(context.Request.Form["id"]);
     if (bllPro.DeleteProduct(id))
     {
         context.Response.Write("OK");
     }
 }
Exemple #6
0
        public static List <string> getProductsById(int PID)
        {
            List <string> list = new List <string>();

            Entity.Products product = new BLL.Products().GetProductInfo(PID);
            list.Add(product.getCategoryID().ToString());
            list.Add(product.getName());
            list.Add(product.getDescription());
            return(list);
        }
Exemple #7
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     BLL.Products bllPro = new BLL.Products();
     int cid = Convert.ToInt32(context.Request.Form["cid"]);
     int pid = Convert.ToInt32(context.Request.QueryString["pid"]);
     DataTable dt = bllPro.GetPagedList(cid,pid,10);
     //JavaScriptSerializer jss = new JavaScriptSerializer();
     context.Response.Write(dt);
 }
Exemple #8
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     BLL.Products bllPro = new BLL.Products();
     int id = Convert.ToInt32(context.Request.Form["id"]);
     string newName = context.Request.Form["newName"];
     if (bllPro.UpdateFileName(id, newName) > 0)
     {
         context.Response.Write("OK");
     }
 }
Exemple #9
0
        //绑定数据
        private void ShowInfo()
        {

            Model.User userMod = new Model.User();
            BLL.User userBll = new BLL.User();
            Model.Products proMod = new Model.Products();
            BLL.Products proBll = new BLL.Products();
            userMod = userBll.GetModel(Convert.ToInt32(model.UserID));
            proMod = proBll.GetModel(Convert.ToInt32(model.ParentId));
            this.lbChanel.Text = model.Title;
            this.lbProducts.Text = proMod.Title;
            this.lbBak1.Text = model.Bak1;
            this.lbUser.Text = userMod.Name;
            this.ddlStatus.SelectedValue = model.Status.ToString();
            
        }
Exemple #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.ProductsCate bllPcate = new BLL.ProductsCate();
     List<MODEL.ProductsCate> list= bllPcate.GetAllProCate();
     BLL.Products bllPro = new BLL.Products();
           //<li><a href="html/lhq2.html">好斯基 <span class="ui-li-count">62</span></a></li>
     foreach (var item in list)
     {
         int ProductCount = bllPro.GetRecordCount(item.Id);
         productTitle.Append("<li><a href='Products.aspx?cid=" + item.Id + "'>");
         productTitle.Append(item.Catname);
         productTitle.Append("<span class='ui-li-count'>");
         productTitle.Append(ProductCount);
         productTitle.Append("</span></a></li>");
     }
     GenerateNewsTitle();
 }
Exemple #11
0
 void LoadPhoto(int cid, int pid)
 {
     BLL.Products bllPro = new BLL.Products();
     DataTable dt = bllPro.GetPagedList(cid, pid, pageCount);
     if (dt.Rows.Count == 0)
     {
         sbHtml.Append("没有数据!");
     }
     else
     {
         foreach (DataRow row in dt.Rows)
         {
             sbHtml.Append("<li>");
             sbHtml.Append("<a href='" + row["path"] + "' class='fancybox' data-fancybox-group='gallery'><img src=" + row["path"] + " class='fancybox-image'></a>").Append(row["name"]);
             sbHtml.Append("</li>");
         }
     }
 }
Exemple #12
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/html";
     MODEL.Products model = new MODEL.Products();
     model.Catid = Convert.ToInt32(context.Request.QueryString["cid"]);
     HttpPostedFile files = context.Request.Files["fileData"];
     string fileName = DateTime.Now.ToString("yyyyMMddHHmmss") + DateTime.Now.Millisecond;
     string uploadPath = context.Server.MapPath("/upload");
     string fileExtension = Path.GetExtension(files.FileName);
     model.Path = "upload/" + fileName + fileExtension;
     model.Name = files.FileName;
     BLL.Products bllPro = new BLL.Products();
     if (bllPro.AddProducts(model))
     {
         files.SaveAs(uploadPath + "\\" + fileName +fileExtension);
         context.Response.Write("OK");
     }
 }
Exemple #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int cid = Convert.ToInt32(Context.Request.QueryString["cid"]);
     // int pageId = Context.Request.QueryString["pageId"] == null ? 1 : Convert.ToInt32(Context.Request.QueryString["pageId"]);
     int pageId = 1;
     BLL.Products bllPro = new BLL.Products();
     DataTable dt = bllPro.GetPagedList(cid, pageId, 10);
     if (dt.Rows.Count == 0)
         sbHtml.Append("没有数据!");
     else
     {
         foreach (DataRow dr in dt.Rows)
         {
             sbHtml.Append("<li><a href='#'  class='pics'  id=" + Convert.ToInt32(dr["id"]) + ">");
             sbHtml.Append("<img src=../" + dr["path"] + "><h2>" + dr["name"] + "</h2><p>" + dr["name"] + " </p></a></li>");
         }
     }
 }
Exemple #14
0
 int GetRecordCount(int catid)
 {
     BLL.Products bllPro = new BLL.Products();
     return bllPro.GetRecordCount(catid);
 }