Ejemplo n.º 1
0
        /// <summary>
        /// Get all pages for a lead type
        /// </summary>
        /// <param name="LeadID">LeadID</param>
        public void GetDiaryDetailFieldPages(int LeadID)
        {
            Lead Leads = new Lead();
            int LeadTypeID = Leads.GetLeadTypeID(LeadID);

            string ProcName = System.Configuration.ConfigurationManager.AppSettings["Get_DetailFieldPageIDsForLeadTypeID"].ToString();
            string[] ProcParm = new string []{ LeadTypeID.ToString(), LeadID.ToString() };

            IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult result = new IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult();

            AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");

            AquariumCustomProcessing.CustomProcessingSoapClient customsdk = new AquariumCustomProcessing.CustomProcessingSoapClient();

            result = customsdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                DiaryDetailFieldPageList = ToPageList(result.Data);
            }
            else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
            {
                throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
            }
        }
        /// <summary>
        /// helper method to get matterID
        /// </summary>
        /// <param name="LeadID">LeadID</param>
        /// <returns>MatterID</returns>
        public static int GetMatterByLeadID(int LeadID)
        {
            try
            {

                int MatterID = 0;

                string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetMatterByLeadID"].ToString();
                string[] ProcParm = new string[1];
                ProcParm[0] = LeadID.ToString();

                IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult result = new IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult();

                AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");

                AquariumCustomProcessing.CustomProcessingSoapClient customsdk = new AquariumCustomProcessing.CustomProcessingSoapClient();

                result = customsdk.RunCustomProc(sd, ProcName, ProcParm);

                if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
                {
                    var resultsList = result.Data.Rows[0].ToList();
                    MatterID = Int32.Parse(resultsList[0].ToString());

                    return MatterID = MatterID > 0 ? MatterID : -1;
                }

                else if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.Failed)
                {
                    throw new System.ApplicationException("Error ID:" + result.ResultInfo.Errors[0].ResultCodeID + ", Description:" + result.ResultInfo.Errors[0].Description);
                }

                return -1;

            }
            catch (Exception ex) { throw ex; }
        }