private void Save() { try { string id; Sanoy.AddisTower.BE.PhotoGallery photoGallary = new Sanoy.AddisTower.BE.PhotoGallery(); photoGallary.Title = txtTitle.Text; photoGallary.NormalPicture = txtPicName.Text; photoGallary.Thumbnails = txtThumbnails.Text; photoGallary.Catagory = int.Parse(ddlCatagory.SelectedValue); if (ddListOperation.SelectedValue == "-- Create New --") { photoGallary.Id = Sanoy.AddisTower.DA.Utility.GetId("PhotoGallery", "Id"); photoGallary.State = Sanoy.AddisTower.BE.RowState.Added; photoGallary.Publish = "D"; } else { photoGallary.Publish = Status; photoGallary.Id = Id; photoGallary.State = Sanoy.AddisTower.BE.RowState.Modified; } if (PhotoGallery.Save(photoGallary)) { lblMessage.Text = "The content was succesfully saved."; } else { lblMessage.Text = "There was problem saving the content."; } Populate(); clear(); } catch { } }