protected void Update_Click(object sender, EventArgs e) { if (Page.IsValid) { ApartmentInfo obj = new ApartmentInfo(); //obj.Id = Id; //obj.Name = txtName.Text; //obj.Logo = txtLogo.Text; //obj.Ord = txtOrd.Text; //obj.Lang = Lang; if (Insert == true) { ApartmentService.ApartmentInfo_Insert(obj); } else { ApartmentService.ApartmentInfo_Update(obj); } BindGrid(); pnView.Visible = true; pnUpdate.Visible = false; Insert = false; } }