Exemplo n.º 1
0
        public static void AddState(StateCityInfo info)
        {
            try
            {
                clsParameterCollection ParameterCollection = new clsParameterCollection();
                ParameterCollection.ProcedureName = "BS_AddState";
                ParameterCollection.Add(new clsParameter("@StateName", info.StateName));
                ParameterCollection.Add(new clsParameter("@StateId", info.StateId));

                DataAccess.ExecuteNonQuerySp(ParameterCollection);
            }
            catch (Exception Ex)
            {
                if (!Ex.Message.Contains("User Define:"))
                    BL_Exception.WriteLog(Ex);

                throw Ex;
            }
        }
Exemplo n.º 2
0
        protected void btnSaveCity_Click(object sender, EventArgs e)
        {
            try
            {
                StateCityInfo info = new StateCityInfo();
                info.CityId = Convert.ToInt32(hdnCityId.Value);
                info.CityName = txtCityName.Text.Trim();
                info.ZipCode = Convert.ToString(txtZipCode.Text.Trim());
                info.StateId = Convert.ToInt32(ddlStateName.SelectedValue);

                BL_StateCity.AddCityState(info);
                hdnCityId.Value = "0";
                fnPopulateCounty();
                fnReset();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("User Define:"))
                {
                    AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(this, GetType(), "Show Error", "alert('" + ex.Message.Replace("User Define:", "").Replace("\n", "").Replace("\r", "") + "')", true);
                }
            }
        }