예제 #1
0
 private void ShowInfo(int ProXingID)
 {
     Maticsoft.BLL.ProductXing   bll   = new Maticsoft.BLL.ProductXing();
     Maticsoft.Model.ProductXing model = bll.GetModel(ProXingID);
     this.lblProXingID.Text    = model.ProXingID.ToString();
     this.txtProTypeID.Text    = model.ProTypeID.ToString();
     this.txtProXingTitle.Text = model.ProXingTitle;
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["ProID"] != null)
         {
             if (Request.QueryString["ProID"].ToString() != "")
             {
                 int proid = int.Parse(Request.QueryString["ProID"].ToString());
                 Maticsoft.BLL.Product       probll    = new Maticsoft.BLL.Product();
                 Maticsoft.Model.Product     promodel  = probll.GetModel(proid);
                 Maticsoft.BLL.ProductType   typebll   = new Maticsoft.BLL.ProductType();
                 Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString()));
                 Maticsoft.BLL.ProductXing   xingbll   = new Maticsoft.BLL.ProductXing();
                 Maticsoft.Model.ProductXing xingmodel = xingbll.GetModel(int.Parse(promodel.ProXingID.ToString()));
                 lblFatime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
                 int hitnum = 0;
                 if (promodel.HitNum != null)
                 {
                     promodel.HitNum = promodel.HitNum + 1;
                     probll.Update(promodel);
                     lblHitNum.Text = promodel.HitNum.ToString();
                 }
                 else
                 {
                     promodel.HitNum = 1;
                     probll.Update(promodel);
                     lblHitNum.Text = promodel.HitNum.ToString();
                 }
                 lblProcontent.Text   = promodel.Procontent;
                 lblProName.Text      = promodel.ProName;
                 lblProName1.Text     = promodel.ProName;
                 lblProTypeTitle.Text = typemodel.ProTypeTitle;
                 lblProXingTitle.Text = xingmodel.ProXingTitle;
                 ImgImageURL.ImageUrl = promodel.ImageURL;
             }
             else
             {
                 Response.Redirect("product.aspx");
             }
         }
         else
         {
             Response.Redirect("product.aspx");
         }
     }
 }
예제 #3
0
 protected void datapro_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Maticsoft.BLL.Product pronll = new Maticsoft.BLL.Product();
         int proid = int.Parse(datapro.DataKeys[e.Item.ItemIndex].ToString());
         Maticsoft.Model.Product   promodel = pronll.GetModel(proid);
         Maticsoft.BLL.ProductType typebll  = new Maticsoft.BLL.ProductType();
         Maticsoft.BLL.ProductXing xingbll  = new Maticsoft.BLL.ProductXing();
         int typeid = int.Parse(promodel.ProTypeID.ToString());
         int xingid = int.Parse(promodel.ProXingID.ToString());
         Maticsoft.Model.ProductType typemodel = typebll.GetModel(typeid);
         Maticsoft.Model.ProductXing xingmodel = xingbll.GetModel(xingid);
         ((Label)e.Item.FindControl("lnlProXingID")).Text = xingmodel.ProXingTitle;
         ((Label)e.Item.FindControl("lblProTypeID")).Text = typemodel.ProTypeTitle;
     }
 }