예제 #1
0
        /// <summary>
        /// Returns CustomerID by LeadID
        /// </summary>
        /// <param name="LeadID">LeadID</param>
        /// <returns>CustomerID</returns>
        public int GetCustomerID(int LeadID)
        {
            int CustomerID = 0;
            string ProcName = System.Configuration.ConfigurationManager.AppSettings["Customers__GetByLeadID"].ToString();
            string[] ProcParm = new string[] { LeadID.ToString() };

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

            AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");
            result = customsdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                DataTable dt = SDKHelper.GetDataTableFromSdkResult(result.Data.Columns, result.Data.Rows);
                CustomerID = Convert.ToInt32(dt.Rows[0]["CustomerID"]);
            }
            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 CustomerID;
        }
예제 #2
0
        /// <summary>
        /// Get DiaryAppointmets for a User
        /// </summary>
        /// <param name="ID">ClientPersonnelID</param>
        /// <param name="Completed">IsCompleted (true/false)</param>
        /// <returns>true/false</returns>
        public bool GetAppointments(int ID,int Completed)
        {
            bool diaryResult = false;
            IR_Dashboard_SDK.AquariumCustomProcessing.CustomProcessingSoapClient customsdk = new IR_Dashboard_SDK.AquariumCustomProcessing.CustomProcessingSoapClient();

            string ProcName = System.Configuration.ConfigurationManager.AppSettings["GetAllAppointmentsSPName"].ToString();
            string[] ProcParm = new string[] { String.Format("{0:M/d/yyyy HH:mm}", StartDate), String.Format("{0:M/d/yyyy HH:mm}", EndDate), ID.ToString(), Completed.ToString() };

            IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult result = new IR_Dashboard_SDK.AquariumCustomProcessing.ReportResult();
            AquariumCustomProcessing.SessionDetails sd = SDKHelper.GetSessionDetails<AquariumCustomProcessing.SessionDetails>("User");
            result = customsdk.RunCustomProc(sd, ProcName, ProcParm);

            if (result.ResultInfo.ReturnCode == AquariumCustomProcessing.BasicCode.OK)
            {
                Appointments = ToList(result.Data);
                diaryResult = true;
                GetAllUsers();

                if (Appointments.Count > 0)
                {
                    DiaryPriorities[0].GetAllDiaryPriorities();
                }
                else
                {
                    DiaryPriorities = new List<DiaryPriority>();
                    DiaryPriority dp = new DiaryPriority();
                    dp.GetAllDiaryPriorities();
                    DiaryPriorities.Add(dp);
                }

            }
            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 diaryResult;
        }