Пример #1
0
        protected void grdCountry_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Save")
                {
                    TextBox txtContryName = grdCountry.FooterRow.FindControl("txtCountryName") as TextBox;
                    int afctrows;
                    objData = new MasterData();
                    TextInfo textInfo = cultureInfo.TextInfo;
                    afctrows = objData.Country_Insert(textInfo.ToTitleCase(txtContryName.Text.Trim()));
                    if (afctrows == 101)
                    {
                        lblerrmsg.Text = "Country already exists.";
                        return;
                    }
                    grdfill();
                    divmsg.InnerHtml = "Record inserted successfully.";
                    (this.Master as Site1).ClearModifyStatus();
                }

            }
            catch (Exception ex)
            {
                showerror(ex);
            }
        }