protected void uiDataListPhotos_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "Delete") { PartySupplierImages image = new PartySupplierImages(); image.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); image.MarkAsDeleted(); image.Save(); BindImages(); ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-2\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-2\"]').addClass('active'); });", true); } }
protected void uiButtonSaveText_Click(object sender, EventArgs e) { if (uiFileUploadProdImage.HasFile) { PartySupplierImages image = new PartySupplierImages(); image.AddNew(); image.CardID = CurrentCard.CardID; string path = "/images/ProductImages/" + uiFileUploadProdImage.FileName; uiFileUploadProdImage.SaveAs(Server.MapPath("~" + path)); image.ImagePath = path; image.Save(); BindImages(); } ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-2\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-2\"]').addClass('active'); });", true); }