public RSVP SaveForm() { rsvpIdString = Request.QueryString["rsvpId"]; if (rsvpIdString != null) { rsvpIdGuid = IptechLib.Validation.GetValueGuid(rsvpIdString, true); } try { rsvp = RSVP.GetRSVP(rsvpIdGuid); } catch { } if (rsvp != null) { rsvp.IsGalaDinner = rblstGalaDinner.SelectedValue.Equals("Yes"); rsvp.Dietary = txtDietery.Text.Trim(); rsvp.WorkflowStatus = "04"; rsvp.Respond = true; rsvp.DateModifiedString = DateTime.Now.ToString(); rsvp.Save(); } return(rsvp); }
public void ReadExcelData(XLWorkbook workBook) { if (workBook.Worksheets.Count > 0) { int sheetNo = 1; foreach (IXLWorksheet sh in workBook.Worksheets) { var dataRange = sh.RangeUsed(); int skiprows = 1; if (dataRange != null) { foreach (var row in dataRange.Rows()) { if (skiprows >= 2 && sheetNo == 1) { if (row.Cell(1).GetString().Trim() != "" && ValidateRow(row)) { RSVP rsvp = RSVP.NewRSVP(); rsvp.Type = RemoveControlChars(row.Cell(1).GetString()); //rsvp.Salutation = RemoveControlChars(row.Cell(3).GetString()); rsvp.FirstName = RemoveControlChars(row.Cell(2).GetString()); rsvp.LastName = RemoveControlChars(row.Cell(3).GetString()); rsvp.UserData1 = RemoveControlChars(row.Cell(4).GetString()); rsvp.Company = RemoveControlChars(row.Cell(5).GetString()); //rsvp.UserData3 = RemoveControlChars(row.Cell(6).GetString()); rsvp.Salutation = RemoveControlChars(row.Cell(6).GetString()); rsvp.Email = RemoveControlChars(row.Cell(7).GetString()); //rsvp.Round1PanelID = RemoveControlChars(row.Cell(14).GetString()); //rsvp.Round2PanelID = RemoveControlChars(row.Cell(15).GetString()); rsvp.IsInvitingGalaDinner = true; rsvp.WorkflowStatus = "01"; rsvp.DateCreatedString = DateTime.Now.ToString(); if (rsvp.IsValid) { rsvp = rsvp.Save(); } } //else // return; } skiprows++; } } sheetNo++; } } else { lbError.Text += "The Sheet has invalid/not enough data.<br/>Please check your file"; } }
private void Page_Load(object sender, System.EventArgs e) { // check if-modified-since header to determine if we // should log again or send back a not modified result if (useCached(this.Context.Request)) { Response.StatusCode = 304; Response.SuppressContent = true; } else { // add code to log visit here // such as write to a database Response.ContentType = "image/gif"; Response.AppendHeader("Content-Length", _imgbytes.Length.ToString()); Response.Cache.SetLastModified(DateTime.Now); Response.Cache.SetCacheability(HttpCacheability.Public); Response.BinaryWrite(_imgbytes); string rsvpIdString = Request.QueryString["rsvpId"]; if (rsvpIdString != null) { RSVP rsvp = RSVP.GetRSVP(IptechLib.Validation.GetValueGuid(rsvpIdString, true)); if (rsvp != null) { rsvp.WorkflowStatus = "03"; if (rsvp.IsValid) { rsvp.Save(); } } } } }