Note

ProducerEligibilityController.cs inside WebApi

namespace CSSI.VUE.Web.API.Controllers
{
public class ProducerEligibiltyController : ApiController
{

 

[CSSIScope(“GET_PRODUCER_ELIGIBILITY”)]
[HttpGet]
public ResponseMessageResult Get(
string ApplicationSignedDate,
string CarrierCode,
string LOB,
string SitusState,
string RequestType,
string AgentCode = null,
string WritingNumber = null,
string SolicitationState = null)
{
AgentDemographicResponse obj = null;
AgentDemographicRequest req = new AgentDemographicRequest();
MetLifeEncryptDecryptAES encryption = new MetLifeEncryptDecryptAES();

req.RequestType = RequestType;
req.AgentCode = AgentCode;
req.ApplicationSignedDate = DateTime.ParseExact(ApplicationSignedDate, “yyyy-MM-dd”, CultureInfo.InvariantCulture);
req.CarrierCode = CarrierCode;
req.LOB = LOB;
req.SitusState = SitusState;
req.SolicitationState = SolicitationState;
req.WritingNumber = WritingNumber;

ICommonExtService service = ProxyHelper.GetCommonServiceProxy();
if (service != null)
{
obj = service.ProducerEligibility(req);
if (obj.ErrorMessage == “” || string.IsNullOrEmpty(obj.ErrorMessage))
{
if (obj.IsAgency == “1”)
{
if (!string.IsNullOrEmpty(obj.TaxID))
{
obj.TaxID = encryption.Encrypt(WebHelper.Encryption(obj.TaxID, false));
}
}
else
{
if (!string.IsNullOrEmpty(obj.SSN))
{
obj.SSN = encryption.Encrypt(WebHelper.Encryption(obj.SSN, false));
}
}
}
}

//XElement xeAgentDemographicResponse = EntityHelper.XmlSerializeEntity(obj);
//return xeAgentDemographicResponse.ToString();
//if (obj.AgentCode == null)
//{
// obj.AgentCode = “”;
//}

return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new ObjectContent<AgentDemographicResponse>(obj,
new System.Net.Http.Formatting.XmlMediaTypeFormatter
{
UseXmlSerializer = true
})

});

}}
}

Web Service Project Structure :-

  1. Entity Project Class file–>DLL

Agent.cs  File:-

#region usings

using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using CSSI.Common.Utilities;
using CSSI.VUE.Common.Entities;
using CSSI.VUE.Custom.Entities;
using System.Web.Mvc;
using CSSI.VUE.Entities;

#endregion

