コード例 #1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         city.CityId      = int.Parse(Request["CityId"].ToString());
         city.Name        = txtName.Text.Trim();
         city.Description = txtDesc.Text.Trim();
         city.UpdateCity();
         lblMsg.Text = "City Updated...!";
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Citytbl ct = new Citytbl();

            ct.CityID      = Convert.ToInt32(hdnCityID.Value);
            ct.CityName    = txtCity.Text;
            ct.StateID     = Convert.ToInt32(ddlState.SelectedValue);
            ct.IsActive    = 1;
            ct.UpdatedBy   = 1;
            ct.UpdatedDate = DateTime.Now.ToString();
            List <Citytbl> lst = new List <Citytbl>();

            lst = objCityBl.UpdateCity(ct).ToList();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('City Updated Successfully');", true);
            Reset();
            GetCity();
            btnUpdate.Visible = false;
            btnSave.Visible   = true;
        }