⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 watchdetail.aspx.cs

📁 简单手表销售管理(三层开发)源码
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//该源码下载自www.51aspx.com(51aspx.com)

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
 
    protected void dvWatch_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        string smallpicture = Guid.NewGuid().ToString();

        odsWatch.InsertParameters.Add("smallpicture", smallpicture);

        FileUpload fullWatch = dvWatch.FindControl("fullWatch") as FileUpload;


        if (fullWatch.HasFile)
        {

            string filePath = Server.MapPath(Request.ApplicationPath) + @"\Images\Watch\" + smallpicture + ".gif";

            fullWatch.SaveAs(filePath);
        }
    }
    protected void dvWatch_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        
        FileUpload fullWatch = dvWatch.FindControl("fullWatch") as FileUpload;

        if (fullWatch.HasFile)
        {
            Image ImgWatch = dvWatch.FindControl("ImgWatch") as Image;
            string filePath = Server.MapPath(ImgWatch.ImageUrl);

            fullWatch.SaveAs(filePath);
            
        }

        //TextBox texbox = dvWatch.FindControl("txtOldPrice") as TextBox;
        //TextBox texbox = dvWatch.FindControl("txtNewPrice") as TextBox;
        //TextBox texbox = dvWatch.FindControl("txtProductName") as TextBox;
        //FileUpload fullWatch = dvWatch.FindControl("fullWatch") as FileUpload;


      

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -