rahim_shirkhani
سه شنبه 10 اردیبهشت 1392, 11:12 صبح
private void Save_To_TBSetProduct()
{
int pid = Convert.ToInt32(DropDownList1.Text.ToString());
DataClassesDataContext db = new DataClassesDataContext();
db.SetProducts.InsertOnSubmit(
new SetProduct { PID = pid, Header = txtHeader.Text, Image = "~/ImageProduct/" + FileUpload1.FileName, Discribtion = txtdes.Text });
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(Request.PhysicalApplicationPath +
"ImageProduct/" + FileUpload1.FileName);
Label2.Visible =
true;
}
else
{
Label3.Visible =
true;
}
db.SubmitChanges();
}
}
{
int pid = Convert.ToInt32(DropDownList1.Text.ToString());
DataClassesDataContext db = new DataClassesDataContext();
db.SetProducts.InsertOnSubmit(
new SetProduct { PID = pid, Header = txtHeader.Text, Image = "~/ImageProduct/" + FileUpload1.FileName, Discribtion = txtdes.Text });
if (FileUpload1.HasFile)
{
FileUpload1.SaveAs(Request.PhysicalApplicationPath +
"ImageProduct/" + FileUpload1.FileName);
Label2.Visible =
true;
}
else
{
Label3.Visible =
true;
}
db.SubmitChanges();
}
}