protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         state.StateId     = int.Parse(Request["StateId"].ToString());
         state.Name        = txtName.Text.Trim();
         state.Description = txtDesc.Text.Trim();
         state.UpdateState();
         lblMsg.Text = "State Updated...!";
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Statetbl st = new Statetbl();

            st.StateID     = Convert.ToInt32(hdnStateID.Value);
            st.StateName   = txtState.Text;
            st.CountryID   = Convert.ToInt32(DDlCountry.SelectedValue);
            st.IsActive    = 1;
            st.UpdatedBy   = 1;
            st.UpdatedDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            List <Statetbl> lst = new List <Statetbl>();

            lst = objStateBL.UpdateState(st).ToList();
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alertMessage('State Updated Successfully');", true);
            Reset();

            btnUpdate.Visible = false;
            btnSave.Visible   = true;
            GetState();
        }