protected void InsertButton_Click(object sender, EventArgs e) { try { IHC.IsirAssemblyAssignment assignment = new IHC.IsirAssemblyAssignment(); assignment.IsirAssyNo = this.lblAssy.Text; assignment.IsirEmpId = this.DropDownList4.SelectedValue; assignment.IsirIsIsir = bool.Parse(this.RadioButtonList1.SelectedValue); assignment.IsirLocNo = this.DropDownList5.SelectedValue; assignment.IsirMoNo = this.lblMo.Text; assignment.IsirMoQty = decimal.Parse(this.lblQty.Text); assignment.IsirDteAssn = new DateTime?(DateTime.Now); assignment.Save(); if (assignment.IsirIsIsir) { Email.SendAssyAssignMail(assignment.IsirMoNo, assignment.IsirEmpId, assignment.IsirLocNo); } string s = "Assembly Assignment has been saved. Number " + assignment.IsirNo.ToString(); base.Response.Redirect("../Default.aspx?message=" + base.Server.HtmlEncode(s)); } catch (Exception exception) { this.ErrorHandler1.TypeOfMessage = MessageTypes.MessageType.Error; this.ErrorHandler1.ErrorMessage = exception.Message; } }