public int AddMobileNo(MobileNo mobileNo) { var connection = new SqlConnection(connectionString); var query = "SP_AddWork"; var command = new SqlCommand(query, connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.Clear(); command.Parameters.Add("@MobileNo", SqlDbType.VarChar); command.Parameters["@MobileNo"].Value = mobileNo.MobileNumber; command.Parameters.Add("@UserId", SqlDbType.Int); command.Parameters["@UserId"].Value = mobileNo.UserId; connection.Open(); int mobileNoId = Convert.ToInt32(command.ExecuteScalar()); connection.Close(); return(mobileNoId); }
public void TrimData() { if (Name == null) { Name = ""; } if (EmailId == null) { EmailId = ""; } if (MobileNo == null) { MobileNo = ""; } Name = Name.Trim(); EmailId = EmailId.Trim(); MobileNo = MobileNo.Trim(); }
public int AddMobileNo(MobileNo mobileNo) { return(_basicInfoGateway.AddMobileNo(mobileNo)); }
public int UpdateMobileNo(MobileNo mobileNo) { return(_basicInfoGateway.UpdateMobileNo(mobileNo)); }
/// <summary> /// Convert current membership to it's HTML equivalent with appropriate layout /// </summary> public HtmlDiv ToHtmlComponent() { HtmlDiv br = new HtmlDiv("<br/>"); HtmlDiv div = new HtmlDiv(); HtmlDiv name = new HtmlDiv(LastName.ToUpperInvariant() + " " + FirstName.ToTitleCase()); string sanitizedSpouseName = SanitizeName(SpouseName); if (!string.IsNullOrWhiteSpace(sanitizedSpouseName)) { name.InnerHtml += " & " + sanitizedSpouseName; } name.CssClasses.Add("strong"); string membershipType = ""; string secondaryIconClass = ""; if (!string.IsNullOrWhiteSpace(ProgramName)) { if (ProgramName.ContainsIgnoreCase("individual")) { membershipType = EFontAwesomeIcon.User.GetStringValue(); secondaryIconClass = "icon-old-couple-2"; } else if (ProgramName.ContainsIgnoreCase("family")) { membershipType = EFontAwesomeIcon.Users.GetStringValue(); } else if (ProgramName.ContainsIgnoreCase("student")) { membershipType = EFontAwesomeIcon.University.GetStringValue(); } } HtmlComponent primaryIcon = new HtmlComponent(EHtmlTag.I); primaryIcon.CssClasses.Add("pull-right fa " + membershipType); div.AppendTags.Add(primaryIcon); if (!string.IsNullOrEmpty(secondaryIconClass)) { HtmlComponent separator = new HtmlComponent(EHtmlTag.I); separator.CssClasses.Add("pull-right fa fa-ellipsis-v"); div.AppendTags.Add(separator); HtmlComponent secondaryIcon = new HtmlComponent(EHtmlTag.I); secondaryIcon.CssClasses.Add("pull-right icon " + secondaryIconClass); div.AppendTags.Add(secondaryIcon); } div.AppendTags.Add(name); if (Children.Any()) { string childrenNames = string.Join(", ", Children.Select(c => string.Join(", ", SanitizeName(c).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)))); HtmlDiv children = new HtmlDiv(childrenNames); children.CssClasses.Add("strong"); div.AppendTags.Add(children); if (string.IsNullOrEmpty(childrenNames)) { div.AppendTags.Add(br); } } else { div.AppendTags.Add(br); } div.AppendTags.Add(br); HtmlDiv address = new HtmlDiv(Address + "<br>" + Suburb + ". <br>" + State.ToUpperInvariant() + " - " + PostCode); div.AppendTags.Add(address); div.AppendTags.Add(br); if (TelNo == MobileNo || TelNo == SpouseMobileNo) { TelNo = string.Empty; } if (!MobileNo.StartsWith("+61") && !MobileNo.StartsWith("0")) { MobileNo = "0" + MobileNo; } string numbers = "Tel: " + TelNo + "<br>" + "Mobile: " + MobileNo; if (!string.IsNullOrEmpty(SpouseMobileNo)) { if (!SpouseMobileNo.StartsWith("+61") && !SpouseMobileNo.StartsWith("0")) { SpouseMobileNo = "0" + SpouseMobileNo; } if (MobileNo != SpouseMobileNo) { numbers += ", " + SpouseMobileNo; } } HtmlDiv phone = new HtmlDiv(numbers); div.AppendTags.Add(phone); return(div); }