Esempio n. 1
0
        public CustomerSummary GetCustomerSummaryDetails(int seqPartyId)
        {
            CustomerSummary custSummary = new CustomerSummary();
            try
            {
                object[] parameters = new object[1];
                parameters[0] = seqPartyId;
                DataSet ds = database.ExecuteDataSet("dbp_summary_details", parameters);
                if (ds != null && ds.Tables != null && ds.Tables[0].Rows.Count > 0)
                {
                    custSummary.DecisionMakerName = Convert.ToString(ds.Tables[0].Rows[0]["decision_maker_name"]);
                    custSummary.BillingContactName = Convert.ToString(ds.Tables[0].Rows[0]["billing_contact_name"]);
                    custSummary.SeqPartyId = Convert.ToString(seqPartyId);
                    custSummary.AccMgrName = Convert.ToString(ds.Tables[0].Rows[0]["acc_mgr_name"]);

                    custSummary.AvgMonthlySpend = Convert.ToString(ds.Tables[0].Rows[0]["avg_monthly_spend"]);

                    custSummary.CreditStatusCode = Convert.ToString(ds.Tables[0].Rows[0]["seq_credit_status_code"]);

                    custSummary.CurrPeriod = Convert.ToString(ds.Tables[0].Rows[0]["current_period"]);

                    custSummary.CustomerName = Convert.ToString(ds.Tables[0].Rows[0]["party_name"]);

                    custSummary.CustomerNo = Convert.ToString(ds.Tables[0].Rows[0]["party_code"]);

                    custSummary.DistrictCode = Convert.ToString(ds.Tables[0].Rows[0]["district_code"]);
                    custSummary.Fax = Convert.ToString(ds.Tables[0].Rows[0]["fax_no"]);
                    custSummary.Phone = Convert.ToString(ds.Tables[0].Rows[0]["phone_no"]);
                    custSummary.PostalAddr1 = Convert.ToString(ds.Tables[0].Rows[0]["postal_addr_1"]);
                    custSummary.PostalAddr2 = Convert.ToString(ds.Tables[0].Rows[0]["postal_addr_2"]);
                    custSummary.PostalAddr3 = Convert.ToString(ds.Tables[0].Rows[0]["postal_addr_3"]);
                    custSummary.PostalPostCode = Convert.ToString(ds.Tables[0].Rows[0]["postal_post_code"]);
                    custSummary.StreetAddr1 = Convert.ToString(ds.Tables[0].Rows[0]["street_addr_1"]);
                    custSummary.StreetAddr2 = Convert.ToString(ds.Tables[0].Rows[0]["street_addr_2"]);
                    custSummary.StreetAddr3 = Convert.ToString(ds.Tables[0].Rows[0]["street_addr_3"]);
                    custSummary.StreetAddrNo = Convert.ToString(ds.Tables[0].Rows[0]["street_addr_no"]);
                    custSummary.StreetPostCode = Convert.ToString(ds.Tables[0].Rows[0]["street_post_code"]);

                    custSummary.TotalAmt = Convert.ToString(ds.Tables[0].Rows[0]["total_amount"]);

                    custSummary.OverdueAmt = Convert.ToString(ds.Tables[0].Rows[0]["overdue_amount"]);

                    custSummary.CurrAmt = Convert.ToString(ds.Tables[0].Rows[0]["current_amount"]);

                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

            return custSummary;
            // exec dbo.dbp_summary_details N'79377'
        }
Esempio n. 2
0
        public CustomerSummary GetCustomerSummaryDetails(int seqPartyId)
        {
            CustomerSummary custSumm = new CustomerSummary();
            try
            {
                custSumm = _dbManager.GetCustomerSummaryDetails(seqPartyId);
            }
            catch (Exception exceptionToHandle)
            {
                ExceptionPolicy.HandleException(exceptionToHandle, "Policy");
                FaultDetail faultDetail = new FaultDetail
                {
                    Type = exceptionToHandle.Message,
                    ErrorCode = 63873928
                };     //+ throw     
                throw new FaultException<FaultDetail>(faultDetail, exceptionToHandle.Message);
            }

            return custSumm;
        }