protected void gvAudios_RowDeleting(object sender, GridViewDeleteEventArgs e) { int productAudioId = (int)gvAudios.DataKeys[e.RowIndex]["AudioId"]; AudioBiz audioBiz = new AudioBiz(); lwg_Audio audio = audioBiz.GetAudioById(productAudioId); if (audio != null) { audioBiz.DeleteCatalogAudio(productAudioId); LWGUtils.ClearOldFile(string.Format("{0}{1}", LWGUtils.GetSoundPath(), audio.SoundFile)); BindData(); } }
protected void gvAudios_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UpdateProductAudio") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = gvAudios.Rows[index]; NumericTextBox txtProductVideoDisplayOrder = row.FindControl("txtProductAudioDisplayOrder") as NumericTextBox; HiddenField hfProductAudioId = row.FindControl("hdAudioId") as HiddenField; int displayOrder = txtProductVideoDisplayOrder.Value; int productAudioId = int.Parse(hfProductAudioId.Value); AudioBiz audioBiz = new AudioBiz(); lwg_Audio audio = audioBiz.GetAudioById(productAudioId); if (audio != null) { audio.DisplayOrder = displayOrder; audioBiz.UpdateCatalogAudio(audio); } BindData(); } }