protected void Btncreatecal_OnClick(object sender, EventArgs e) { try { if (ddlyear.SelectedValue == "0") { return; } int count = OnlineOrderBackOfficeBo.YearCheck(Convert.ToInt32(ddlyear.SelectedValue)); if (count > 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Calendar Already Exist !!');", true); } else { int selYear = int.Parse(ddlyear.SelectedValue); OnlineOrderBackOfficeBo.CreateCalendar(selYear); createcalanders.Visible = false; ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyScript", "alert('Calendar Created!!');", true); //gvTradeBusinessDate.MasterTableView.Rebind(); //gvTradeBusinessDate.Rebind(); } //GetTradeBusinessDates(); } catch (BaseApplicationException Ex) { throw Ex; } catch (Exception Ex) { BaseApplicationException exBase = new BaseApplicationException(Ex.Message, Ex); NameValueCollection FunctionInfo = new NameValueCollection(); FunctionInfo.Add("Method", "TradeBusinessDate.ascx.cs:ddlType_OnSelectedIndexChanged()"); object[] objects = new object[2]; objects[0] = sender; objects[1] = e; FunctionInfo = exBase.AddObject(FunctionInfo, objects); ExceptionManager.Publish(exBase); throw exBase; } }