UI/Products/ProductAdd.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Models;
using BLL;

namespace UI.Products
{
    public partial class ProductAdd : System.Web.UI.Page
    {
        Manager m = new Manager();
        ProductInfo pi = new ProductInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
            if (!IsPostBack)
            {
                DataBind();
                datalistbind();
            }
        }
        private void DataBind()
        {
            this.DropDownList1.DataSource = m.AllC();
            this.DropDownList1.DataTextField = "classname";
            this.DropDownList1.DataValueField = "classid";
            this.DropDownList1.DataBind();
        }
        private void datalistbind()
        {
            if(Request["id"]!=null&&Request["id"]!=string.Empty)
            {

            }
        }
        protected void Upload_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile)
            {
                string fileName = fileUpload.FileName;
                string fileFix = fileName.Substring(fileName.LastIndexOf(".") + 1).ToLower();
                if (fileFix != "png" && fileFix != "jpg" && fileFix != "jpeg" && fileFix != "gif")
                {
                    Response.Write("<script>alert('上传文件不是图片格式');</script>");
                }
                else
                {
                    string newfileName = DateTime.Now.ToString("hhmmssffff.") + fileFix;
                    fileUpload.SaveAs(Server.MapPath("../") + "//2011//" + newfileName);
                    this.Image1.ImageUrl = "~/2011/" + newfileName;
                    Response.Write("<script>alert('上传成功');</script>");
                }
            }
        }

        protected void btnSure_Click(object sender, EventArgs e)
        {
后面还有 24 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。