protected void grvTimeZone_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { this.ucMessanger1.UnmarkControls(); bizTimeZone biz = new bizTimeZone(); if (biz.DeleteTimeZone(this.grvTimeZone.DataKeys[e.RowIndex].Value.ToString()) == true) { this.ucMessanger1.ProcessMessage("Time Zone has been succesfully deleted.", Utilities.enMsgType.OK, "", null, true); } else { this.ucMessanger1.ProcessMessages(biz.MSGS, true); } e.Cancel = true; this.grvTimeZone.EditIndex = -1; this.grvTimeZone.DataBind(); } catch (Exception ex) { bizLog.InsertExceptionLog(ex.Message, ex.StackTrace); Response.Redirect("~/ErrorPage.aspx", false); } }
protected void btnAddTZ_Click(object sender, EventArgs e) { try { this.ucMessanger1.UnmarkControls(); if (this.txtAddTimeZone.Text == "") { this.ucMessanger1.ProcessMessage("You have to enter Time Zone.", Utilities.enMsgType.Err, "AddTimeZone", typeof(TextBox), true); return; } bizTimeZone biz = new bizTimeZone(); if (biz.InsertTimeZone(this.txtAddTimeZone.Text) == true) { this.txtAddTimeZone.Text = ""; this.ucMessanger1.ProcessMessage("Time Zone has been succesfully inserted.", Utilities.enMsgType.OK, "", null, true); this.grvTimeZone.DataBind(); } else { this.ucMessanger1.ProcessMessage("An error has happened, please see the log.", Utilities.enMsgType.Err, "", null, true); } } catch (Exception ex) { bizLog.InsertExceptionLog(ex.Message, ex.StackTrace); Response.Redirect("~/ErrorPage.aspx", false); } }