예제 #1
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        AddProductTable Pt = new AddProductTable();

        Pt.Pro_Name     = TextBox1.Text;
        Pt.Pro_Category = DropDownList1.SelectedValue.ToString();
        Pt.Co_Name      = TextBox2.Text;

        Pt.Price = Convert.ToInt32(TextBox4.Text);


        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath("~/DashBoard/ProPic/" + FileUpload1.FileName));
        }
        Pt.Pro_Pic = "/DashBoard/ProPic/" + FileUpload1.FileName;
        c.da.AddProductTables.InsertOnSubmit(Pt);
        c.da.SubmitChanges();
        Response.Write("<script>alert('Product added successfullly..!!!')</script>");
        TextBox1.Text = TextBox2.Text = TextBox4.Text = " ";
        DropDownList1.SelectedIndex = 0;
    }
 partial void UpdateAddProductTable(AddProductTable instance);
 partial void DeleteAddProductTable(AddProductTable instance);
 partial void InsertAddProductTable(AddProductTable instance);