Пример #1
0
        /*
         * Used to populate Notes and VMFlagTypes of Customer Info Details
         * LNotes - List object of type CustomerInfoNotes to be populated
         * LVMFlagTypes - List object of type CustomerInfoVMFlagType to be populated
         */
        private void Notes_VMFlagTypes(CustomerInfoDetail custDetail)
        {
            try
            {
                using (OracleConnection con = new OracleConnection(CRMDB))
                {

                    DataSet ds = new DataSet();

                    // Initialize Command and DataAdapter.
                    OracleCommand cmd;
                    OracleDataAdapter da;

                    // Open Connection and call stored procedure.
                    con.Open();
                    cmd = new OracleCommand("SYSADM.GET_360_CUSTOMER_INFO_WIDGET", con);
                    cmd.CommandType = CommandType.StoredProcedure;

                    // Stored procedure parameters.
                    cmd.Parameters.Add("Acct_No", OracleType.VarChar, 256).Value = custDetail.id;
                    cmd.Parameters["Acct_No"].Direction = ParameterDirection.Input;
                    cmd.Parameters.Add("NOTEORESULTS", OracleType.Cursor).Direction = ParameterDirection.Output;

                    // Fill Dataset using DataAdapter
                    da = new OracleDataAdapter(cmd);
                    da.Fill(ds);

                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        CustomerInfoNote note = new CustomerInfoNote();
                        note.Note_Date = row["NOTE_DATE"].ToString();
                        note.Note_User = row["NOTE_USER"].ToString();
                        note.Note_Description = row["NOTE_DESCRIPTION"].ToString();
                        custDetail.Notes.Add(note);
                    }

                    // Explicitly close connection
                    con.Close();
                }
            }
            catch (Exception){
                throw;
            }
        }
Пример #2
0
        /*
         * Used to populate Payments and CPEs of Customer Info Details
         * LPayments - List object of type CustomerInfoPayment to be populated
         * LCPEs - List object of type CustomerInfoCPE to be populated
         */
        private void Payments_CPEs(CustomerInfoDetail custDetail)
        {
            try
            {
                using (OracleConnection con = new OracleConnection(KENANDB))
                {
                    DataSet ds = new DataSet();

                    // Initialize Command and DataAdapter.
                    OracleCommand cmd;
                    OracleDataAdapter da;

                    // Open Connection and call stored procedure.
                    con.Open();
                    cmd = new OracleCommand("ARBOR.HT_ONE_PKG.GET_PAYMENT_AND_CPE_DETAILS", con);
                    cmd.CommandType = CommandType.StoredProcedure;

                    // Stored procedure parameters.
                    cmd.Parameters.Add("iAccountNo", OracleType.VarChar, 256).Value = custDetail.id;
                    cmd.Parameters["iAccountNo"].Direction = ParameterDirection.Input;
                    cmd.Parameters.Add("oPaymentDetails", OracleType.Cursor).Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("oCPEDetails", OracleType.Cursor).Direction = ParameterDirection.Output;

                    // Fill Dataset using DataAdapter
                    da = new OracleDataAdapter(cmd);
                    da.Fill(ds);

                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        CustomerInfoPayment payment = new CustomerInfoPayment();
                        payment.Amount = row["AMOUNT"].ToString();
                        payment.PostedDate = row["POSTED_DATE"].ToString();
                        custDetail.Payments.Add(payment);
                    }
                    foreach (DataRow row in ds.Tables[1].Rows)
                    {
                        CustomerInfoCPE cpe = new CustomerInfoCPE();
                        cpe.SID = row["SID"].ToString();
                        cpe.Contract = row["CPE_CONTRACT"].ToString();
                        cpe.Contract_End_Date = row["CPE_CONTRACT_END"].ToString();
                        custDetail.CPEs.Add(cpe);
                    }

                    // Explicitly close connection
                    con.Close();
                }
            }
            catch (Exception){
                throw;
            }
        }
Пример #3
0
        /*
         * This method is used to call for Customer Information Detail
         * id - PK for Customer Info
         */
        private CustomerInfoDetail CustomerInfoDetail(string id, string accountName, string btn, string accountType)
        {
            try
            {
                CustomerInfoDetail custInfoDetail = new CustomerInfoDetail();
                custInfoDetail.id = id; //Not needed. Added for tracking purposes
                custInfoDetail.AccountName = accountName;
                custInfoDetail.Btn = btn;
                custInfoDetail.AccountType = accountType;

                // Populate Notes and VMFlagTypes of Customer Info Details
                // from CRM
                Notes_VMFlagTypes(custInfoDetail);

                // Populate Payments and CPEs of Customer Info Details
                // from Kenan
                Payments_CPEs(custInfoDetail);

                return custInfoDetail;
            }
            catch (Exception)
            {
                throw;
            }
        }