protected void btn_Save_Click(object sender, EventArgs e) { try { if (Validate()) { INSERT = "I"; int ActiveSt = Convert.ToInt16(rbnSy.SelectedValue); DataTable dt = new DataTable(); if (txt_Date.Text.Trim() != "") { if (!objValidate.IsDate(txt_Date.Text.Trim())) { objCommon.ShowAlertMessage("Enter Valid Date"); txt_Date.Focus(); return; } } DateTime date = DateTime.Parse(txt_Date.Text.Trim(), provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault).Date; dt = objDist.InsertMandalBAL(ddl_dist_code.SelectedValue.ToString(), txtMandalCode.Text, txtMandalName.Text.Trim(), date, ActiveSt, Session["UsrName"].ToString(), INSERT, ConnKey); if (dt.Rows.Count > 0) { objCommon.ShowAlertMessage(dt.Rows[0][0].ToString()); txt_Date.Text = ""; txtMandalName.Text = ""; txtMandalCode.Text = ""; } Viewdata(); } } catch (Exception ex) { ExceptionLogging.SendExcepToDB(ex, Session["UsrName"].ToString(), Request.ServerVariables["REMOTE_ADDR"].ToString()); Response.Redirect("~/Error.aspx"); } finally { } }