public static void getChurchLongLat(int churchID) { using (SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString)) { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } dbconn.Open(); ChurchTransformer churchTransformer = new ChurchTransformer(); ChurchInfo church = new ChurchInfo(); using (SqlCommand cmd = new SqlCommand("SELECT Longitude, Latitude FROM [Simbahan] where SimbahanID = " + churchID, dbconn)) { var reader = cmd.ExecuteReader(); while (reader.Read()) { HttpContext.Current.Session["Longi"] = Convert.ToDecimal(reader["Longitude"].ToString()); church.Longitude = Convert.ToDouble(HttpContext.Current.Session["Longi"]); HttpContext.Current.Session["Lati"] = Convert.ToDecimal(reader["Latitude"].ToString()); church.Latitude = Convert.ToDouble(HttpContext.Current.Session["Lati"]); } } } }
public Church CreateChurch(ChurchInfo churchInfo) { var church = new Church(); church.Name = churchInfo.City1; church.Line1 = churchInfo.Address; church.City = churchInfo.City1; church.State = churchInfo.State; church.Zip = ParseNumber(churchInfo.Zip1); church.Phone = ParseNumber(churchInfo.Phone); return(church); }
public static int InsertAdorations(int SimbahanID, int IsOpen24By7, string DisplayText, bool HasAircon, bool HasCeilingFan, bool HasOrdinaryFan) { ChurchTransformer churchTransformer = new ChurchTransformer(); ChurchInfo adoration = new ChurchInfo(); using (SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString)) { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } dbconn.Open(); using (SqlCommand cmd = new SqlCommand("spInsertAdorations", dbconn)) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SimbahanID", SimbahanID); cmd.Parameters.AddWithValue("@IsOpen24By7", IsOpen24By7); cmd.Parameters.AddWithValue("@DisplayText", DisplayText); cmd.Parameters.Add("@AdorationAutoID", SqlDbType.BigInt).Direction = ParameterDirection.Output; var reader = cmd.ExecuteReader(); HttpContext.Current.Session["adoID"] = Convert.ToInt32(cmd.Parameters["@AdorationAutoID"].Value.ToString()); adoration.AdorationID = Convert.ToInt32(HttpContext.Current.Session["adoID"]); while (reader.Read()) { adoration = churchTransformer.Transform(reader); } } catch (System.Data.SqlClient.SqlException ex) { string msg = "Insert Error:"; msg += ex.Message; throw new Exception(msg); } } } StartInsertAdorationVentilation(adoration.AdorationID, HasAircon, HasCeilingFan, HasOrdinaryFan); return(adoration.AdorationID); }
public static void AddChurchCommands(UIContextMenu menu, ChurchInfo church, CommandEventHandler handler) { Debug.Assert(World.Default.Settings.Church); string commandText = ControlsRes.Church + (church == null ? "" : string.Format(" ({0})", church.ChurchLevel)); var containerCommand = new UICommand("", commandText) { Image = Properties.Resources.Church }; containerCommand.Commands.AddRange(CreateChurchLevelCommands(handler, church)); if (church != null) { containerCommand.Commands.AddSeparator(); containerCommand.Commands.AddChangeColorCommand("Color", church.Color, ChurchInfo.DefaultColor, (sender, selectedColor) => church.Color = selectedColor); } menu.Commands.Add(containerCommand); }
public void ChurchChange(Village village, int level, bool redrawMaps = true) { if (ChurchChanged != null) { var church = _map.Manipulators.ChurchManipulator.GetChurch(village); if (church == null) { church = new ChurchInfo(village, level); } else { church.ChurchLevel = level; } ChurchChanged(null, new ChurchEventArgs(church)); if (redrawMaps) { World.Default.DrawMaps(false); } } }
public static ChurchInfo CreateChurch(string name, string address, string city, string province, string country, string vicariate, string feastday, string parishPriest, string administeredBy, string diocese, string dateEstablished, string phoneNumber, string email, string website, int activated, int LocationID, int HasAdorationChapel, int IsOpen24By7, string DisplayText, bool HasAircon, bool HasCeilingFan, bool HasOrdinaryFan, string OfficeHours, string DevotionSchedule, string textBapt, string DateCreatedBapt, string textWedd, string DateCreatedWedd, float Long, float Lat) { ChurchTransformer churchTransformer = new ChurchTransformer(); ChurchInfo church = new ChurchInfo(); using (SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString)) { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } dbconn.Open(); using (SqlCommand cmd = new SqlCommand("InsertSimbahanInfo", dbconn)) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ChurchName", name); cmd.Parameters.AddWithValue("@Address", address); cmd.Parameters.AddWithValue("@City", city); cmd.Parameters.AddWithValue("@Province", province); cmd.Parameters.AddWithValue("@Vicariate", vicariate); cmd.Parameters.AddWithValue("@FeastDay", feastday); cmd.Parameters.AddWithValue("@ParishPriest", parishPriest); //cmd.Parameters.AddWithValue("@AdministeredBy", administeredBy); cmd.Parameters.AddWithValue("@Diocese", diocese); cmd.Parameters.AddWithValue("@DateEstablished", dateEstablished); cmd.Parameters.AddWithValue("@PhoneNumber", phoneNumber); cmd.Parameters.AddWithValue("@Email", email); cmd.Parameters.AddWithValue("@Website", website); cmd.Parameters.AddWithValue("@Activated", activated); cmd.Parameters.AddWithValue("@LocationID", LocationID); cmd.Parameters.AddWithValue("@HasAdorationChapel", HasAdorationChapel); cmd.Parameters.AddWithValue("@OfficeHours", OfficeHours); cmd.Parameters.AddWithValue("@DevotionSchedule", DevotionSchedule); cmd.Parameters.AddWithValue("@StreetNo", 0); cmd.Parameters.AddWithValue("@StreetName", ""); cmd.Parameters.AddWithValue("@Barangay", ""); cmd.Parameters.AddWithValue("@DateCreated", DateTime.UtcNow); cmd.Parameters.AddWithValue("@LastUpdate", DateTime.UtcNow); cmd.Parameters.AddWithValue("@churchType", 1); cmd.Parameters.AddWithValue("@Long", Long); cmd.Parameters.AddWithValue("@Lat", Lat); cmd.Parameters.AddWithValue("@churchCode", ""); cmd.Parameters.AddWithValue("@churchHistory", ""); cmd.Parameters.Add("@SimbahanAutoID", SqlDbType.BigInt).Direction = ParameterDirection.Output; var reader = cmd.ExecuteReader(); HttpContext.Current.Session["sid"] = Convert.ToInt32(cmd.Parameters["@SimbahanAutoID"].Value.ToString()); church.SimbahanID = Convert.ToInt32(HttpContext.Current.Session["sid"]); //this.ClearFields(); while (reader.Read()) { church = churchTransformer.Transform(reader); } } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } } } var adorationID = InsertAdorations(church.SimbahanID, IsOpen24By7, DisplayText, HasAircon, HasCeilingFan, HasOrdinaryFan); church.AdorationID = adorationID; InsertBaptismDetails(textBapt, church.SimbahanID, DateCreatedBapt); InsertWeddingDetails(textWedd, church.SimbahanID, DateCreatedWedd); return(church); }
public ChurchEventArgs(ChurchInfo church) { Church = church; }
public ChurchInfo Find(int churchId) { var simbahanInfo = new ChurchInfo { SimbahanID = churchId }; var schedulesList = new List <ChurchScheduleModel>(); using (var dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString)) { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } dbconn.Open(); using (var cmd = new SqlCommand("spGetChurches", dbconn)) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@simbahanID", simbahanInfo.SimbahanID); var reader = cmd.ExecuteReader(); while (reader.Read()) { simbahanInfo = _churchTransformer.Transform(reader); } char[] separator = { ',' }; // Ventilation Processing... reader.NextResult(); while (reader.Read()) { var ventilations = reader["VentType"].ToString().Split(separator, StringSplitOptions.None); foreach (var ventilation in ventilations) { simbahanInfo.Ventilations.Add(new VentilationModel { VentType = ventilation }); } } // Mass Schedules Processing... reader.NextResult(); while (reader.Read()) { var massDetail = _massDetailTransformer.Transform(reader); switch (Convert.ToInt32(reader["ScheduleId"])) { case 1: massDetail.Days = "Sunday"; simbahanInfo.SundayMassSchedule.Add(massDetail); break; case 2: massDetail.Days = "Monday"; simbahanInfo.MondayMassSchedule.Add(massDetail); break; case 3: massDetail.Days = "Tuesday"; simbahanInfo.TuesdayMassSchedule.Add(massDetail); break; case 4: massDetail.Days = "Wednesday"; simbahanInfo.WednesdayMassSchedule.Add(massDetail); break; case 5: massDetail.Days = "Thursday"; simbahanInfo.ThursdayMassSchedule.Add(massDetail); break; case 6: massDetail.Days = "Friday"; simbahanInfo.FridayMassSchedule.Add(massDetail); break; case 7: massDetail.Days = "Saturday"; simbahanInfo.SaturdayMassSchedule.Add(massDetail); break; } } simbahanInfo.ChurchSchedules = schedulesList; //// Church Reviews Processing... reader.NextResult(); while (reader.Read()) { var review = _churchReviewTransformer.Transform(reader); if (review.UserId != 0) { review.User = _userTransformer.Transform(reader); } simbahanInfo.ChurchReviews.Add(review); } // Church Parking Processing... reader.NextResult(); while (reader.Read()) { var parkings = reader["ParkingType"].ToString().Split(separator, StringSplitOptions.None); foreach (var parking in parkings) { simbahanInfo.ChurchParking.Add(new ParkingSlot { ParkingType = parking }); } } // Church Photos Processing... reader.NextResult(); while (reader.Read()) { var photos = reader["ImagePath"].ToString().Split(separator, StringSplitOptions.None); foreach (var strPix in photos) { simbahanInfo.ChurchPhotos.Add(new ChurchPhotosModel { ChurchPhotos = strPix }); } } // Church Announcement Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.Announcements.Add(_announcementTransformer.Transform(reader)); } // Adoration Chapel Schedule Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.AdorationDisplayText = Convert.IsDBNull(reader["DisplayText"].ToString()) ? "" : reader["DisplayText"].ToString(); simbahanInfo.AdorationChapelSchedule.Add(new AdorationChapel { AdorationDay = reader["Days"].ToString(), AdorationTime = reader["Time"].ToString(), Open24Hours = reader["Open24Hours"].ToString() }); } // Church Type Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.ChurchType = reader["ChurchType"].ToString(); } // Location Type Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.LocationType = reader["LocationType"].ToString(); } // Baptism Details Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.BaptismDetails = reader["Text"].ToString(); } // Confession Details Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.ConfessionDetails.Add(new ConfessionSchedule { Confess_Day = reader["ConfessDay"].ToString(), Confess_Time = reader["ConfessTime"].ToString(), Text = reader["ConfessText"].ToString() }); } // Wedding Details Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.WeddingDetails = reader["Text"].ToString(); } // Country Details Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.Country = reader["Country"].ToString(); } // Adoration Ventilation Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.AdorationVentilations.Add(reader["VentType"].ToString()); } // Adoration Photos Processing... reader.NextResult(); while (reader.Read()) { simbahanInfo.AdorationPhotos.Add(@"Images\Photos\" + reader["ImagePath"]); } } catch (Exception) { // ignored } finally { dbconn.Close(); dbconn.Dispose(); } } } return(simbahanInfo); }
public VillageTooltip(Village village) { _village = village; _church = World.Default.Map.Manipulators.ChurchManipulator.GetChurch(_village); }
private void ImportChurchInfo(OleDbConnection cn) { var sql = @"SELECT [Church Info].* FROM [Church Info];"; var churchInfoList = new List <ChurchInfo>(); using (var cmd = new OleDbCommand(sql, cn)) { using (var reader = cmd.ExecuteReader()) { if (!reader.HasRows) { throw new Exception("Church Info table empty"); } while (reader.Read()) { var churchInfo = new ChurchInfo(); churchInfo.PastorName = reader.ValueOrDefault <string>("Pastor", ""); churchInfo.Address = reader.ValueOrDefault <string>("Address", ""); churchInfo.City1 = reader.ValueOrDefault <string>("City1", ""); churchInfo.State = reader.ValueOrDefault <string>("State", ""); churchInfo.Zip1 = reader.ValueOrDefault <string>("Zip1", ""); churchInfo.Phone = reader.ValueOrDefault <string>("Phone", ""); churchInfoList.Add(churchInfo); } } } var ci = churchInfoList.FirstOrDefault(); var church = factory.CreateChurch(ci); var result = this.churchRepo.Add(church); if (result.Status == RepositoryActionStatus.Error) { LogError(result.Exception, Core.Framework.LogLevel.Error); return; } this.church = result.Entity; // add member var member = new NewMember(); member.ChurchId = this.church.id; member.FirstName = ci.PastorName; member.City = ci.City1; member.Line1 = ci.Address; member.State = ci.State; member.Zip = ci.Zip1; if (string.IsNullOrWhiteSpace(member.FirstName)) { var msg = $"First Name is null from [Church Info] table. " + $"ChurchId: { this.church.id }. " + $"City1: { ci.City1 }. "; var x = new Exception(msg); LogError(x, Core.Framework.LogLevel.Warning); return; } var memberResult = this.memberRepo.Add(member); if (memberResult.Status == RepositoryActionStatus.Error) { LogError(memberResult.Exception, Core.Framework.LogLevel.Error); return; } member.id = memberResult.Entity.id; // create team var team = new Core.Models.Team.Team(); team.Id = 0; team.Name = church.Name + " Pastoral Team"; team.Desc = "Pastoral Team for " + church.Name; team.ChurchId = church.id; team.TeamTypeEnumId = 68; team.TeamPositionEnumTypeId = 17; team.Comment = ""; var teamResult = this.teamRepo.SaveTeam(team); if (teamResult.Status == RepositoryActionStatus.Error) { LogError(teamResult.Exception, Core.Framework.LogLevel.Warning); return; } this.pastoralTeam = teamResult.Entity; // create teammate this.SaveTeammate(member.id, this.pastoralTeam.Id, 70); // Pastor }
protected void Page_Load(object sender, EventArgs e) { btnAddToFav.Src = "http://" + HttpContext.Current.Request.Url.Host + "/Images/star.png"; var churchId = 0; Sample(); if (Request["id"] == null && Page.RouteData.Values["church-id"] == null && Page.RouteData.Values["church-id"] == null) { return; } if (Request["id"] != null) { churchId = Convert.ToInt32(Request["id"]); } else if (Page.RouteData.Values["church-id"] != null) { churchId = Convert.ToInt32(Page.RouteData.Values["church-id"]); } var service = new ChurchService(); var favoriteService = new FavoritesService(); var timeStandard = new TimeStandard(); churches = service.Find(churchId); Master.MetaTitle = $"{churches.MetaTitle}"; Master.MetaDescription = $"{churches.MetaDescription}"; maskData.Value = churches.MaskData; simbahanID.Value = churchId.ToString(); churchName.InnerHtml = churches.Parish; churchAddress.InnerHtml = churches.CompleteAddress; churchLastUpdate.InnerHtml = churches.LastUpdate.ToString("MMM d, yyyy"); churchHistory.InnerHtml = HttpUtility.HtmlDecode(churches.ChurchHistory) == "" ? "<h3>No Data Available.</h3>" : "<strong>" + churches.Parish + "</strong> " + HttpUtility.HtmlDecode(churches.ChurchHistory); churchType.InnerHtml = ChurchType.parseInt(churches.ChurchTypeID); churchEstablished.InnerHtml = churches.DateEstablished; churchFeastDay.InnerHtml = churches.FeastDay; churchPriest.InnerHtml = churches.Priest; churchVicariate.InnerHtml = churches.Vicariate; churchDiocese.InnerHtml = churches.Diocese; churchContact.InnerHtml = churches.ContactNo; churchWeb.HRef = "http://www." + churches.Website; churchWebsite.InnerHtml = churches.Website; adorationSchedule.InnerHtml = churches.AdorationDisplayText; churchMapAddress.InnerHtml = churches.CompleteAddress; churchMapDestination.Value = churches.CompleteAddress; baptismSchedule.InnerHtml = churches.BaptismDetails; weddingSchedule.InnerHtml = churches.WeddingDetails; officeHours.InnerHtml = churches.OfficeHours; devotionSchedule.InnerHtml = churches.DevotionSchedule; latitude.Value = churches.Latitude.ToString(); longitude.Value = churches.Longitude.ToString(); editChurchHistory.InnerHtml = churches.ChurchHistory; if (Auth.Check()) { if (favoriteService.IsChurchAlreadyInFavorites(Auth.user().Id, churches.SimbahanID)) { AddFav.Attributes.Add("style", "display: none;"); RemoveFav.Attributes.Add("style", "display: block;"); } else { AddFav.Attributes.Add("style", "display: block;"); RemoveFav.Attributes.Add("style", "display: none;"); } } else { RemoveFav.Attributes.Add("style", "display: none"); } List <MassDetailsModel> schedules; switch (DateTime.UtcNow.DayOfWeek) { case DayOfWeek.Sunday: schedules = churches.SundayMassSchedule; break; case DayOfWeek.Monday: schedules = churches.MondayMassSchedule; break; case DayOfWeek.Tuesday: schedules = churches.TuesdayMassSchedule; break; case DayOfWeek.Wednesday: schedules = churches.WednesdayMassSchedule; break; case DayOfWeek.Thursday: schedules = churches.ThursdayMassSchedule; break; case DayOfWeek.Friday: schedules = churches.FridayMassSchedule; break; case DayOfWeek.Saturday: schedules = churches.SaturdayMassSchedule; break; default: schedules = new List <MassDetailsModel>(); break; } var languages = new List <string>(); var massSchedules = new List <string>(); foreach (var mass in schedules) { if (mass.Language != "" && !languages.Contains(mass.Language)) { languages.Add(mass.Language); } massSchedules.Add(mass.Time); } var massDate = "No Mass Schedule for " + DateTime.UtcNow.DayOfWeek; churchMassLanguages.Attributes.Add("style", "display: none;"); if (massSchedules.Count > 0) { massDate = DateTime.UtcNow.DayOfWeek + " - " + string.Join(", ", massSchedules); churchMassLanguages.Attributes.Add("style", "display: block;"); } churchMassDates.InnerHtml = massDate; churchMassLanguages.InnerHtml = string.Join(", ", languages); adorationChapelSchedule.InnerHtml = churches.AdorationDisplayText; confessionSchedule.InnerHtml = churches.ConfessionDetails.Count > 0 ? churches.ConfessionDetails[0].Text : ""; if (!string.IsNullOrEmpty(churches.LocationType)) { var locationLabel = new CheckLabel(churches.LocationType); churchLocation.InnerHtml = locationLabel.ToHtml(); } foreach (var ventilation in churches.Ventilations) { var ventilationLabel = new CheckLabel(ventilation.VentType); churchVentilations.InnerHtml += ventilationLabel.ToHtml(); } foreach (var ventilation in churches.AdorationVentilations) { var ventilationLabel = new CheckLabel(ventilation); adorationVentilations.InnerHtml += ventilationLabel.ToHtml(); } foreach (var parking in churches.ChurchParking) { var parkingLabel = new CheckLabel(parking.ParkingType); churchParking.InnerHtml += parkingLabel.ToHtml(); } for (var i = 5; i <= 22; i++) { var row = new HtmlTableRow(); var dayTime = new HtmlTableCell(); var sundayMass = new HtmlTableCell(); var mondayMass = new HtmlTableCell(); var tuesdayMass = new HtmlTableCell(); var wednesdayMass = new HtmlTableCell(); var thursdayMass = new HtmlTableCell(); var fridayMass = new HtmlTableCell(); var saturdayMass = new HtmlTableCell(); var sundayTime = churches.SundayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var mondayTime = churches.MondayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var tuesdayTime = churches.TuesdayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var wednesdayTime = churches.WednesdayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var thursdayTime = churches.ThursdayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var fridayTime = churches.FridayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); var saturdayTime = churches.SaturdayMassSchedule.FirstOrDefault(schedule => schedule.TimeStandardId == i); dayTime.InnerHtml = timeStandard.Time[i - 1]; sundayMass.InnerHtml = sundayTime != null ? sundayTime.Time + "<br/>" + sundayTime.Language : ""; mondayMass.InnerHtml = mondayTime != null ? mondayTime.Time + "<br/>" + mondayTime.Language : ""; tuesdayMass.InnerHtml = tuesdayTime != null ? tuesdayTime.Time + "<br/>" + tuesdayTime.Language : ""; wednesdayMass.InnerHtml = wednesdayTime != null ? wednesdayTime.Time + "<br/>" + wednesdayTime.Language : ""; thursdayMass.InnerHtml = thursdayTime != null ? thursdayTime.Time + "<br/>" + thursdayTime.Language : ""; fridayMass.InnerHtml = fridayTime != null ? fridayTime.Time + "<br/>" + fridayTime.Language : ""; saturdayMass.InnerHtml = saturdayTime != null ? saturdayTime.Time + "<br/>" + saturdayTime.Language : ""; row.Cells.Add(dayTime); row.Cells.Add(sundayMass); row.Cells.Add(mondayMass); row.Cells.Add(tuesdayMass); row.Cells.Add(wednesdayMass); row.Cells.Add(thursdayMass); row.Cells.Add(fridayMass); row.Cells.Add(saturdayMass); row.Attributes.Add("class", "text-center"); massScheduleTable.Rows.Add(row); } if (churches.Announcements.Count > 0) { foreach (var announcement in churches.Announcements) { var announcementControl = new Components.Announcement(announcement); churchAnnouncementContainer.InnerHtml += announcementControl.ToHtml(); } } else { churchAnnouncementContainer.InnerHtml += "<h4>No Announcement Found.</h4>"; } foreach (var review in churches.ChurchReviews) { var reviewItem = new Components.ChurchReview(review); churchReviewsContainer.InnerHtml += reviewItem.ToHtml(); } //var path = HttpContext.Current.Request.Url.AbsolutePath; //string[] QueryArray = path.Split('/'); //var newPath = QueryArray[1]; //var root = QueryArray[0]; //if (newPath == "Churches") //{ // ResolveUrl("Churches.aspx"); // var carousel = new Carousel(); // if (churches.ChurchPhotos.Count > 0) // { // //carousel.FirstImage = churches.ChurchPhotos[0].ChurchPhotos; // for (var i = 0; i < churches.ChurchPhotos.Count; i++) // carousel.AddImage(i, churches.ChurchPhotos[i].ChurchPhotos); // cssSlider.InnerHtml = carousel.ToHtml(); // } // else // { // cssSlider.InnerHtml = "<h3 class=\"text-center\">No Photos Available.</h3>"; // } //} else //{ var carousel = new Carousel(); if (churches.ChurchPhotos.Count > 0) { //carousel.FirstImage = churches.ChurchPhotos[0].ChurchPhotos; for (var i = 0; i < churches.ChurchPhotos.Count; i++) { carousel.AddImage(i, churches.ChurchPhotos[i].ChurchPhotos); } cssSlider.InnerHtml = carousel.ToHtml(); } else { cssSlider.InnerHtml = "<h3 class=\"text-center\">No Photos Available.</h3>"; } //} if (churches.AdorationPhotos.Count > 0) { for (var i = 0; i < churches.AdorationPhotos.Count; i++) { var imagePath = ResolveUrl(churches.AdorationPhotos[i]); var newLi = new HtmlGenericControl("li") { InnerHtml = "<img src=\"" + imagePath + "\" alt=\"\" title=\"\" id=\"wows1_" + i + "\" />" }; adorationImageList.Controls.Add(newLi); var newA = new HtmlGenericControl("a"); newA.Attributes.Add("href", "#"); newA.InnerHtml = "<a href=\"#\" title=\"\"><span><img src=\"" + imagePath + "\" alt=\"\" />" + (i + 1) + "</span></a>"; adorationLinkList.Controls.Add(newA); } } else { adorationImageContainer.InnerHtml = "<h3>No Photos Available</h3>"; } Master.GoogleMetaDescription = massDate; Page.Title = churches.Parish; }
private static UICommand[] CreateChurchLevelCommands(CommandEventHandler handler, ChurchInfo church) { var churchLevelCommands = new List <UICommand>(); for (int i = 0; i <= 3; i++) { churchLevelCommands.Add(CreateChurchLevelCommand(handler, i, church == null ? -1 : church.ChurchLevel)); } return(churchLevelCommands.ToArray()); }
public static void InsertOrganization(string name, string address, string streetNo, string streetName, string barangay, string city, string province, string country, string dateEstablished, string parentorg, string feastBuilder, string branch, string contact, string email, string website, string retreat, string recollect, string talks, string camp, string volunteer, float latitude, float longitude, string about) { ChurchTransformer churchTransformer = new ChurchTransformer(); ChurchInfo org = new ChurchInfo(); using (SqlConnection dbconn = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString)) { if (dbconn.State == ConnectionState.Open) { dbconn.Close(); } dbconn.Open(); using (SqlCommand cmd = new SqlCommand("[spInsertCatholicOrganization]", dbconn)) { try { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@OrgName", name); cmd.Parameters.AddWithValue("@LastUpdate", DateTime.UtcNow); cmd.Parameters.AddWithValue("@CompleteAddress", address); cmd.Parameters.AddWithValue("@StreetNo", streetNo); cmd.Parameters.AddWithValue("@StreetName", streetName); cmd.Parameters.AddWithValue("@Barangay", barangay); cmd.Parameters.AddWithValue("@CityOrMunicipality", city); cmd.Parameters.AddWithValue("@StateOrProvince", province); cmd.Parameters.AddWithValue("@Country", country); cmd.Parameters.AddWithValue("@DateEstablished", dateEstablished); cmd.Parameters.AddWithValue("@ParentOrganization", parentorg); cmd.Parameters.AddWithValue("@FeastBuilderOrPreacher", feastBuilder); cmd.Parameters.AddWithValue("@BranchOrLocation", branch); cmd.Parameters.AddWithValue("@ContactNo", contact); cmd.Parameters.AddWithValue("@EmailAddress", email); cmd.Parameters.AddWithValue("@Website", website); cmd.Parameters.AddWithValue("@RetreatSchedule", retreat); cmd.Parameters.AddWithValue("@RecollectSchedule", recollect); cmd.Parameters.AddWithValue("@TalkSchedule", talks); cmd.Parameters.AddWithValue("@CampSchedule", camp); cmd.Parameters.AddWithValue("@VolunteerSchedule", volunteer); cmd.Parameters.AddWithValue("@Latitude", latitude); cmd.Parameters.AddWithValue("@Longitude", longitude); cmd.Parameters.AddWithValue("@About", about); cmd.Parameters.Add("@CatholicOrgAutoId", SqlDbType.BigInt).Direction = ParameterDirection.Output; var reader = cmd.ExecuteReader(); HttpContext.Current.Session["orgID"] = Convert.ToInt32(cmd.Parameters["@CatholicOrgAutoId"].Value.ToString()); org.SimbahanID = Convert.ToInt32(HttpContext.Current.Session["orgID"]); while (reader.Read()) { org = churchTransformer.Transform(reader); } } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } } } }