Beispiel #1
0
        private void bind()
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product     promodel  = probll.GetModel(index);
            Maticsoft.BLL.ProductType   typebll   = new Maticsoft.BLL.ProductType();
            Maticsoft.Model.ProductType typemodel = typebll.GetModel(int.Parse(promodel.ProTypeID.ToString()));
            Maticsoft.BLL.ProductXing   xinbll    = new Maticsoft.BLL.ProductXing();
            Maticsoft.Model.ProductXing xinmodel  = xinbll.GetModel(int.Parse(promodel.ProXingID.ToString()));
            lblchutime.Text   = Convert.ToDateTime(promodel.Prochutime.ToString()).ToString("yyyy-MM-dd");
            lblstarttime.Text = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            lbltitle.Text     = promodel.ProName;
            lbltype.Text      = typemodel.ProTypeTitle;
            lblxinghao.Text   = xinmodel.ProXingTitle;
            Image1.ImageUrl   = promodel.ImageURL;
            txtcontent.Text   = promodel.Procontent;
            if (promodel.Toujian == 1)
            {
                toujian.Visible = false;
            }
            else
            {
                toujian.Visible = true;
            }
        }
Beispiel #2
0
        protected void btnok_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product promodel = probll.GetModel(index);
            promodel.Toujian = 1;
            probll.Update(promodel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<scripe>alert('推荐成功....')</script>");
            bind();
        }
Beispiel #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();
         int typeid = int.Parse(promodel.ProTypeID.ToString());
         Maticsoft.Model.ProductType typemodel = typebll.GetModel(typeid);
         ((Label)e.Item.FindControl("lbltype")).Text = typemodel.ProTypeTitle;
     }
 }
Beispiel #4
0
 private void ShowInfo(int ProID)
 {
     Maticsoft.BLL.Product   bll   = new Maticsoft.BLL.Product();
     Maticsoft.Model.Product model = bll.GetModel(ProID);
     this.lblProID.Text      = model.ProID.ToString();
     this.lblProName.Text    = model.ProName;
     this.lblProTypeID.Text  = model.ProTypeID.ToString();
     this.lblProXingID.Text  = model.ProXingID.ToString();
     this.lblProchutime.Text = model.Prochutime.ToString();
     this.lblFatime.Text     = model.Fatime.ToString();
     this.lblToujian.Text    = model.Toujian?"ÊÇ":"·ñ";
     this.lblHitNum.Text     = model.HitNum.ToString();
     this.lblProcontent.Text = model.Procontent;
 }
        private void bind()
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product promodel = probll.GetModel(index);
            txtfatime.Text        = Convert.ToDateTime(promodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            Image1.ImageUrl       = promodel.ImageURL;
            txtprocontent.Text    = promodel.Procontent;
            txtprotitle.Text      = promodel.ProName;
            txttme.Text           = Convert.ToDateTime(promodel.Prochutime.ToString()).ToString("yyyy-MM-dd");
            drptype.SelectedValue = promodel.ProTypeID.ToString();
            drpxing.SelectedValue = promodel.ProXingID.ToString();
        }
Beispiel #6
0
 private void ShowInfo(int ProID)
 {
     Maticsoft.BLL.Product   bll   = new Maticsoft.BLL.Product();
     Maticsoft.Model.Product model = bll.GetModel(ProID);
     this.lblProID.Text      = model.ProID.ToString();
     this.txtProName.Text    = model.ProName;
     this.txtProTypeID.Text  = model.ProTypeID.ToString();
     this.txtProXingID.Text  = model.ProXingID.ToString();
     this.txtProchutime.Text = model.Prochutime.ToString();
     this.txtFatime.Text     = model.Fatime.ToString();
     this.chkToujian.Checked = model.Toujian;
     this.txtHitNum.Text     = model.HitNum.ToString();
     this.txtProcontent.Text = model.Procontent;
 }
Beispiel #7
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");
         }
     }
 }
        protected void btnok_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            int index = int.Parse(Request.QueryString["ProID"].ToString());

            Maticsoft.Model.Product promodel = probll.GetModel(index);
            if (txtprotitle.Text.Trim() == "")
            {
                lbltitle.Text = "请填写产品名称";
                return;
            }
            promodel.ProName = txtprotitle.Text.Trim();
            lbltitle.Text    = "";
            try
            {
                promodel.ProTypeID = int.Parse(drptype.SelectedValue);
            }
            catch (Exception e1)
            { }
            try
            {
                promodel.ProXingID = int.Parse(drpxing.SelectedValue);
            }
            catch (Exception e2)
            { }
            if (txttme.Text.Trim() == "")
            {
                lblprotime.Text = "请填写产品出品时间";
                return;
            }
            promodel.Prochutime = Convert.ToDateTime(txttme.Text.Trim());
            lblprotime.Text     = "";
            if (txtfatime.Text.Trim() == "")
            {
                lbltime.Text = "请填写发布时间";
                return;
            }
            promodel.Fatime     = Convert.ToDateTime(txtfatime.Text.Trim());
            lbltime.Text        = "";
            promodel.ImageURL   = Image1.ImageUrl;
            promodel.Procontent = txtprocontent.Text.Trim();
            probll.Update(promodel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
            bind();
        }