namespace CSSI.VUE.Entities.Ext
{
/// <summary>
/// Agent Extensibility class
/// </summary>

#region Agent Other Info
[DataContract(Name = “AgentOtherInfo”, Namespace = “http://www.ecssi.org&#8221;)]
public class AgentOtherInfo : Agent
{
#region Properties

/// <summary>
/// Property for Agentotherinfoid
/// </summary>
[DataMember]
public int AgentOtherInfoID { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string Department { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string DepartmentManager { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public bool HasOtherNames { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public int EthnicityID { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string Ethnicity { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string EyeColor { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string FLSAStatus { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string HairColor { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string Height { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public decimal Weight { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public bool IsCurrentUSCitizen { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string OtherCitizenCountry { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string JobCode { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string RATitle { get; set; }

/// <summary>
/// Property for AgentResidentYears
/// </summary>
[DataMember]
public int AgentResidentYears { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public bool IsPreviousLicensesHeld { get; set; }

/// <summary>
/// Property for IsPreviousAppointmentHeld
/// </summary>
[DataMember]
public bool IsPreviousAppointmentHeld { get; set; }

/// <summary>
/// Property for DegreeCertDocumentID – to store the document ID for highest degree cert earned
/// </summary>
[DataMember]
public int DegreeCertDocumentID { get; set; }

/// <summary>
/// Property for CMSTestScore
/// </summary>
[DataMember]
public string CMSTestScore { get; set; }

/// <summary>
/// Property for CMSTestDate
/// </summary>
[DataMember]
public DateTime? CMSTestDate { get; set; }

#region Other Name

[DataMember]
public AgentOtherName AgentOtherName { get; set; }

#endregion

#region Languages Spoken

[DataMember]
public AgentLanguage AgentLanguage { get; set; }

#endregion

#region Agent Attestation Attorney

[DataMember]
public AgentAttestationAttorney AgentAttestationAttorney { get; set; }

#endregion

#region DriversLicenseInfo

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentDLNumber { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentDLState { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentNameonDL { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public DateTime? AgentDLExpirationDate { get; set; }

#endregion DriversLicenseInfo

#region StateID Info

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentStateIDNumber { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentStateIdentification { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string AgentNameonStateID { get; set; }

/// <summary>
/// Property for State Id Expiration Date
/// </summary>
[DataMember]
public DateTime? StateIdExpirationDate { get; set; }

#endregion DriversLicenseInfo

#region EducationInfo
/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string CityStudiedIn { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string StateStudiedIn { get; set; }

/// <summary>
/// Property for DegreeDateAttendedFrom
/// </summary>
[DataMember]
public DateTime? DegreeDateAttendedFrom { get; set; }

/// <summary>
/// Property for DegreeDateAttendedTo
/// </summary>
[DataMember]
public DateTime? DegreeDateAttendedTo { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string HighestDegreeEarned { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string MostRecentSchoolName { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public DateTime? LastRehireDate { get; set; }

/// <summary>
/// Property for Current Designation
/// </summary>
[DataMember]
public string CurrentDesignation { get; set; }

#endregion

#region PlaceofBirth
/// <summary>
/// Property for City of Birth
/// </summary>
[DataMember]
public string CityOfBirth { get; set; }

/// <summary>
/// Property for State of Birth
/// </summary>
[DataMember]
public string StateOfBirth { get; set; }

/// <summary>
/// Property for Country Of Birth
/// </summary>
[DataMember]
public string CountryOfBirth { get; set; }

#endregion PlaceofBirth

#region Agent Pages Info

/// <summary>
/// Property for PreviousPage
/// </summary>
[DataMember]
public string PreviousPage { get; set; }

/// <summary>
/// Property for CurrentPage
/// </summary>
[DataMember]
public string CurrentPage { get; set; }

/// <summary>
/// Property for NextPage
/// </summary>
[DataMember]
public string NextPage { get; set; }

 

[DataMember]
public int ContractLicenseStatusID { get; set; }

#endregion

#region Individual Object
/// <summary>
/// Holds Agent Employer
/// </summary>
[DataMember]
public AgentEmployerHistory AgentEmployerHistory { get; set; }
#endregion

#region Lists
/// <summary>
/// Holds AgentLanguageList
/// </summary>
[DataMember]
public List<AgentLanguage> AgentLanguagesList { get; set; }

/// <summary>
/// Holds Agent Reference List
/// </summary>
[DataMember]
public List<AgentReference> AgentReferenceList { get; set; }

/// <summary>
/// Holds Other Agent List
/// </summary>
[DataMember]
public List<AgentOtherName> AgentOtherNamesList { get; set; }

 

/// <summary>
/// Holds Agent Employer List
/// </summary>
[DataMember]
public List<AgentEmployerHistory> AgentEmployerHistoryList { get; set; }

 

/// <summary>
/// Holds Agent License List
/// </summary>
[DataMember]
public List<AgentLicenseHistory> AgentLicenseHistoryList { get; set; }

 

/// <summary>
/// Holds Agent Appointment History List
/// </summary>
[DataMember]
public List<AgentAppointmentHistory> AgentAppointmentHistoryList { get; set; }

/// <summary>
/// Holds Agent Address History List
/// </summary>
[DataMember]
public List<AgentAddressHistory> AgentAddressHistoryList { get; set; }

/// <summary>
/// Holds Agent Insurance Experience List
/// </summary>
[DataMember]
public List<AgentInsuranceExperience> AgentInsuranceExperienceList { get; set; }

[DataMember]
public Certification AgentCertifications { get; set; }

#endregion

#endregion

[DataMember]
public Documents CertificationDocuments { get; set; }

}

#endregion Agent Other Info

#region Agent Language
public class AgentLanguage : AgentBase
{

 

[DataMember]
public int AgentLanguageId { get; set; }

/// <summary>
/// Property for PrimarySpokenLanguage
/// </summary>
[DataMember]
public string PrimarySpokenLanguage { get; set; }

/// <summary>
/// Property for Secondary Language
/// </summary>
[DataMember]
public string SecondarySpokenLanguage { get; set; }

/// <summary>
/// Property for Other Language
/// </summary>
[DataMember]
public string OtherSpokenLanguage { get; set; }

[DataMember]
public string FluencyLevel { get; set; }

[DataMember]
public string LanguageDialect { get; set; }

[DataMember]
public string LanguageUsageinJob { get; set; }
}

#endregion Agent Language

#region Agent Language List

/// <summary>
/// Class for Agent AgentLanguages
/// </summary>
[DataContract(Name = “AgentLanguages”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentLanguages : BaseEntity
{
#region Properties

/// <summary>
/// Holds AgentLanguageList
/// </summary>
[DataMember]
public List<AgentLanguage> AgentLanguagesList { get; set; }

#endregion
}
#endregion Agent Language List

#region Agent References
// <summary>
/// Class for Agent Reference
/// </summary>
[DataContract(Name = “AgentReference”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentReference : AgentBase
{
#region Properties

[DataMember]
public int AgentReferenceID { get; set; }

[DataMember]
public string ReferenceName { get; set; }

[DataMember]
public string ReferenceTitle { get; set; }

[DataMember]
public int Affiliation { get; set; }

[DataMember]
public int YearsKnown { get; set; }

[DataMember]
public string ReferenceRelationship { get; set; }

[DataMember]
public string ReferencePhone { get; set; }

/// <summary>
/// Property for Address
/// </summary>
[DataMember]
public string Address { get; set; }

/// <summary>
/// Property for City
/// </summary>
[DataMember]
public string City { get; set; }

/// <summary>
/// Property for State
/// </summary>
[DataMember]
public string State { get; set; }

#endregion
}

#endregion Agent References

#region Agent References List

/// <summary>
/// Class for Agent References
/// </summary>
[DataContract(Name = “AgentReferences”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentReferences : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent Reference List
/// </summary>
[DataMember]
public List<AgentReference> AgentReferenceList { get; set; }

#endregion
}
#endregion Agent References List

#region Agent Other Names
// <summary>
/// Class for AgentOtherName
/// </summary>
[DataContract(Name = “AgentOtherName”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentOtherName : AgentBase
{
#region Properties

[DataMember]
public int AgentOtherNameID { get; set; }

[DataMember]
public string FirstName { get; set; }

[DataMember]
public string MiddleName { get; set; }

[DataMember]
public string LastName { get; set; }

[DataMember]
public DateTime? DatesUsedFrom { get; set; }

[DataMember]
public DateTime? DatesUsedTo { get; set; }

[DataMember]
public string ReasonUsed { get; set; }

#endregion
}
#endregion Agent Other Names

#region Agent Other Names List

/// <summary>
/// Class for Other Agents
/// </summary>
[DataContract(Name = “AgentOtherNames”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentOtherNames : BaseEntity
{
#region Properties

/// <summary>
/// Holds Other Agent List
/// </summary>
[DataMember]
public List<AgentOtherName> AgentOtherNamesList { get; set; }

#endregion
}

#endregion Agent Other Names List

#region Agent Employer History
// <summary>
/// Class for holding AgentEmployerHistory details
/// </summary>
[DataContract(Name = “AgentEmployerHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentEmployerHistory : AgentBase
{
#region Properties

[DataMember]
public int AgentEmployerID { get; set; }

[DataMember]
public bool IsEmployerCurrent { get; set; }

[DataMember]
public string EmployerName { get; set; }

[DataMember]
public string Supervisor { get; set; }

[DataMember]
public string JobTitle { get; set; }

[DataMember]
public string Phone { get; set; }

/// <summary>
/// Property for Address
/// </summary>
[DataMember]
public string Address { get; set; }

/// <summary>
/// Property for City
/// </summary>
[DataMember]
public string City { get; set; }

/// <summary>
/// Property for State
/// </summary>
[DataMember]
public string State { get; set; }

 

/// <summary>
/// Property for ZipCode
/// </summary>
[DataMember]
public string ZipCode { get; set; }

/// <summary>
/// Property for BusinessPhone
/// </summary>
[DataMember]
public string BusinessPhone { get; set; }

/// <summary>
/// Property for BusinessFax
/// </summary>
[DataMember]
public string BusinessFax { get; set; }

[DataMember]
public int YearsOfService { get; set; }

[DataMember]
public int MonthsOfService { get; set; }

[DataMember]
public DateTime? EffectiveDateFrom { get; set; }

[DataMember]
public DateTime? EffectiveDateTo { get; set; }

[DataMember]
public DateTime? HireDate { get; set; }

#endregion
}
#endregion

#region Agent Employer History List
/// <summary>
/// Class for Other Employer list
/// </summary>
[DataContract(Name = “AgentEmployerHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentEmployersHistory : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent Employer List
/// </summary>
[DataMember]
public List<AgentEmployerHistory> AgentEmployerHistoryList { get; set; }

#endregion
}
#endregion Agent Employer History List

#region Agent License History

/// <summary>
/// Class for License
/// </summary>
[DataContract(Name = “AgentLicenseHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentLicenseHistory : AgentBase
{
/// <summary>
/// Property for AgentLicenseHistoryID
/// </summary>
[DataMember]
public int AgentLicenseHistoryID { get; set; }

/// <summary>
/// Property for LicenseNumber
/// </summary>
[DataMember]
public string LicenseNumber { get; set; }

/// <summary>
/// Property for LicenseFromDate
/// </summary>
[DataMember]
public DateTime? LicenseEffectiveFrom { get; set; }

/// <summary>
/// Property for LicenseToDate
/// </summary>
[DataMember]
public DateTime? LicenseEffectiveTo { get; set; }

[DataMember]
public string StateCode { get; set; }
}
#endregion

#region Agent License History List
/// <summary>
/// Class for Agent Licenses
/// </summary>
[DataContract(Name = “AgentLicensesHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentLicensesHistory : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent License List
/// </summary>
[DataMember]
public List<AgentLicenseHistory> AgentLicenseHistoryList { get; set; }

#endregion
}
#endregion Agent License History List

#region Agent Appointments History

/// <summary>
/// Class for Agent Appointment
/// </summary>
[DataContract(Name = “AgentAppointmentHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentAppointmentHistory : AgentBase
{
/// <summary>
/// Property for AgentAppointmentHistoryID
/// </summary>
[DataMember]
public int AgentAppointmentHistoryID { get; set; }

/// <summary>
/// Property for CompanyName
/// </summary>
[DataMember]
public string CompanyName { get; set; }

/// <summary>
/// Property for AppointmentDurationFrom
/// </summary>
[DataMember]
public DateTime? AppointmentDurationFrom { get; set; }

/// <summary>
/// Property for AppointmentDurationTo
/// </summary>
[DataMember]
public DateTime? AppointmentDurationTo { get; set; }
}

#endregion Agent Appointments History

#region Agent Appointments History List
/// <summary>
/// Class for Agent Appointments
/// </summary>
[DataContract(Name = “AgentAppointmentsHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentAppointmentsHistory : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent Appointment History List
/// </summary>
[DataMember]
public List<AgentAppointmentHistory> AgentAppointmentHistoryList { get; set; }

#endregion
}
#endregion Agent Appointments History List

#region AddressesHistory
/// <summary>
/// Class for Agent Address History
/// </summary>
[DataContract(Name = “AgentAddressHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentAddressHistory : AgentBase
{
/// <summary>
/// Property for AgentAddressHistoryID
/// </summary>
[DataMember]
public int AddressHistoryID { get; set; }

/// <summary>
/// Property for AddressLine1
/// </summary>
[DataMember]
public string AddressLine1 { get; set; }

/// <summary>
/// Property for AddressLine
/// </summary>
[DataMember]
public string AddressLine2 { get; set; }

/// <summary>
/// Property for City
/// </summary>
[DataMember]
public string City { get; set; }

/// <summary>
/// Property for State
/// </summary>
[DataMember]
public string State { get; set; }

/// <summary>
/// Property for Zip
/// </summary>
[DataMember]
public string Zip { get; set; }

/// <summary>
/// Property for TimeStayedFrom
/// </summary>
[DataMember]
public DateTime? TimeStayedFrom { get; set; }

/// <summary>
/// Property for TimeStayedTo
/// </summary>
[DataMember]
public DateTime? TimeStayedTo { get; set; }

/// <summary>
/// Property for IsCurrentAddress
/// </summary>
[DataMember]
public bool IsCurrentAddress { get; set; }

}

#endregion

#region Addresses History List

/// <summary>
/// Class for Agent Addresess History
/// </summary>
[DataContract(Name = “AgentAddressesHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentAddressesHistory : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent Address History List
/// </summary>
[DataMember]
public List<AgentAddressHistory> AgentAddressHistoryList { get; set; }

#endregion
}

#endregion

#region AgentWorkPlan
/// <summary>
/// Class for Agent Appointment
/// </summary>
[DataContract(Name = “AgentWorkPlans”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentWorkPlan : AgentBase
{
/// <summary>
/// Property for AgentWorkPlanID
/// </summary>
[DataMember]
public int AgentWorkPlanID { get; set; }

/// <summary>
/// Property for StateCode
/// </summary>
[DataMember]
public string StateCode { get; set; }

/// <summary>
/// Property for IsResidentState
/// </summary>
[DataMember]
public bool IsResidentState { get; set; }

/// <summary>
/// Property for InvitationSent
/// </summary>
[DataMember]
public bool IsInvitationSent { get; set; }

/// <summary>
/// Property for InvitationSentDate
/// </summary>
[DataMember]
public DateTime? InvitationSentDate { get; set; }

/// <summary>
/// Property for InvitationSentTo
/// </summary>
[DataMember]
public string InvitationSentTo { get; set; }

}

/// <summary>
/// Class for Agent Appointments
/// </summary>
[DataContract(Name = “AgentWorkPlans”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentWorkPlans : BaseEntity
{
#region Properties

/// <summary>
/// Holds AgentWorkPlan List
/// </summary>
[DataMember]
public List<AgentWorkPlan> AgentWorkPlanList { get; set; }

#endregion

}
#endregion

#region AgentAttestationAttorney

[DataContract(Name = “AgentAttestationAttorney”, Namespace = “http://www.ecssi.org&#8221;)]
public class AgentAttestationAttorney : AgentBase
{
#region Properties

/// <summary>
/// Property For AgentAttestationAttorneyID
/// </summary>
[DataMember]
public int AgentAttestationAttorneyID { get; set; }

/// <summary>
/// Property For FormName
/// </summary>
[DataMember]
public string FormName { get; set; }

/// <summary>
/// Property For EmployeeName
/// </summary>
[DataMember]
public string EmployeeName { get; set; }

/// <summary>
/// Property For IsAgreed
/// </summary>
[DataMember]
public bool IsAgreed { get; set; }

/// <summary>
/// Property For EESignature
/// </summary>
[DataMember]
public string EESignature { get; set; }

/// <summary>
/// Property For EESignatureDate
/// </summary>
[DataMember]
public DateTime? EESignatureDate { get; set; }

/// <summary>
/// Property For PowerofAttorneyDate
/// </summary>
[DataMember]
public DateTime? PowerofAttorneyDate { get; set; }

/// <summary>
/// Property For PowerofAttorneyExecutionDate
/// </summary>
[DataMember]
public DateTime? PowerofAttorneyExecutionDate { get; set; }

/// <summary>
/// Property For PowerofAttorneyWitnessName
/// </summary>
[DataMember]
public string PowerofAttorneyWitnessName { get; set; }

/// <summary>
/// Property For PowerofAttorneyWitnessSign
/// </summary>
[DataMember]
public string PowerofAttorneyWitnessSign { get; set; }

#endregion
}

#endregion AgentAttestationAttorney

#region AgentInsuranceExperience

[DataContract(Name = “AgentInsuranceExperience”, Namespace = “http://www.ecssi.org&#8221;)]
public class AgentInsuranceExperience : AgentBase
{
#region Properties

/// <summary>
/// Property For AgentInsuranceExperienceID
/// </summary>
[DataMember]
public int AgentInsuranceExperienceID { get; set; }

/// <summary>
/// Property For CompanyName
/// </summary>
[DataMember]
public string CompanyName { get; set; }

/// <summary>
/// Property For HO City
/// </summary>
[DataMember]
public string HOCity { get; set; }

 

/// <summary>
/// Property For HO State
/// </summary>
[DataMember]
public string HOState { get; set; }

/// <summary>
/// Property For AnnualizedProduction
/// </summary>
[DataMember]
public Decimal AnnualizedProduction { get; set; }

/// <summary>
/// Property For Persistency
/// </summary>
[DataMember]
public Decimal Persistency { get; set; }

/// <summary>
/// Property For DurationFrom
/// </summary>
[DataMember]
public DateTime? DurationFrom { get; set; }

/// <summary>
/// Property For DurationTo
/// </summary>
[DataMember]
public DateTime? DurationTo { get; set; }

/// <summary>
/// Property For Product Sold
/// </summary>
[DataMember]
public string ProductSold { get; set; }
/// <summary>
/// Property For Comments
/// </summary>
[DataMember]
public string Comments { get; set; }

#endregion
}

#endregion AgentInsuranceExperience

#region Agent Insurance Experience List

/// <summary>
/// Class for Agent Addresess History
/// </summary>
[DataContract(Name = “AgentAddressesHistory”, Namespace = AppConstants.CSSI_NAMESPACE)]
public class AgentInsurancesExperience : BaseEntity
{
#region Properties

/// <summary>
/// Holds Agent Insurance Experience List
/// </summary>
[DataMember]
public List<AgentInsuranceExperience> AgentInsuranceExperienceList { get; set; }

#endregion
}

#endregion

//Added By Suryakant on 31/10/2017

#region AgentDemographicRequest
[DataContract]
public class AgentDemographicRequest
{
[DataMember]
public string RequestType { get; set; }

[DataMember]
public string AgentCode { get; set; }

[DataMember]
public string SitusState { get; set; }

[DataMember]
public string SolicitationState { get; set; }

[DataMember]
public string CarrierCode { get; set; }
[DataMember]
public string LOB { get; set; } //Chnages LOA to LOB as SRS

[DataMember]
public DateTime ApplicationSignedDate { get; set; }

[DataMember]
public string WritingNumber { get; set; }

[DataMember]
public string Npn { get; set; } //This prop not mentioned in VUE_Guidewire_Integration Doc.

}

#endregion

#region AgentDemographicResponse
[DataContract(Name = “AgentDemographicResponse”, Namespace = “http://www.ecssi.org&#8221;)]
public class AgentDemographicResponse
{
[DataMember]
public string AgentCode { get; set; }

[DataMember]
public string Title { get; set; }

[DataMember]
public string FirstName { get; set; }

[DataMember]
public string MiddleName { get; set; }

[DataMember]
public string LastName { get; set; }

[DataMember]
public string FullName { get; set; }

[DataMember]
public string Gender { get; set; }

[DataMember]
public string SSN { get; set; }

[DataMember]
public string TaxID { get; set; }

[DataMember]
public string NPN { get; set; }

[DataMember]
public string DOB { get; set; }

[DataMember]
public string BusinessFrom { get; set; }

[DataMember]
public string IsAgency { get; set; }

[DataMember]
public string Status { get; set; }

[DataMember]
public string StatusDate { get; set; }

[DataMember]
public string StatusReason { get; set; }

[DataMember]
public string PreferredMethodOfCommunication { get; set; }

[DataMember]
public bool IsEligible { get; set; }

[DataMember]
public string EligibilityReason { get; set; }

[DataMember]
public string AddressType { get; set; }

[DataMember]
public string AddressLine1 { get; set; }

 

[DataMember]
public string AddressLine2 { get; set; }

[DataMember]
public string AddressLine3 { get; set; }

 

[DataMember]
public string City { get; set; }

[DataMember]
public string State { get; set; }

[DataMember]
public string ZipCode { get; set; }

[DataMember]
public string County { get; set; }

[DataMember]
public bool IsOutsideUSA { get; set; }

[DataMember]
public string Country { get; set; }

[DataMember]
public string BusinessEmail { get; set; }

[DataMember]
public string BusinessPhone { get; set; }

[DataMember ]

public string ErrorMessage { get; set; }

}

#endregion

//Ended By Suryakant.
}

2. Business Project —> DLL

a) BusinessConstant.cs

namespace CSSI.VUE.ICM.Business.Ext
{
public static class BusinessConstants
{
// Common messages for save and delete
public const string SAVESUCCESSMESSAGE = “Record saved successfully”;
public const string DELETESUCCESSMESSAGE = “Record(s) deleted successfully”;
public const string SAVEFAILMESSAGE = “Validation Failed. Please correct the errors.”;

// Login Validation messages
public const string LOGINFAILMESSAGE = “Validation Failed”;
public const string USERNAMEREQUIRED = “User Name is required.”;
public const string PASSWORDREQUIRED = “Password is required.”;

// License Validation messages
public const string LICENSESTATEREQUIRED = “State is required”;
public const string LICENSELOAREQUIRED = “Line of Authority is required”;
public const string LICENSETYPEREQUIRED = “License Type is required”;
public const string LICENSEISSUEDATEREQUIRED = “Issue Date is required”;
public const string LICENSESTATUSREQUIRED = “Status is required”;
public const string LICENSEREASONREQUIRED = “Reason is required”;
public const string LICENSEEXPIRATIONDATEREQUIRED = “Expiration Date is required”;

//Company Validation messages
public const string GETFAILMESSAGE = “Validation Failed. Please correct the errors.”;

//Carrier validation Messages
public const string CARRIERSAVESUCCESSMESSAGE = “Carrier information saved successfully”;
public const string CARRIERDELETESUCCESSMESSAGE = “Carrier(s) information deleted successfully”;
public const string CARRIERIDNAMEREQUIRED = “CarrierID/CarrierName is Required.”;
public const string CARRIERDELETEFAILMESSAGE = “Validation Failed. Please correct the errors.”;

//IST Watch
public const string ISTRESPONSEPASS = “IST Pass”;
public const string ISTRESPONSEFAIL = “IST Fail”;
public const string ISTRESPONSEERROR = “IST Error”;
public const string ISTERRORDESCRIPTION = “Due to some technical failure system could not connect to ISTWatch services to validate the Agent/CSR data, please retry after sometime”;
public const string ISTFAILDESCRIPTION = “Agent details did not pass ISTWatch, IST Response/IST Error Description are updated accordingly”;
}
}

b) CommonBL

#region usings

using System.Data;
using System.Xml.Linq;
using CSSI.Common.Utilities;
using CSSI.VUE.Common.Business;
using CSSI.VUE.ICM.Data.Ext;
using System;
using CSSI.VUE.Entities.Ext;
using CSSI.VUE.Common.Data;

#endregion

namespace CSSI.VUE.ICM.Business.Ext
{
/// <summary>
/// Common methods
/// </summary>
public class CommonBLL : BaseBusiness
{
#region Constructors

/// <summary>
/// Default Constructor
/// </summary>
public CommonBLL()
: base()
{ }

/// <summary>
/// Overloaded Constructor
/// </summary>
/// <param name=”instanceName”></param>
public CommonBLL(string instanceName)
: base(instanceName)
{ }

#endregion

#region Public Methods

/// <summary>
/// To generate the xml Skelton based on requirement
/// </summary>
/// <returns>XElement</returns>
public XElement GetPickListDataSource()
{

XNamespace xns = XNamespace.Get(AppConstants.CSSI_NAMESPACE);

XElement xePickListDataSource = new
XElement(xns + “ROOT”,
new XElement(xns + “DISTRIBUTIONLIST”,
new XElement(xns + “DISTRIBUTION”,
new XElement(xns + “DISTRIBUTIONID”
)))
);

return xePickListDataSource;

}

/// <summary>
/// To generate the xml Skelton based on requirement
/// </summary>
/// <param name=”xePickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetPickListData(XElement xePickListData)
{
DataSet dsPickListData = null;

try
{
VUE.ICM.Data.Ext.CommonData commmonData = new VUE.ICM.Data.Ext.CommonData(base.AppInstanceKey);
dsPickListData = commmonData.GetPickListData(xePickListData);
}
catch
{
throw;
}

return dsPickListData;
}

/// <summary>
/// To generate the xml Skelton based on requirement
/// </summary>
/// <returns>XElement</returns>
public XElement GetCustomPickListDataSource()
{

XNamespace xns = XNamespace.Get(AppConstants.CSSI_NAMESPACE);

XElement xeDropdownValuesSource = new
XElement(xns + “ROOT”,
new XElement(xns + “CATEGORY”
),
new XElement(xns + “FILTER”
)
);

return xeDropdownValuesSource;
}

/// <summary>
/// To generate the xml Skelton based on requirement
/// </summary>
/// <param name=”xeCustomPickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetCustomPickListData(XElement xeCustomPickListData)
{
DataSet dsDropdownValues = null;

try
{
VUE.ICM.Data.Ext.CommonData commmonData = new VUE.ICM.Data.Ext.CommonData(base.AppInstanceKey);
dsDropdownValues = commmonData.GetCustomPickListData(xeCustomPickListData);
}
catch
{
throw;
}

return dsDropdownValues;
}

 

public DataSet GetSystemData(string strQuery)
{
DataSet dstDataDetails = null;
try
{
VUE.ICM.Data.Ext.CommonData loginData = new VUE.ICM.Data.Ext.CommonData();
dstDataDetails = loginData.GetSystemData(strQuery);
return dstDataDetails;
}
catch (Exception ex)
{
throw ex;
}
}

//Added By Suryakant on 30/10/2017
public AgentDemographicResponse ProducerEligibility(AgentDemographicRequest Req)
{
AgentDemographicResponse resp = new AgentDemographicResponse();
VUE.ICM.Data.Ext.CommonData data = new VUE.ICM.Data.Ext.CommonData();
resp = data.ProducerEligibility(Req);

//Gets Data from Datalayer and fill response object and this response object is used in ServiceLayer
return resp;
// return
}
//Ended by Suryakant
#endregion

}
}

3) Data Project –> DLL

           a) CommonData.cs

#region usings

using System.Data;
using System.Data.Common;
using System.Xml.Linq;
using CSSI.VUE.Common.Data;
using CSSI.VUE.Common.Entities;
using System;
using CSSI.VUE.Entities.Ext;
using CSSI.VUE.Entities;
using System.Collections.Generic;
using CSSI.Common.DataMapper;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.IO;
using System.Text;
using System.Linq;

#endregion

namespace CSSI.VUE.ICM.Data.Ext
{
public class CommonData : BaseData
{
#region Constructors

/// <summary>
/// Default Constructor
/// </summary>
public CommonData()
: base()
{ }

/// <summary>
/// Overloaded Constructor
/// </summary>
/// <param name=”instanceName”></param>
public CommonData(string instanceName)
: base(instanceName)
{ }

#endregion

#region public methods

/// <summary>
/// To get the values to fill in dropdowns based on xml string.
/// </summary>
/// <param name=”xeCustomPickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetCustomPickListData(XElement xeCustomPickListData)
{
try
{
string storedProcedureName = “pICg_DropdownValues”;

DbCommand cmdDbCommand = base.Database.GetStoredProcCommand(storedProcedureName);
cmdDbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(
cmdDbCommand,
“@aXmlString”,
DbType.String,
xeCustomPickListData.ToString().Trim().ClearNameSpace());

 

DataSet dsDropdownDetails = new DataSet(“DROPDOWNDETAILS”);
base.Database.LoadDataSet(cmdDbCommand, dsDropdownDetails, “DETAILS”);

return dsDropdownDetails;
}
catch
{
throw;
}
}

/// <summary>
/// To get the data from databamse based on xml format
/// </summary>
/// <param name=”xePickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetPickListData(XElement xePickListData)
{
try
{
string storedProcedureName = “usp_Cmn_Get_PickList”;

DbCommand cmdDbCommand = base.Database.GetStoredProcCommand(storedProcedureName);
cmdDbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(
cmdDbCommand,
“@aXmlString”,
DbType.String,
xePickListData.ToString().Trim().ClearNameSpace());

DataSet dsPickList = new DataSet(“PICKLISTLIST”);
base.Database.LoadDataSet(cmdDbCommand, dsPickList, “PICKLIST”);

return dsPickList;
}
catch
{
throw;
}
}

 
/// <summary>
/// get the System data based on the distribution id
/// </summary>
/// <param name=”strEntity”></param>
/// <returns></returns>
public DataSet GetSystemData(string strEntity)
{
try
{
string strStoredProcedureName = “USP_BLU_GET_SysSettings”;

DbCommand dbCommand = base.Database.GetStoredProcCommand(strStoredProcedureName);
dbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(dbCommand, “@aXmlString”, DbType.String, strEntity);

DataSet dsSystem = new DataSet(“SYSTEMLIST”);
base.Database.LoadDataSet(dbCommand, dsSystem, “SYSTEM”);

return dsSystem;
}
catch (Exception exGetPickListData)
{
throw exGetPickListData;
}
}

/// <summary>
/// get the System data based on the distribution id
/// </summary>
/// <param name=”strEntity”></param>
/// <returns></returns>
public DataSet GetSystemDataByProperties(string strEntity)
{
try
{
string strStoredProcedureName = “USP_BLU_GET_SysSettingsByProperty”;

DbCommand dbCommand = base.Database.GetStoredProcCommand(strStoredProcedureName);
dbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(dbCommand, “@aXmlString”, DbType.String, strEntity);

DataSet dsSystem = new DataSet(“SYSTEMLIST”);
base.Database.LoadDataSet(dbCommand, dsSystem, “SYSTEM”);

return dsSystem;
}
catch (Exception exGetPickListData)
{
throw exGetPickListData;
}
}

 

/// <summary>
/// To set the data table values as IEnumerable<SelectListItem> to fill dropdowns
/// </summary>
/// <param name=”table”></param>
/// <returns>IEnumerable<SelectListItem></returns>
public static IDictionary<int, string> GetSelectListItem(DataTable dtInput)
{
Dictionary<int, string> selectList = new Dictionary<int, string>();

foreach (DataRow dr in dtInput.Rows)
{
selectList.Add(Convert.ToInt32(dr[“KEY”].ToString()), dr[“VALUE”].ToString());
}

return selectList;
}

/// <summary>
/// Gets the Region Detail based on ZipCode
/// </summary>
/// <param name=”zipCode”></param>
/// <returns></returns>
public DataSet GetRegionDetail(string zipCode)
{
DataSet dsRegionDetail = null;

try
{
string storedProcedureName = “pICg_ZipCodeRegionDetail”;

DbCommand dbCommand = base.Database.GetStoredProcCommand(storedProcedureName);
dbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(dbCommand, “@aZipCode”, DbType.String, zipCode);

dsRegionDetail = new DataSet(“REGIONDETAIL”);

base.Database.LoadDataSet(dbCommand, dsRegionDetail, “REGIONDETAIL”);
}
catch (Exception exGetRegionDetail)
{
throw;
}

return dsRegionDetail;
}

/// <summary>
/// Saves UDField information
/// </summary>
/// <typeparam name=”T”></typeparam>
/// <param name=”additionalObj”></param>
/// <param name=”additionalXml”></param>
/// <param name=”categoryName”></param>
/// <param name=”subCategoryName”></param>
/// <param name=”entityID”></param>
/// <param name=”entityTypeID”></param>
/// <param name=”entityState”></param>
/// <param name=”userName”></param>
/// <returns></returns>
public T SaveUDFieldInfo<T>(T additionalObj, string additionalXml, string categoryName, string subCategoryName,
int entityID, int entityTypeID, EntityState entityState, string userName) where T : BaseEntity
{
try
{
string storedProcedureName = “pICs_UDField”;

DbCommand dbCommand = base.Database.GetStoredProcCommand(storedProcedureName);
dbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;

base.Database.AddInParameter(dbCommand, “@aXmlString”, DbType.String, additionalXml);
base.Database.AddInParameter(dbCommand, “@aCategoryName”, DbType.String, categoryName);
base.Database.AddInParameter(dbCommand, “@aSubCategoryName”, DbType.String, subCategoryName);
base.Database.AddInParameter(dbCommand, “@aEntityTypeID”, DbType.Int32, entityTypeID);
base.Database.AddInParameter(dbCommand, “@aEntityID”, DbType.Int32, entityID);
base.Database.AddInParameter(dbCommand, “@aEntityState”, DbType.Int32, Convert.ToInt32(entityState));
base.Database.AddInParameter(dbCommand, “@aUserName”, DbType.String, userName);

base.Database.AddOutParameter(dbCommand, “@aUDFieldID”, DbType.Int32, 5);

base.Database.ExecuteNonQuery(dbCommand);
}
catch (Exception exSaveUDFieldInfo)
{
EntityHelper.LogAndSetExceptionResponseData<T>(additionalObj, exSaveUDFieldInfo, new Dictionary<string, object> { { “UserID”, additionalObj.UserID }, { “Data”, additionalObj } }, exSaveUDFieldInfo.Message);
}

return additionalObj;
}

 

#endregion

//Added by Suryakant on 31/10/2017

#region ProducerEligibility

public AgentDemographicResponse ProducerEligibility(AgentDemographicRequest Req)
{
AgentDemographicResponse resp = new AgentDemographicResponse();
try
{
XElement xeAgentDemographicRequest = EntityHelper.SqlSerializeEntity<AgentDemographicRequest>(Req);
string strAgentDemographicRequest = xeAgentDemographicRequest.ToString();
string storedProcedureName = “pIcg_AgentEligibility_Api”;
DbCommand dbCommand = base.Database.GetStoredProcCommand(storedProcedureName);
dbCommand.CommandTimeout = DataHelper.DATABASE_CONNECTION_TIMEOUT;
base.Database.AddParameter(dbCommand, “@aXmlString”, DbType.String, ParameterDirection.Input, strAgentDemographicRequest, DataRowVersion.Current, strAgentDemographicRequest);
DataSet dsAgentDemographicResponse = new DataSet(“AgentDemographicResponse”);
base.Database.AddOutParameter(dbCommand, “@aErrorMessage”, DbType.String, 500);
base.Database.LoadDataSet(dbCommand, dsAgentDemographicResponse, “ELIGIBLEAGENTDETAILS”);

resp = MappingFactory.CreateMapper(“AgentDemographicResponseInfoMapper_MetLife”).ToDomainObject<AgentDemographicResponse>(dsAgentDemographicResponse); //AgentDemographicResponseInfoMapper_Aflac
}
catch (Exception exGetCommunication)
{
if (resp != null)
{
// EntityHelper.LogAndSetExceptionResponseData<AgentDemographicResponse>(resp, exGetCommunication, new Dictionary<string, object> { { “AgentCode”, resp.AgentCode }, { “Data”, resp } }, exGetCommunication.Message);
}
}
return resp;
}

#endregion

//Ended by Suryakant.

}
}

4) ServiceContract Project –> DLL

Inside that Service Folder :-

      a) ICommon.cs

#region using

using System.ServiceModel;
using CSSI.Common.Utilities;
using CSSI.VUE.Entities;
using System.Collections.Generic;
using System.Data;
using System.Xml.Linq;
using CSSI.VUE.Entities.Ext;
using CSSI.VUE.Common.Entities;
//using CSSI.VUE.Common.Service;
using CSSI.VUE.DocumentManager.Entities;
#endregion

namespace CSSI.VUE.ICM.Service.Contracts.Ext
{
[ServiceContract(Namespace = AppConstants.CSSI_NAMESPACE)]
public interface ICommonExtService
{
#region Common Members
[OperationContract]
DataSet GetPickListData(XElement xePickListData);

/// <summary>
/// To get the data from database based on xml format
/// </summary>
/// <returns>XElement</returns>
[OperationContract]
XElement GetPickListDataSource();

/// <summary>
/// To get the pick list values from DB based on the category
/// </summary>
/// <returns>XElement</returns>
[OperationContract]
XElement GetCustomPickListDataSource();

[OperationContract]
DataSet GetSystemData(string strQuery);

/// <summary>
/// To get the values to fill in dropdowns based on xml string
/// </summary>
/// <param name=”xeCustomPickListData”></param>
/// <returns>DataSet</returns>
[OperationContract]
DataSet GetCustomPickListData(XElement xeCustomPickListData);

//Added by Suryakant 31/10/2017

/// <summary>
/// To check the eligiblility of Agent
/// </summary>
/// <param name=”Req”></param>
/// <returns>AgentDemographicResponse</returns>
[OperationContract]
AgentDemographicResponse ProducerEligibility(AgentDemographicRequest Req);
#endregion

//Ended by Suryakant

}
}

5) Common Service Project (It’s simple web project becuse check the web config file bellow) -> WCF Serivce project which impliment above data contract interface

a) CommonExtService.cs

#region usings

using System;
using System.Collections.Generic;
using System.ServiceModel.Activation;
using CSSI.VUE.Common.Entities;
using CSSI.VUE.Common.Service;
//using CSSI.VUE.STS.Entities;
using System.Data;
using System.Xml.Linq;
using CSSI.VUE.ICM.Service.Contracts.Ext;
using CSSI.VUE.ICM.Business.Ext;
using CSSI.VUE.Entities.Ext;
//using CSSI.VUE.Data;
using CSSI.VUE.DocumentManager.Entities;
using System.IO;
using System.Text;
using System.Web.Helpers;

 

#endregion

namespace CSSI.VUE.ICM.Service.Ext
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class CommonExtService : BaseService, ICommonExtService
{
/// <summary>
/// To get the values to fill in dropdowns based on xml string
/// </summary>
/// <param name=”xeCustomPickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetCustomPickListData(XElement xeCustomPickListData)
{
try
{
CommonBLL commonBLL = new CommonBLL(base.AppInstanceKey);
return commonBLL.GetCustomPickListData(xeCustomPickListData);
}
catch
{
throw;
}
}
/// <summary>
/// To get the pick list values from DB based on the category
/// </summary>
/// <returns>XElement</returns>
public XElement GetCustomPickListDataSource()
{
try
{
CommonBLL commonBLL = new CommonBLL(base.AppInstanceKey);
return commonBLL.GetCustomPickListDataSource();
}
catch
{
throw;
}
}
/// <summary>
/// To get the data from database based on xml format
/// </summary>
/// <returns>XElement</returns>
public XElement GetPickListDataSource()
{
try
{
CommonBLL commonBLL = new CommonBLL(base.AppInstanceKey);
return commonBLL.GetPickListDataSource();
}
catch
{
throw;
}
}
/// <summary>
/// To get the data from database based on xml format
/// </summary>
/// <param name=”xePickListData”></param>
/// <returns>DataSet</returns>
public DataSet GetPickListData(XElement xePickListData)
{
try
{
CommonBLL commonBLL = new CommonBLL(base.AppInstanceKey);
return commonBLL.GetPickListData(xePickListData);
}
catch
{
throw;
}

}

public DataSet GetSystemData(string strQuery)
{
DataSet dstDataDetails = null;
try
{
CommonBLL commonBLL = new CommonBLL();
dstDataDetails = commonBLL.GetSystemData(strQuery);
return dstDataDetails;
}
catch (Exception ex)
{
throw ex;
}
}

//Added By Suryakant 31/10/2017

public AgentDemographicResponse ProducerEligibility(AgentDemographicRequest Req)
{
//Call to Business LogicLayer
CommonBLL commonBLL = new CommonBLL();
AgentDemographicResponse resp = new AgentDemographicResponse();
try
{
//WebHelper.ErrorLog(“ProducerEligibility Request Call”);

resp = commonBLL.ProducerEligibility(Req);
//WebHelper.ErrorLog(“ProducerEligibility Request Completed”);
}
catch (Exception exAgentDemographicRequest)
{
//WebHelper.ErrorLog(exAgentDemographicRequest.Message);
}

 

return resp;
}

 

//Ended by Suryakant.

}
}

Webconfig.cs

<?xml version=”1.0″?>
<configuration>
<!–
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework=”4.6.2″ />
</system.Web>
–>
<system.web>
<compilation debug=”true” targetFramework=”4.6.2″/>
<pages controlRenderingCompatibilityVersion=”4.0″/>
</system.web>
</configuration>

6) Service.Webhost Project (WCF project)

It has bellow files

a) CommonService.svc

b) Mapping.config

<?xml version=”1.0″?>
<mappingConfiguration>
<mappers>
<add name=”EntityAdditionalInfoMapper” tableName=”ENTITYADDITIONALFIELDINFO”>
<maps>
<add name=”EntityAdditionalFieldID” columnName=”EntityAdditionalFieldID”></add>
<add name=”TableFieldID” columnName=”TableFieldID”></add>
<add name=”FromDate” columnName=”FromDate”></add>
<add name=”ToDate” columnName=”ToDate”></add>
<add name=”Value” columnName=”Value”></add>
</maps>
</add>
<add name=”AgentStatusInfo” tableName=”Agent”>
<maps>
<add name=”AgentID” columnName=”AgentID”></add>
<add name=”Status” columnName=”Status”></add>
</maps>
</add>
<add name=”CarrierSubmissionInfoMapperEXT” tableName=”CARRIERSUBMISSION”>
<maps>
<add name=”CarrierSubmissionID” columnName=”CarrierSubmissionInfoID”></add>
<add name=”CarrierID” columnName=”CarrierID”></add>
<add name=”CarrierName” columnName=”CarrierName”></add>
<add name=”IsContractSpreadsheetRequired” columnName=”ISContractSpreadSheetRequired”></add>
<add name=”CarrierContractingTypeID” columnName=”CarrierContractingTypeID”></add>
<add name=”CarrierContractingTypeValue” columnName=”CarrierContractingTypeValue”></add>
<add name=”ContractContactToEmail” columnName=”ContractContactToEmail”></add>
<add name=”ContractContactCCEmail” columnName=”ContractContactCCEmail”></add>
<add name=”ContractContactBCCEmail” columnName=”ContractContactBCCEmail”></add>
<add name=”AgentSubmissionPerContractPDF” columnName=”AgentSubmissionPerContractPDF”></add>
<add name=”MaxAgentsSubmissionsPerContractPDF” columnName=”MaxAgentsSubmissionsPerContractPDF”></add>
<add name=”StateApprovalContractingTypeID” columnName=”StateApprovalContractingTypeID”></add>
<add name=”StateApprovalContactToEmail” columnName=”StateApprovalContactToEmail”></add>
<add name=”StateApprovalContactCCEmail” columnName=”StateApprovalContactCCEmail”></add>
<add name=”StateApprovalContactBCCEmail” columnName=”StateApprovalContactBCCEmail”></add>
<add name=”IsStateApprovalSpreadsheetRequired” columnName=”StateApprovalSpreadsheetRequired”></add>
<add name=”IsEOReq” columnName=”IsEOReq”></add>
<add name=”FileName” columnName=”EODocumentsPath”></add>
<add name=”QRGFilePath” columnName=”QRGFilePath”></add>
</maps>
</add>

<add name=”ExamInfoMapper” tableName=”EXAMINFO”>
<maps>
<!–<add name=”ExamDetailID” columnName=”ExamDetailID”></add>–>
<add name=”ExamID” columnName=”ExamID”></add>
<add name=”EntityID” columnName=”EntityID”></add>
<add name=”EntityTypeID” columnName=”EntityTypeID”></add>
<add name=”ExamTypeID” columnName=”ExamTypeID”></add>
<add name=”NumberofAttempts” columnName=”NumberOfAttempts”></add>
<add name=”Score” columnName=”FinalScore”></add>
<add name=”ExamLocation” columnName=”ExamLocation”></add>
<add name=”ExamDate” columnName=”ExamDate”></add>
<add name=”StatusID” columnName=”StatusID”></add>
<add name=”ExamType” columnName=”ExamType”></add>
<add name=”IsFinalExam” columnName=”IsFinalExam”></add>
</maps>
</add>

<add name=”LOAExamDetailInfoMapper” tableName=”LOAEXAMDETAILINFO”>
<maps>
<!–<add name=”ExamDetailID” columnName=”ExamDetailID”></add>–>
<add name=”ExamDetailID” columnName=”ExamDetailID”></add>
<add name=”ExamID” columnName=”ExamID”></add>
<add name=”TransNumber” columnName=”TransNumber”></add>
<add name=”StatusID” columnName=”StatusID”></add>
<add name=”InvoiceNumber” columnName=”InvoiceNumber”></add>
<add name=”Fee” columnName=”Fee”></add>
<add name=”Score” columnName=”Score”></add>
<add name=”Description” columnName=”Description”></add>
<add name=”StatusDate” columnName=”StatusDate”></add>
<add name=”ExamType” columnName=”ExamType”></add>
<add name=”LOAID” columnName=”LOAID”></add>
</maps>
</add>

<add name=”CarrierContractInfoMapper” tableName=”CARRIERCONTRACTINFO”>
<maps>
<add name=”CarrierContractID” columnName=”CarrierContractID”></add>
<add name=”CarrierID” columnName=”CarrierID”></add>
<add name=”AgentID” columnName=”AgentID”></add>
<add name=”ContractBeginDate” columnName=”ContractBeginDate”></add>
<add name=”ContractExpirationDate” columnName=”ContractExpirationDate”></add>
<add name=”CarrierName” columnName=”CarrierName”></add>
<add name=”FullName” columnName=”AgentName”></add>
<add name=”AgentCode” columnName=”AgentCode”></add>
<add name=”StatusID” columnName=”StatusID”></add>
<add name=”StatusDate” columnName=”StatusDate”></add>
<add name=”StatusReasonID” columnName=”StatusReasonID”></add>
<add name=”StatusReasonDate” columnName=”StatusReasonDate”></add>
<add name=”ContractingMode” columnName=”ContractingMode”></add>
</maps>
</add>

<add name=”CertificationInfoMapper” tableName=”CERTIFICATIONINFO”>
<maps>
<add name=”CertificationID” columnName=”CertificationID”></add>
<add name=”AgentID” propertypath=”Agent”></add>
<add name=”FullName” propertypath=”Agent”></add>
<add name=”AgentCode” propertypath=”Agent”></add>
<add name=”EntityTypeID” columnName=”EntityTypeID”></add>
<add name=”CarrierID” columnName=”CarrierID”></add>
<add name=”State” columnName=”State”></add>
<add name=”ProductTypeID” columnName=”ProductTypeID”></add>
<add name=”EffectiveFromDate” columnName=”FromDate”></add>
<add name=”EffectiveToDate” columnName=”ToDate”></add>
<add name=”CompletionDate” columnName=”CompletionDate”></add>
<add name=”CertApprovalSourceID” columnName=”CertApprovalSourceID”></add>
<add name=”TypeID” columnName=”TypeID”></add>
<add name=”ProductTypeID” columnName=”ProductTypeID”></add>
</maps>
</add>

<add name=”CourseTrainingDetailInfoMapper” tableName=”COURSETRAININGDETAILINFO”>
<maps>
<add name=”CourseTrainingDetailID” columnName=”CourseTrainingDetailID”></add>
<add name=”CourseTrainingID” columnName=”CourseTrainingID”></add>
<add name=”EntityID” columnName=”EntityID”></add>
<add name=”EntityTypeID” columnName=”EntityTypeID”></add>
<add name=”VendorCourseID” columnName=”VendorCourseID”></add>
<add name=”CourseTypeID” columnName=”CourseTypeID”></add>
<add name=”CourseTitle” columnName=”CourseTitle”></add>
<add name=”State” columnName=”StateCode”></add>
<add name=”EnrolledDate” columnName=”EnrolledDate”></add>
<add name=”CompletionDate” columnName=”CompletionDate”></add>
<add name=”StatusID” columnName=”StatusID”></add>
<add name=”StatusDate” columnName=”StatusDate”></add>
<add name=”CreditHours” columnName=”CreditHours”></add>
<add name=”TrainingMediumID” columnName=”TrainingMediumID”></add>
</maps>
</add>

<add name=”RTSForEntityInfoMapper” tableName=”RTSFORENTITYINFO”>
<maps>
<add name=”RTSForEntityID” columnName=”RTSForEntityID”></add>
<add name=”RTSForEntityTypeID” columnName=”RTSForEntityTypeID”></add>
<add name=”EntityID” columnName=”EntityID”></add>
<add name=”IsRTS” columnName=”IsRTS”></add>
<add name=”IsOverallRTS” columnName=”IsOverallRTS”></add>
<add name=”IsRTSOverride” columnName=”IsRTSOverride”></add>
<add name=”IsOverallRTSOverride” columnName=”IsOverallRTSOverride”></add>
<add name=”ProjectedRTSEffectiveBeginDate” columnName=”ProjectedRTSEffectiveBeginDate”></add>
<add name=”ProjectedRTSEffectiveEndDate” columnName=”ProjectedRTSEffectiveEndDate”></add>
<add name=”RTSEffectiveBeginDate” columnName=”RTSEffectiveBeginDate”></add>
<add name=”RTSEffectiveEndDate” columnName=”RTSEffectiveEndDate”></add>
<add name=”State” columnName=”State”></add>
</maps>
</add>

<add name=”AgentOtherInfoInfoMapper” tableName=”AGENTOTHERINFO”>
<maps>
<add name=”AgentOtherInfoID” columnName=”AgentOtherInfoID”></add>
<add name=”AgentID” columnName=”AgentID”></add>
<add name=”AgentDLState” columnName=”AgentDLState”></add>
<add name=”AgentDLNumber” columnName=”AgentDLNumber”></add>
<add name=”AgentNameonDL” columnName=”AgentNameondl”></add>
<add name=”AgentStateIDNumber” columnName=”AgentStateidnumber”></add>
<add name=”AgentStateIdentification” columnName=”AgentStateIdentification”></add>
<add name=”AgentNameonStateID” columnName=”AgentNameonStateID”></add>
<add name=”PrimarySpokenLanguage” propertypath=”AgentLanguage”></add>
<add name=”SecondarySpokenLanguage” propertypath=”AgentLanguage”></add>
<add name=”OtherSpokenLanguage” propertypath=”AgentLanguage”></add>
</maps>
</add>

<!–RateChart Mappers–>
<add name=”RateChartInfoMapper” tableName=”RATECHARTDETAILS”>
<maps>
<add name=”ScheduleID” columnName=”ScheduleID”></add>
<add name=”ScheduleName” columnName=”ScheduleName”></add>
<add name=”ScheduleEnable” columnName=”ScheduleEnable”></add>
<add name=”LevelList” mapperName=”LevelInfoMapper”></add>
<add name=”Product” mapperName=”ProductInfoRateChartMapper”></add>
</maps>
</add>

<add name=”LevelInfoMapper” tableName=”LEVELDETAILS”>
<maps>
<add name=”LevelID” columnName=”LevelID”></add>
<add name=”LevelName” columnName=”LevelName”></add>
<add name=”LevelISActive” columnName=”LevelISActive”></add>
<add name=”LevelEnable” columnName=”LevelEnable”></add>
<add name=”LevelNameEnable” columnName=”LevelNameEnable”></add>
</maps>
</add>

<add name=”ProductInfoRateChartMapper” tableName=”PRODUCTDETAILS”>
<maps>
<add name=”ProductID” columnName=”ProductID”></add>
<add name=”ProductName” columnName=”ProductName”></add>
<add name=”Range” columnName=”Range”></add>
<add name=”LevelRate” mapperName=”LevelRateInfo”></add>
<add name=”ProductEnable” columnName=”ProductEnable”></add>
</maps>
</add>

<add name=”LevelRateInfo” tableName=”LEVELRATEDETAILS”>
<maps>
<add name=”ProductID” columnName=”ProductID”></add>
<add name=”Range” columnName=”Range”></add>
<add name=”LevelID” columnName=”LevelID”></add>
<add name=”Rate” columnName=”Rate”></add>
<add name=”RateEnable” columnName=”RateEnable”></add>
</maps>
</add>

 

<!– Eligibility –>

<add name=”AgentEligibilityInformationMappers”>
<maps>
<add name=”AgentEligibilityList” mapperName=”AgentEligibilityInformationMapper”/>
</maps>
</add>

<add name=”AgentEligibilityInformationMapper” tableName=”AGENTELIGIBILITY”>
<maps>
<add name=”EligibilityRequired” columnName=”REQUIREDLEVEL”/>
<add name=”AgentEligibilityID” columnName=”AGENTELIGIBILITYID”/>
<add name=”IsLicenseEligible” columnName=”ISLICENSEELIGIBLE”/>
<add name=”IsAppointmentEligible” columnName=”ISAPPOINTMENTELIGIBLE”/>
<add name=”IsCertificationEligible” columnName=”ISCERTIFICATIONELIGIBLE”/>
<add name=”IsPAEligible” columnName=”ISPAELIGIBLE”/>
<add name=”IsEligible” columnName=”ISELIGIBLE”/>
<add name=”StartDate” columnName=”STARTDATE”/>
<add name=”EndDate” columnName=”ENDDATE”/>
<add name=”AgentID” propertypath=”AgentBasicInfo”></add>
<add name=”AgentCode” propertypath=”AgentBasicInfo”></add>
<add name=”FullName” propertypath=”AgentBasicInfo”></add>
</maps>
</add>

<add name=”AgentEligibilityRTSInformationMappers”>
<maps>
<add name=”AgentEligibilityList” mapperName=”AgentEligibilityRTSInformationMapper”/>
</maps>
</add>

<add name=”AgentEligibilityRTSInformationMapper” tableName=”AGENTELIGIBILITY”>
<maps>
<add name=”EligibilityRequired” columnName=”REQUIREDFIELD”/>
<add name=”EligibilityRequiredData” columnName=”FIELDDATA”/>
<add name=”IsLicenseEligible” columnName=”ISLICENSEELIGIBLE”/>
<add name=”IsAppointmentEligible” columnName=”ISAPPOINTMENTELIGIBLE”/>
<add name=”IsCertificationEligible” columnName=”ISCERTIFICATIONELIGIBLE”/>
<add name=”IsPAEligible” columnName=”ISPAELIGIBLE”/>
<add name=”IsEligible” columnName=”ISELIGIBLE”/>
<add name=”AgentID” propertypath=”AgentBasicInfo”></add>
<add name=”AgentCode” propertypath=”AgentBasicInfo”></add>
<add name=”FullName” propertypath=”AgentBasicInfo”></add>
</maps>
</add>
<add name=”AgentDemographicResponseInfoMapper_MetLife” tableName=”ELIGIBLEAGENTDETAILS”>
<maps>
<add name=”AgentCode” columnName=”AgentCode”></add>
<add name=”Title” columnName=”Title”></add>
<add name=”FirstName” columnName=”FirstName”></add>
<add name=”MiddleName” columnName=”MiddleName”></add>
<add name=”LastName” columnName=”LastName”></add>
<add name=”FullName” columnName=”FullName”></add>
<add name=”Gender” columnName=”Gender”></add>
<add name=”SSN” columnName=”SSN”></add>
<add name=”TaxID” columnName=”TaxID”></add>
<add name=”NPN” columnName=”NPN”></add>
<add name=”DOB” columnName=”DOB”></add>
<add name=”BusinessFrom” columnName=”BusinessFrom”></add>
<add name=”IsAgency” columnName=”IsAgency”></add>
<add name=”Status” columnName=”Status”></add>
<add name=”StatusDate” columnName=”StatusDate”></add>
<add name=”StatusReason” columnName=”StatusReason”></add>
<add name=”PreferredMethodOfCommunication” columnName=”PreferredMethodOfCommunication”></add>
<add name=”IsEligible” columnName=”IsEligible”></add>
<add name=”EligibilityReason” columnName=”EligibilityReason”></add>
<add name=”AddressType” columnName=”AddressType”></add>
<add name=”AddressLine1″ columnName=”AddressLine1″></add>
<add name=”AddressLine2″ columnName=”AddressLine2″></add>
<add name=”AddressLine3″ columnName=”AddressLine3″></add>
<add name=”City” columnName=”City”></add>
<add name=”State” columnName=”State”></add>
<add name=”ZipCode” columnName=”ZipCode”></add>
<add name=”County” columnName=”County”></add>
<add name=”IsOutsideUSA” columnName=”IsOutsideUSA”></add>
<add name=”Country” columnName=”Country”></add>
<add name=”BusinessEmail” columnName=”BusinessEmail”></add>
<add name=”BusinessPhone” columnName=”BusinessPhone”></add>
<add name=”ErrorMessage” columnName=”ErrorMessage”></add>
</maps>
</add>
</mappers>
</mappingConfiguration>

7) Now we have actual web application project.

Where we use all of the above things/ any whre we consume it.

 

Advertisements

Sql Imp Query

 

Select * from(
SELECT 0 as SORTCOLUMN, -1 AS [KEY], ‘Select’ AS [VALUE]
UNION all
SELECT 1 AS SORTCOLUMN, PARAMALLOWEDVALUEID AS [KEY], PARAMETERVALUE AS [VALUE]
FROM ICM_COMMPARAMALLOWDVALUE where PARAMETERID = 1 AND ISACTIVE = 1) tbl order by case when SORTCOLUMN=0 then 3 else 1 end,[value]

Java Script Basic

In this blog I am going to discuss some important and basic concepts of Java Script.

Let’s see one by one;

In JavaScript we declare variable using var keyword; we may assign the variable or we may not.

Key Capsule 1:-

So what happen when we declared

var name;

Capsule 1:- Here name stores by default undefined;

if we print using console.log(name)

o/p :- undefined.

Key Capsule 2:-

var name=”Surya”

    var name;

console.log(name)

What you think what will be the out put ?

O/P :- “Surya”

Capsule 2 :- In java script although I declare the variable once again it won’t loose the value.

Key Capsule 3:-

var result=”sun”+2+3;

console.log(result)

result=2+3+”sun”;

console.log(result)

what you think what is the out put ???

O/p:- “sun”23

5”sun”

Capsule 3:- In java script if any numeric values comes after the string then the Plus (+) operator work like as a concatenation operator where as if the numeric value comes before the string then plus (+) operator works and it show addition of number then it concatenate the string.

Key Capsule 4:-

var studnetName=”Suryakant”;

var studentName=”Rajanikant” ;

console.log(studentName);

var studnetName=”Rahul”;

var studentname=”Raj”;

console.log(studnetName);

console.log(studentname);

What will be the out put ??

O/P:- “Rajanikant”

“Rahul”

“Raj”

Capsule 5:- Why so ?? Because the JavaScript variable are case sensitive; so when I write studnetName and strudnetname both are different variable.

Remember all variable in JavaScript are called as identifier and each variable is an unique identifier.

Key Capsule 6 :-

How to print a string like this;

“The name is “Surykant”; he is a blogger.”

I want to print suryakant with the double quot.

To do this in javascript we have different escape character which can be use to achieve this.

We can write;

var data=”The name is \”Suryakant\”; he is a blogger”.

Same for single quto;

var data=”It\’s looking good.”

Most Important Key Capsule 7:-

Difference between == and === operator

“== “ operator is used to check directly the value where as “===” equality operator check the equality and types.

See bellow examples;

Test Case 1:-

var x=”surya”;

var y= “surya”;

console.log(x==y)

console.log(x===y)

o/p- true

Note :- Here the output true for both the case because both are storing same value and both are of same type

Test Case 2:-

var x=”surya”

var y=new string (“surya”)

console.log(x==y);

o/p- true

Scenario:- Here some of us might think that why it returns true ?

This question also came to my mind; because the second one is reference type; as we know inside reference type variable it stores the address of that value i.e “surya”.

So how both are equal then ??

Here important thing to understand that what actually happen when we comparing the value using double equality operator (“==”).

When we using double equality operator (“==”) to compare then this operator perform a type conversion while comparing two things; so in the above example when we compare x and y, although y is a object type it is converted to string type while comparing so both are get same type with value so it returns as true.

Where as triple equality operator (“===”)  never do any type of conversion while comparing; it only check the type and value if both are same then it returns true other wise returns false.

Key To Remember :– So if we check any two reference/object type variable using triple equality operator (“===”) then it always return false; same for double equality operator (“==”) also return false; but if both are reference type pointing to same location then “===” operator return true.

Confused ????

Let’s clear; both reference type/object type pointing to same location means;

var obj=new string(“surya”);

var obj1=obj

Now if we check; obj===obj then we get output as true.

Capsule 7 :- What we learn form the above :-

Double equality operator(“==”) do conversion before checking while triple equal to operator(“===”) never do any conversion before checking it just check the type and value.

examples :-

var a=1;

var b=”surya”;

var c=new string(“surya”);

Now; a===a   // True ;   b===b // True;  c===c   //True

Again if i declare a new object type variable;

var d=new string(“surya”);

Now;  c===d  // False

Note :- Although ‘c’ and ‘d’ are the same type still it return false because after checking the type it will check the value inside it; both are pointing to different location so both have different value so it return false.

if we write; c==d

Note :- Now what happened both are converted to reference type; and due to both pointing different location; so it return false.

Key To Remember :- Due to the above reason double equality operator (“==”) called as loose equality operator where as triple equality operator (“===”) called as  strict equality operator.

Test Case 3:-

var x=”surya”

var y=new string (“surya”)

console.log(x===y);

o/p:- false

Note :- Here the output is false because “===” operator is used to check type and both having different types so it return false.

Test Case 4:-

var x=new string(“surya”);

var y=new string (“surya”);

console.log(x==y);

o/p:- false

console.log(x===y)

o/p:- false

What is value type and reference type in JavaScript ?

Ans:- In java script data types are classified into two types such as value type and reference type.

Under value type we have data type like;

Int, string,number,Boolean,null and etc.

Where as under reference type we have data type like;

Function,array,object.

Combine this all we said all these are object type.

Note:- Value types are directly stored value in side the variable where as reference type are stored the address of the object and that address pointing to the actual value location.

Key Capsule 8 :

In Java script we have different global methods for Number such as;

  • Number()
  • parseInt()
  • parseFloat()

Important Test Case:-

Test Case 1 :- parseInt(“10 Year”) //O/P- 10

Test Case 2 :- parseInt(“Year 10”) //O/P – NaN

Key Capsule 9:-

In JavaScript we can define an array by using bellow syntax;

Var stdArr=[];

Note:- stdArr is a special type of object which store different type of object inside it.

Join Method in Array:-

In JavaScript the join method is used to convert the array into string but we can specify separator inside join method.

For eg:- var arr=[“Ram”,”Hari”,”Madhu”]

arr.join(“*”);

so the o/p Ram * Hari * Madhu.

Key Capsule 10:-

In JavaScript we use a key word called as “use strict”.

This is indicate that we can not use a variable without declaring it. So if we use a variable without declaring it then it’s gives you an error.

Note :- Use strict can be write at the top of the script.

Use strict

a=2+3;

console.log(a) // Error because we did not declare the variable a.

 

Hope above concept helps you in understanding the basic concept; will see more on coming days.

Thanks for reading; have your feedback in comment box if you have any doubt in any test case.

#Share2Know #Learn Basic #JavaScript

 

 

C# 7.0 Features

C# language some Keys to know:

1. In C# language to know the which dot net version you are using at run time you can use “Enviourment.Version”.
You can also find;
Console.WriteLine(Environment.Version);
Console.WriteLine(Environment.OSVersion);
Console.WriteLine(Environment.ProcessorCount);
Console.WriteLine(Environment.MachineName);

2. C# 7.0 Features :-
— 1. Touples:-
— 2. Tuple Deconstruction :- Any object can be deconstructed by defining a Deconstruct method in the class:
for example :-
class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }

public void Deconstruct(out string firstName, out string lastName)
{
firstName = FirstName;
lastName = LastName;
}
}

var person = new Person { FirstName = “John”, LastName = “Smith” };
var (localFirstName, localLastName) = person;

In this case, the (localFirstName, localLastName) = person syntax is invoking Deconstruct on the person.

— An alternative approach for the Person class is to define the Name itself as a Tuple. Consider the following:

Example:- class Person
{
public (string First, string Last) Name { get; }

public Person((string FirstName, string LastName) name)
{
Name = name;
}
}

Then you can instantiate a person like so (where we can take a tuple as an argument):

var person = new Person((“Jane”, “Smith”));

var firstName = person.Name.First; // “Jane”
var lastName = person.Name.Last; // “Smith”

— Touple Intialization :-

You can also arbitrarily create tuples in code:

var name = (“John”, “Smith”);
Console.WriteLine(name.Item1);
// Outputs John

Console.WriteLine(name.Item2);
// Outputs Smith

When creating a tuple, you can assign ad-hoc item names to the members of the tuple:

var name = (first: “John”, middle: “Q”, last: “Smith”);
Console.WriteLine(name.first);
// Outputs John

 

— 3. Out var declaration

The out var declaration is a simple feature to improve readability. It allows a variable to be declared at the same time that is it passed as an out parameter.

A variable declared this way is scoped to the remainder of the body at the point in which it is declared.

In C# 7.0, you can inline the declaration of the variable passed to the out parameter, eliminating the need for a separate variable declaration:-

Example :-

if (int.TryParse(input, out var value))
{
Foo(value); // ok
}
else
{
Foo(value); // value is zero
}

Foo(value); // still ok, the value in scope within the remainder of the body

If some of the parameters that a function returns in out is not needed you can use the discard operator _.

p.GetCoordinates(out var x, out _); // I only care about x

An out var declaration can be used with any existing function which already has out parameters. The function declaration syntax remains the same, and no additional requirements are needed to make the function compatible with an out var declaration. This feature is simply syntactic sugar.

Another feature of out var declaration is that it can be used with anonymous types.
7.0
Example:-
var a = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var groupedByMod2 = a.Select(x => new
{
Source = x,
Mod2 = x % 2
})
.GroupBy(x => x.Mod2)
.ToDictionary(g => g.Key, g => g.ToArray());
if (groupedByMod2.TryGetValue(1, out var oddElements))
{
Console.WriteLine(oddElements.Length);
}

In this code we create a Dictionary with int key and array of anonymous type value. In the previous version of C# it was impossible to use TryGetValue method here since it required you to declare the out variable (which is of anonymous type!). However, with out var we do not need to explicitly specify the type of the out variable.

 

Find live frequency of Character in string using Java Script.

In this blog i am going to show you a simple program where you find frequency of character in a string using JavaScript.

Note:- Before starts this simple demo i believe that you must have basic knowledge on JavaScript.

Let start;

To do this demo first we need to design a simple web page where we have one textbox where we need to enter some text and we find the frequency accordingly.

In this example bellow all the functionality are defined inside JavaScript function called as “GetFrequency()

 

<html>
<head>
<meta name=”viewport” content=”width=device-width” />
<title>TestKey</title>
</head>
<body>

<h2>Get Frequency of Character from a string</h2>

Enter Your Text :

 </body>

</html>

<scripts>

var charkey = “”;
function GetTheKey(e) {
charkey = document.getElementById(“txtData”).value.substring(document.getElementById(“txtData”).value.length – 1);
}
function GetFrequency(e) {
debugger
var count = 1;
var value = document.getElementById(“txtData”).value;
if (e.which <= 90 && e.which >= 48) {
var checkCount = 0;
var keyChar = e.key;
if (value.length > 1) {
for (var i = 0; i < value.length – 1; i++) {
if (keyChar == value[i]) {
count++;
}
else
continue;
}

if (count > 1) {
for (var i = 1; i < count; i++) {
if (i != count) {
if (document.getElementById(keyChar + i) != null) {
var eleData = document.getElementById(keyChar + i).innerHTML.replace(/.$/, count);
document.getElementById(keyChar + i).innerHTML = eleData;
checkCount++;
}
}
}
}
if (checkCount == 0) {

var lable = document.createElement(“lable”);
lable.textContent = “The frequency of character ” + keyChar + ” is ” + count;
lable.id = keyChar + count;
document.getElementById(“result”).appendChild(lable);
var br = document.createElement(“br”);
document.getElementById(“result”).appendChild(br);
}
checkCount = 0;
count = 1;
}
else {
var lable = document.createElement(“lable”);
lable.textContent = “The frequency of character ” + keyChar + ” is ” + 1;
lable.id = keyChar + count;
document.getElementById(“result”).appendChild(lable);
var br = document.createElement(“br”);
document.getElementById(“result”).appendChild(br);
count = 1;
}
}
else if (e.which == 8) {
// if (document.getElementById(“txtData”).selectionStart != 0) {

if (document.getElementById(“result”).lastChild != null) {
var ele = document.getElementById(“result”).lastChild;
document.getElementById(“result”).lastChild.remove();
if (document.getElementById(“result”).lastChild != null) {
var iNum = document.getElementById(charkey + count).innerHTML.substring(document.getElementById(charkey + count).innerHTML.length – 1);
if (parseInt(iNum) > 1) {
var eledata = document.getElementById(charkey + count).innerHTML.replace(/.$/, iNum – 1);
document.getElementById(charkey + count).innerHTML = eledata;
document.getElementById(“result”).appendChild(ele);
}
else {
document.getElementById(“result”).lastChild.remove();
}
}
}
}
//}

}

</scripts>

Note:- Do copy and paste above code and remove the last character ‘s’ from script tag.

Any thing not work for you feel free to drop a comment in the comment box; always happy to listen your feedback.

Happy Coading 🙂

#Share2Know @SURYAN_Mode