public static InterestedIns GetDistinctInterests() { InterestedIns iterests = null; // get a configured DbCommand object DbCommand comm = DbAct.CreateCommand(); // set the stored procedure name comm.CommandText = "up_GetDistinctInterests"; // execute the stored procedure DataTable dt = DbAct.ExecuteSelectCommand(comm); // was something returned? if (dt != null && dt.Rows.Count > 0) { iterests = new InterestedIns(); iterests.AddRange(dt.Rows.Cast<DataRow>() .Select(dr => new InterestedIn( FromObj.IntFromObj(dr["interestedInID"]))) .Where(iterest => iterest.InterestedInID != 0)); } return iterests; }
private void InterestIdentityViewBags() { /// var interins = new InterestedIns(); interins.GetAll(); interins.Sort(delegate(InterestedIn p1, InterestedIn p2) { return p1.LocalizedName.CompareTo(p2.LocalizedName); }); ViewBag.InterestedIns = interins.Select(x => new { InterestedInID = x.InterestedInID, LocalizedName = x.LocalizedName }); /// var relationshipStatuses = new RelationshipStatuses(); relationshipStatuses.GetAll(); relationshipStatuses.Sort(delegate(RelationshipStatus p1, RelationshipStatus p2) { return p1.LocalizedName.CompareTo(p2.LocalizedName); }); ViewBag.RelationshipStatuses = relationshipStatuses.Select(x => new { RelationshipStatusID = x.RelationshipStatusID, LocalizedName = x.LocalizedName }); /// var youAres = new YouAres(); youAres.GetAll(); youAres.Sort(delegate(YouAre p1, YouAre p2) { return p1.LocalizedName.CompareTo(p2.LocalizedName); }); ViewBag.YouAres = youAres.Select(x => new { YouAreID = x.YouAreID, LocalizedName = x.LocalizedName }); }
private int ReverseInterestYouAreByName(int? youAreID ) { if (youAreID == null) return 0; YouAre youAre = new YouAre(); youAre.Get(Convert.ToInt32(youAreID)); InterestedIns iins = new InterestedIns(); iins.GetAll(); foreach (InterestedIn inn1 in iins) { if (inn1.Name == youAre.Name) { return inn1.InterestedInID; } } return 0; }
private void InterestIdentityViewBags() { var interins = new InterestedIns(); interins.GetAll(); interins.Sort( (p1, p2) => String.Compare(p1.LocalizedName, p2.LocalizedName, StringComparison.Ordinal)); ViewBag.InterestedIns = interins.Select(x => new {x.InterestedInID, x.LocalizedName}); var relationshipStatuses = new RelationshipStatuses(); relationshipStatuses.GetAll(); relationshipStatuses.Sort( (p1, p2) => String.Compare(p1.LocalizedName, p2.LocalizedName, StringComparison.Ordinal)); ViewBag.RelationshipStatuses = relationshipStatuses.Select(x => new {x.RelationshipStatusID, x.LocalizedName}); var youAres = new YouAres(); youAres.GetAll(); youAres.Sort((p1, p2) => String.Compare(p1.LocalizedName, p2.LocalizedName, StringComparison.Ordinal)); ViewBag.YouAres = youAres.Select(x => new {x.YouAreID, x.LocalizedName}); }
public static InterestedIns GetDistinctInterests() { InterestedIns iterests = null; // get a configured DbCommand object DbCommand comm = DbAct.CreateCommand(); // set the stored procedure name comm.CommandText = "up_GetDistinctInterests"; // execute the stored procedure DataTable dt = DbAct.ExecuteSelectCommand(comm); // was something returned? if (dt != null && dt.Rows.Count > 0) { iterests = new InterestedIns(); InterestedIn iterest = null; foreach (DataRow dr in dt.Rows) { iterest = new InterestedIn(FromObj.IntFromObj(dr["interestedInID"])); if (iterest.InterestedInID == 0) continue; iterests.Add(iterest); } } return iterests; }