Ejemplo n.º 1
0
 public Int64 getHeaderID()
 {
     Database db = new Database();
     SqlParameter[] param = { db.MakeOutParam("@HeaderID", SqlDbType.BigInt, 0) };
     try
     {
         db.execNonQuery("EDI_MsgHeaderID_Get", param);
         Int64 idNum = Convert.ToInt64(param[0].Value.ToString());
         db.Close();
         return idNum;
     }
     catch (Exception ex)
     {
         if (db.IsOpen() == "Open") db.Close();
         log.writeToAppLog("ERROR", "Unable to get the headerID.\r\n" + ex.ToString(), "", "");
         throw new Exception(ex.ToString());
     }
 }
Ejemplo n.º 2
0
        public int insertNewTransaction_TPABroker(LinkedList<TransactionHeader.TPABroker> TPABrokers, Int64 msg_transID)
        {
            Database db = new Database();
            foreach (TransactionHeader.TPABroker TPABroker in TPABrokers)
            {

                SqlParameter[] param =
                {
                db.MakeInParam("@TransactionID",SqlDbType.BigInt,0,msg_transID),
                db.MakeInParam("@EntityIdentityCode",SqlDbType.VarChar,3,TPABroker.EntityIdentityCode),
                db.MakeInParam("@Name_TPA_Broker",SqlDbType.VarChar,60,TPABroker.Name_TPA_Broker),
                db.MakeInParam("@IdentificationCodeQualifier_TPA_Broker",SqlDbType.VarChar,2,TPABroker.IdentificationCodeQualifier_TPA_Broker),
                db.MakeInParam("@IdentificationCode_TPA_Broker",SqlDbType.VarChar,80,TPABroker.IdentificationCode_TPA_Broker)
                };
                try
                {
                    db.execNonQuery("EDI_TransactionHeader_TPABroker_Add", param);
                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Transaction TPABroker.\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 3
0
 public int insertNewTransaction_Sets(LinkedList<TransactionHeader.TransactionSets> trans_sets, Int64 msg_transID)
 {
     Database db = new Database();
     foreach (TransactionHeader.TransactionSets trans_set in trans_sets)
     {
         SqlParameter[] param =
         {
             db.MakeInParam("@TransactionID",SqlDbType.BigInt,0,msg_transID),
             db.MakeInParam("@QuantityQualifier",SqlDbType.VarChar,2,trans_set.QuantityQualifier),
             db.MakeInParam("@Quantity",SqlDbType.VarChar,15,trans_set.Quantity)
         };
         try
         {
             db.execNonQuery("EDI_TransactionHeader_TransactionSets_Add", param);
         }
         catch (Exception ex)
         {
             if (db.IsOpen() == "Open") db.Close();
             log.writeToAppLog("ERROR", "Unable to insert the message TransactionSets.\r\n" + ex.ToString(), "", "");
             throw new Exception(ex.ToString());
         }
     }
     if (db.IsOpen() == "Open") db.Close();
     return 0;
 }
Ejemplo n.º 4
0
        public int insertNewTransaction_FileDate(LinkedList<TransactionHeader.FileDate> trans_FileDates, Int64 msg_transID)
        {
            Database db = new Database();
            foreach (TransactionHeader.FileDate trans_FileDate in trans_FileDates)
            {
                SqlParameter[] param =
                {
                    db.MakeInParam("@TransactionID",SqlDbType.BigInt,0,msg_transID),
                    db.MakeInParam("@Date_TimeQualifier",SqlDbType.VarChar,3,trans_FileDate.Date_TimeQualifier),
                    db.MakeInParam("@DateTimePeriodFormatQualifier",SqlDbType.VarChar,3,trans_FileDate.DateTimePeriodFormatQualifier),
                    db.MakeInParam("@DateTimePeriod",SqlDbType.VarChar,35,trans_FileDate.DateTimePeriod)

                };
                try
                {
                    db.execNonQuery("EDI_TransactionHeader_FileDate_Add", param);

                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message transactionHeader_FileDate.\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 5
0
 public int insertNewTransactionTrailer(TransactionTrailer trailer, Int64 msg_transID)
 {
     Database db = new Database();
     SqlParameter[] param =
         {
          db.MakeInParam("@TransactionID",SqlDbType.BigInt,0,msg_transID),
          db.MakeInParam("@NumberOfIncludedSegments",SqlDbType.VarChar,1,trailer.NumberOfIncludedSegments),
          db.MakeInParam("@TransactionSetControlNumber",SqlDbType.VarChar,9,trailer.TransactionSetControlNumber)
         };
     try
     {
         db.execNonQuery("EDI_TransactionTrailer_Add", param);
         db.Close();
         return 0;
     }
     catch (Exception ex)
     {
         if (db.IsOpen() == "Open") db.Close();
         log.writeToAppLog("ERROR", "Unable to insert the message TransactionTrailer .\r\n" + ex.ToString(), "", "");
         throw new Exception(ex.ToString());
     }
 }
Ejemplo n.º 6
0
        public int insertNewTransaction(TransactionHeader trans_header)
        {
            Database db = new Database();
            SqlParameter[] param =
                {
                    db.MakeInParam("@HeaderID",SqlDbType.BigInt,0,trans_header.HeaderID),
                    db.MakeInParam("@TransactionSetIdentifier",SqlDbType.VarChar,3,trans_header.TransactionSetIdentifier),
                    db.MakeInParam("@TranscationSetControlNumber",SqlDbType.VarChar,9,trans_header.TranscationSetControlNumber),
                    db.MakeInParam("@ImplementationConventionReference",SqlDbType.VarChar,35,trans_header.ImplementationConventionReference),
                    db.MakeInParam("@TransactionSetPurposeCode",SqlDbType.VarChar,2,trans_header.TransactionSetPurposeCode),
                    db.MakeInParam("@ReferenceIdentification_BS",SqlDbType.VarChar,30,trans_header.ReferenceIdentification_BS),
                    db.MakeInParam("@Date",SqlDbType.VarChar,8,trans_header.Date),
                    db.MakeInParam("@Time",SqlDbType.VarChar,8,trans_header.Time),
                    db.MakeInParam("@TimeCode",SqlDbType.VarChar,2,trans_header.TimeCode),
                    db.MakeInParam("@ActionCode",SqlDbType.VarChar,2,trans_header.ActionCode),
                    db.MakeInParam("@ReferenceIdentificationQualifier",SqlDbType.VarChar,3,trans_header.ReferenceIdentificationQualifier),
                    db.MakeInParam("@ReferenceIdentification",SqlDbType.VarChar,50,trans_header.ReferenceIdentification),
                    db.MakeInParam("@EntityIdentifierCode_Sponsor",SqlDbType.VarChar,3,trans_header.EntityIdentifierCode_Sponsor),
                    db.MakeInParam("@Name_Sponsor",SqlDbType.VarChar,60,trans_header.Name_Sponsor),
                    db.MakeInParam("@IdentificationCodeQualifier_Sponsor",SqlDbType.VarChar,2,trans_header.IdentificationCodeQualifier_Sponsor),
                    db.MakeInParam("@IdentificationCode_Sponsor",SqlDbType.VarChar,80,trans_header.IdentificationCode_Sponsor),
                    db.MakeInParam("@EntityIdentifierCode_Payer",SqlDbType.VarChar,3,trans_header.EntityIdentifierCode_Payer),
                    db.MakeInParam("@Name_Payer",SqlDbType.VarChar,60,trans_header.Name_Payer),
                    db.MakeInParam("@IdentificationCodeQualifier_Payer",SqlDbType.VarChar,2,trans_header.IdentificationCodeQualifier_Payer),
                    db.MakeInParam("@IdentificationCode_Payer",SqlDbType.VarChar,80,trans_header.IdentificationCode_Payer)
                };
            try
            {

                db.execNonQuery("EDI_TransactionHeader_Add", param);
                db.Close();
                return 0;
            }
            catch (Exception ex)
            {
                if (db.IsOpen() == "Open") db.Close();
                log.writeToAppLog("ERROR", "Unable to insert the message transaction.\r\n" + ex.ToString(), "", "");
                throw new Exception(ex.ToString());
            }
        }
Ejemplo n.º 7
0
        public int insertNewMessageTrailer(MsgTrailer msg_trailer,Int64 msg_HeaderID)
        {
            Database db = new Database();
            SqlParameter[] param =
                {
                    db.MakeInParam("@refHeaderID",SqlDbType.BigInt,0,msg_HeaderID),
                    db.MakeInParam("@FunctionalGroupHeader_trailer",SqlDbType.VarChar,10,msg_trailer.FunctionalGroupHeader_trailer),
                    db.MakeInParam("@GroupControlNumber_trailer",SqlDbType.VarChar,9,msg_trailer.GroupControlNumber_trailer),
                    db.MakeInParam("@InterchangeControlTrailer",SqlDbType.VarChar,5,msg_trailer.InterchangeControlTrailer),
                    db.MakeInParam("@InterchangeControlNumber_trailer",SqlDbType.VarChar,9,msg_trailer.InterchangeControlNumber_trailer)

                };
            try
            {
                db.execNonQuery("EDI_MsgTrailer_Add", param);
                db.Close();
                return 0;
            }
            catch (Exception ex)
            {
                if (db.IsOpen() == "Open") db.Close();
                log.writeToAppLog("ERROR", "Unable to insert the message trailer.\r\n" + ex.ToString(), "", "");
                throw new Exception(ex.ToString());
            }
        }
Ejemplo n.º 8
0
        public int insertNewMember_Reports(LinkedList<Member.MemberReport> reports, Int64 MemberID)
        {
            Database db = new Database();
            foreach(EDIModel.Member.MemberReport report in reports)
            {

                SqlParameter[] param =
                {
                 db.MakeInParam("@MemberID",SqlDbType.BigInt,0,MemberID),
                 db.MakeInParam("@AssignedNumber",SqlDbType.VarChar,6,report.AssignedNumber),
                 db.MakeInParam("@EntityIdentifierCode",SqlDbType.VarChar,3,report.EntityIdentifierCode),
                 db.MakeInParam("@Name",SqlDbType.VarChar,60,report.Name),
                 db.MakeInParam("@ReferenceIdentificationQualifier",SqlDbType.VarChar,3,report.ReferenceIdentificationQualifier),
                 db.MakeInParam("@ReferenceIdentification",SqlDbType.VarChar,50,report.ReferenceIdentification)
                };
                try
                {
                    db.execNonQuery("EDI_Member_Report_Add", param);
                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Member Report .\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 9
0
        //return the identity of the row.
        public int InsertNewMessageHeader(MsgHeader msg_header)
        {
            Database db = new Database();
            SqlParameter[] param ={
                    db.MakeInParam("@InterchangeControlHeader",SqlDbType.VarChar,2,msg_header.InterchangeControlHeader),
                    db.MakeInParam("@AuthorizationInformation",SqlDbType.VarChar,10,msg_header.AuthorizationInformation),
                    db.MakeInParam("@SecurityInformationQualifier",SqlDbType.VarChar,2,msg_header.SecurityInformationQualifier),
                    db.MakeInParam("@SecurityInformation",SqlDbType.VarChar,10,msg_header.SecurityInformation),
                    db.MakeInParam("@InterchangeIDQualifier_1",SqlDbType.VarChar,2,msg_header.InterchangeIDQualifier_1),
                    db.MakeInParam("@InterchangeSenderID",SqlDbType.VarChar,15,msg_header.InterchangeSenderID),
                    db.MakeInParam("@InterchangeIDQualifier_2",SqlDbType.VarChar,2,msg_header.InterchangeIDQualifier_2),
                    db.MakeInParam("@InterchangeReceiverID",SqlDbType.VarChar,15,msg_header.InterchangeReceiverID),
                    db.MakeInParam("@IntegerchangeDate",SqlDbType.VarChar,6,msg_header.IntegerchangeDate),
                    db.MakeInParam("@IntegerchangeTime",SqlDbType.VarChar,4,msg_header.IntegerchangeTime),
                    db.MakeInParam("@RepetitionSeperator",SqlDbType.VarChar,1,msg_header.RepetitionSeperator),
                    db.MakeInParam("@InterchangeControlVersionNumber",SqlDbType.VarChar,5,msg_header.InterchangeControlVersionNumber),
                    db.MakeInParam("@InterchangeControlNumber_header",SqlDbType.VarChar,9,msg_header.InterchangeControlNumber_header),
                    db.MakeInParam("@AcknowledgementRequest",SqlDbType.VarChar,1,msg_header.AcknowledgementRequest),
                    db.MakeInParam("@UsageIdentifier",SqlDbType.VarChar,1,msg_header.UsageIdentifier),
                    db.MakeInParam("@ComponentElementSeparator",SqlDbType.VarChar,1,msg_header.ComponentElementSeparator),
                    db.MakeInParam("@FunctionalGroupHeader_header",SqlDbType.VarChar,2,msg_header.FunctionalGroupHeader_header),
                    db.MakeInParam("@ApplicationSendersCode",SqlDbType.VarChar,15,msg_header.ApplicationSendersCode),
                    db.MakeInParam("@ApplicationReceiversCode",SqlDbType.VarChar,15,msg_header.ApplicationReceiversCode),
                    db.MakeInParam("@Date",SqlDbType.VarChar,8,msg_header.Date),
                    db.MakeInParam("@Time",SqlDbType.VarChar,8,msg_header.Time),
                    db.MakeInParam("@GroupControlNumber_header",SqlDbType.VarChar,9,msg_header.GroupControlNumber_header),
                    db.MakeInParam("@ResponsibleAgencyCode",SqlDbType.VarChar,2,msg_header.ResponsibleAgencyCode),
                    db.MakeInParam("@IndustryIndentifierCode",SqlDbType.VarChar,12,msg_header.IndustryIndentifierCode)
                    //db.MakeInParam("@FunctionalGroupHeader_trailer",SqlDbType.VarChar,10,msg_trailer.FunctionalGroupHeader_trailer),
                    //db.MakeInParam("@GroupControlNumber_trailer",SqlDbType.VarChar,9,msg_trailer.GroupControlNumber_trailer),
                    //db.MakeInParam("@InterchangeControlTrailer",SqlDbType.VarChar,5,msg_trailer.InterchangeControlTrailer),
                    //db.MakeInParam("@InterchangeControlNumber_trailer",SqlDbType.VarChar,9,msg_trailer.InterchangeControlNumber_trailer)
                };
            try
            {

                db.execNonQuery("EDI_MsgHeader_Add", param);
                db.Close();
                return 0;
            }
            catch (Exception ex)
            {
                if (db.IsOpen() == "Open") db.Close();
                log.writeToAppLog("ERROR", "Unable to insert the message header.\r\n" + ex.ToString(), "", "");
                throw new Exception(ex.ToString());
            }
        }
Ejemplo n.º 10
0
        public int insertNewMember_HealthCoverage_PolicyNum(LinkedList<Member.HealthPolicyNum> policyNums, Int64 healthCoverageID)
        {
            Database db = new Database();
            foreach (EDIModel.Member.HealthPolicyNum policy in policyNums)
            {

                SqlParameter[] param =
                {
                 db.MakeInParam("@HealthCoverageID",SqlDbType.BigInt,0,healthCoverageID),
                 db.MakeInParam("@ReferenceIdentificationQualifier",SqlDbType.VarChar,3,policy.ReferenceIdentificationQualifier),
                 db.MakeInParam("@ReferenceIdentification",SqlDbType.VarChar,50,policy.ReferenceIdentification)
                };
                try
                {
                    db.execNonQuery("EDI_Member_HealthCoverage_PolicyNum_Add", param);
                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Member Health Coverage Policy number .\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 11
0
        public int insertNewMember_Identification(Member member, Int64 MemberID)
        {
            Database db = new Database();
            foreach (EDIModel.Member.MemberIdentification Identification in member.MemberIdentificationNumber)
            {

                SqlParameter[] param =
                {
                    db.MakeInParam("@MemberID",SqlDbType.BigInt,0,MemberID),
                   db.MakeInParam("@MemberIdentificationNumber",SqlDbType.VarChar,3,Identification.MemberIdentificationNumber),
                   db.MakeInParam("@ReferenceIdentification",SqlDbType.VarChar,50,Identification.ReferenceIdentification)
                };
                try
                {
                    db.execNonQuery("EDI_Member_Identification_Add", param);
                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Member_Identification.\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }

            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 12
0
        public int insertNewMember_HealthCoverage_Dates(LinkedList<Member.HealthCoverage_Dates> healthDate, Int64 healthCoverageID)
        {
            Database db = new Database();
              foreach (EDIModel.Member.HealthCoverage_Dates date in healthDate)
            {

                SqlParameter[] param =
                {
                 db.MakeInParam("@HealthCoverageID",SqlDbType.BigInt,0,healthCoverageID),
                 db.MakeInParam("@Date_Time_Qualifier",SqlDbType.VarChar,3,date.Date_Time_Qualifier),
                 db.MakeInParam("@Date_Time_FormatQualifier_HCD",SqlDbType.VarChar,3,date.Date_Time_FormatQualifier_HCD),
                 db.MakeInParam("@Date_Time_Period_HCD",SqlDbType.VarChar,8,date.Date_Time_Period_HCD)
                };
                try
                {
                    db.execNonQuery("EDI_Member_HealthCoverage_Dates_Add", param);
                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Member Health Coverage Dates.\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
              if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 13
0
 public int insertNewMember_HealthCoverage(Member member, Int64 MemberID)
 {
     foreach (EDIModel.Member.HealthCoverage health in member.HealthCoverages)
     {
         Database db = new Database();
         SqlParameter[] param =
         {
             db.MakeInParam("@MemberID",SqlDbType.BigInt,0,MemberID),
             db.MakeInParam("@MaintenanceTypeCode",SqlDbType.VarChar,3,health.MaintenanceTypeCode),
             db.MakeInParam("@InsuranceLineCode",SqlDbType.VarChar,3,health.InsuranceLineCode),
             db.MakeInParam("@PlanCoverageDescription",SqlDbType.VarChar,50,health.PlanCoverageDescription)
         };
         try
         {
             db.execNonQuery("EDI_Member_HealthCoverage_Add", param);
             db.Close();
             Int64 healthCoverageID=GetHealthCoverageID();
             insertNewMember_HealthCoverage_Dates(health.HealthCoverageDates, healthCoverageID);
             insertNewMember_HealthCoverage_PolicyNum(health.PolicyNumber, healthCoverageID);
             return 0;
         }
         catch (Exception ex)
         {
             if (db.IsOpen() == "Open") db.Close();
             log.writeToAppLog("ERROR", "Unable to insert the message Member Health Coverage.\r\n" + ex.ToString(), "", "");
             throw new Exception(ex.ToString());
         }
     }
     return 0;
 }
Ejemplo n.º 14
0
        public int insertNewMember_Dates(Member member, Int64 MemberID)
        {
            Database db = new Database();
            foreach (EDIModel.Member.MemberDate date in member.MemberLevelDate)
            {
                SqlParameter[] param =
                {
                    db.MakeInParam("@MemberID",SqlDbType.BigInt,0,MemberID),
                    db.MakeInParam("@Date_Time_Qualifier",SqlDbType.VarChar,3,date.Date_Time_Qualifier),
                    db.MakeInParam("@Date_Time_Format",SqlDbType.VarChar,3,date.Date_Time_Format),
                    db.MakeInParam("@Date_Time_Period",SqlDbType.VarChar,8,date.Date_Time_Period)
                };
                try
                {
                    db.execNonQuery("EDI_Member_Dates_Add", param);

                }
                catch (Exception ex)
                {
                    if (db.IsOpen() == "Open") db.Close();
                    log.writeToAppLog("ERROR", "Unable to insert the message Member_Dates.\r\n" + ex.ToString(), "", "");
                    throw new Exception(ex.ToString());
                }
            }
            if (db.IsOpen() == "Open") db.Close();
            return 0;
        }
Ejemplo n.º 15
0
 public int insertNewMember(Member member, Int64 msg_transID)
 {
     Database db = new Database();
     SqlParameter[] param =
     {
         db.MakeInParam("@TransactionID",SqlDbType.BigInt,0,msg_transID),
         db.MakeInParam("@Yes_No_Condition",SqlDbType.VarChar,1,member.@Yes_No_Condition),
         db.MakeInParam("@IndividualRelationshipCode",SqlDbType.VarChar,2,member.IndividualRelationshipCode),
         db.MakeInParam("@MaintenanceTypeCode_MLD",SqlDbType.VarChar,3,member.MaintenanceTypeCode_MLD),
         db.MakeInParam("@MaintenanceReasonCode",SqlDbType.VarChar,3,member.MaintenanceReasonCode),
         db.MakeInParam("@BenefitStatusCode",SqlDbType.VarChar,1,member.BenefitStatusCode),
         db.MakeInParam("@EmploymentStatusCode",SqlDbType.VarChar,2,member.EmploymentStatusCode),
         db.MakeInParam("@SubscriberNumber",SqlDbType.VarChar,3,member.SubscriberNumber),
         db.MakeInParam("@ReferenceNumber",SqlDbType.VarChar,50,member.ReferenceNumber),
         db.MakeInParam("@MemberPolicyNumber",SqlDbType.VarChar,3,member.MemberPolicyNumber),
         db.MakeInParam("@ReferenceIdentification_MPM",SqlDbType.VarChar,50,member.ReferenceIdentification_MPM),
         db.MakeInParam("@EntityIdentifierCode_Member",SqlDbType.VarChar,3,member.EntityIdentifierCode_Member),
         db.MakeInParam("@EntityTypeQualifier_Member",SqlDbType.VarChar,1,member.EntityTypeQualifier_Member),
         db.MakeInParam("@NameLast",SqlDbType.VarChar,60,member.NameLast),
         db.MakeInParam("@NameFirst",SqlDbType.VarChar,35,member.NameFirst),
         db.MakeInParam("@NameMiddle",SqlDbType.VarChar,25,member.NameMiddle),
          db.MakeInParam("@IdentificationCodeQualifier",SqlDbType.VarChar,2,member.IdentificationCodeQualifier),
         db.MakeInParam("@IdentificationCode",SqlDbType.VarChar,80,member.IdentificationCode),
         db.MakeInParam("@ContactFunctionCode",SqlDbType.VarChar,2,member.ContactFunctionCode),
         db.MakeInParam("@CommunicationNumberQualifier_1",SqlDbType.VarChar,2,member.CommunicationNumberQualifier_1),
         db.MakeInParam("@CommunicationNumber_1",SqlDbType.VarChar,256,member.CommunicationNumber_1),
         db.MakeInParam("@CommunicationNumberQualifier_2",SqlDbType.VarChar,2,member.CommunicationNumberQualifier_2),
         db.MakeInParam("@CommunicationNumber_2",SqlDbType.VarChar,256,member.CommunicationNumber_2),
         db.MakeInParam("@CommunicationNumberQualifier_3",SqlDbType.VarChar,2,member.CommunicationNumberQualifier_3),
         db.MakeInParam("@CommunicationNumber_3",SqlDbType.VarChar,256,member.CommunicationNumber_3),
         db.MakeInParam("@AddressLine_1",SqlDbType.VarChar,55,member.AddressLine_1),
         db.MakeInParam("@AddressLine_2",SqlDbType.VarChar,55,member.AddressLine_2),
         db.MakeInParam("@City",SqlDbType.VarChar,30,member.City),
         db.MakeInParam("@State",SqlDbType.VarChar,2,member.State),
         db.MakeInParam("@PostalCode",SqlDbType.VarChar,13,member.PostalCode),
         db.MakeInParam("@LocationQualifier",SqlDbType.VarChar,2,member.LocationQualifier),
         db.MakeInParam("@LocationIdentifier",SqlDbType.VarChar,30,member.LocationIdentifier),
         db.MakeInParam("@Date_Time_FormatQualifier_MD",SqlDbType.VarChar,3,member.Date_Time_FormatQualifier_MD),
         db.MakeInParam("@Date_Time_Period_MD",SqlDbType.VarChar,8,member.Date_Time_Period_MD),
         db.MakeInParam("@GenderCode",SqlDbType.VarChar,1,member.GenderCode),
         db.MakeInParam("@MaritalStatusCode",SqlDbType.VarChar,1,member.MaritalStatusCode),
         db.MakeInParam("@CompositeRaceOrEthnicityInformation",SqlDbType.VarChar,10,member.CompositeRaceOrEthnicityInformation),
         db.MakeInParam("@HealthRelatedCode",SqlDbType.VarChar,1,member.HealthRelatedCode),
         db.MakeInParam("@LoopIdentifierCode",SqlDbType.VarChar,4,member.LoopIdentifierCode)
     };
     try
     {
         db.execNonQuery("EDI_Member_Add", param);
         db.Close();
         Int64 memberID = GetMemberID();
         insertNewMember_Identification(member, memberID);
         insertNewMember_Dates(member, memberID);
         insertNewMember_HealthCoverage(member, memberID);
         insertNewMember_Reports(member.MemberReportingCategories,memberID);
         return 0;
     }
     catch (Exception ex)
     {
         if (db.IsOpen() == "Open") db.Close();
         log.writeToAppLog("ERROR", "Unable to insert the message member.\r\n" + ex.ToString(), "", "");
         throw new Exception(ex.ToString());
     }
 }
Ejemplo n.º 16
0
 public int insertNewErrorMessage(ErrorMessage msg_error, Int64 MemberID)
 {
     Database db = new Database();
     SqlParameter[] param =
         {
          db.MakeInParam("@MemeberID",SqlDbType.BigInt,0,MemberID),
          db.MakeInParam("@ErrorCode",SqlDbType.VarChar,200,msg_error.ErrCode),
          db.MakeInParam("@ErrorMessage",SqlDbType.VarChar,850,msg_error.ErrDesc)
         };
     try
     {
         db.execNonQuery("EDI_Message_Error_Add", param);
         db.Close();
         return 0;
     }
     catch (Exception ex)
     {
         if (db.IsOpen() == "Open") db.Close();
         log.writeToAppLog("ERROR", "Unable to insert the message error .\r\n" + ex.ToString(), "", "");
         throw new Exception(ex.ToString());
     }
 }