Пример #1
0
        public int AddOpportunity(OpportunityDto opportunityDto)
        {
            bool           manageOpportunitiesInCRM = false;
            ClientLoginDto dto = new ClientLoginDL().ManageOpportunitiesInCRM(opportunityDto.ClientID);

            if (dto.ManageOppysInCRM)
            {
                manageOpportunitiesInCRM = dto.ManageOppysInCRM;
            }
            return(new OpportunityDL().AddOpportunity(opportunityDto, manageOpportunitiesInCRM));
        }
Пример #2
0
        public Response AddSdaCloudOpportunity(List <OpportunityDto> opportunities)
        {
            Response      response = new Response();
            OpportunityDL ydl      = new OpportunityDL();
            ClientLoginDL ndl      = new ClientLoginDL();

            foreach (OpportunityDto dto in opportunities)
            {
                string str;
                try
                {
                    bool           manageOpportunitiesInCRM = false;
                    ClientLoginDto dto2 = ndl.ManageOpportunitiesInCRM(dto.ClientID);
                    if (dto2.ManageOppysInCRM)
                    {
                        manageOpportunitiesInCRM = dto2.ManageOppysInCRM;
                    }
                    int oppID = ydl.AddOpportunity(dto, manageOpportunitiesInCRM);
                    if (oppID < 0)
                    {
                        str = "ADD-SDACloud Duplicated record with Quote Id Main Site:" + dto.QuoteIDMainSite + ", could not be added";
                        if (this._applicationLogDL.AddErrorMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto)))
                        {
                            response.Results.Add(str);
                        }
                    }
                    else if (oppID <= 0)
                    {
                        str = "ADD-SDACloud CRM Opportunity Id:" + dto.CRMOppID + ", could not be added";
                        if (this._applicationLogDL.AddErrorMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto)))
                        {
                            response.Results.Add(str);
                        }
                        else
                        {
                            response.Errors.Add(str);
                        }
                    }
                    else if (!manageOpportunitiesInCRM && string.IsNullOrEmpty(dto.CRMOppID))
                    {
                        string[] strArray = new string[] { "ADD-SDACloud CRM Opportunity Id:", ydl.GetNonDeletedOpportunityByClientIDAndOppID(dto.ClientID, oppID).CRMOppID, ":Quote Id Main Site:", dto.QuoteIDMainSite, ", has been successfully added" };
                        str = string.Concat(strArray);
                        response.Results.Add(str);
                        this._applicationLogDL.AddTransactionMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto));
                    }
                    else if (!string.IsNullOrEmpty(dto.CRMOppID))
                    {
                        str = "ADD-SDACloud CRM Opportunity Id:" + dto.CRMOppID + ", has been successfully added";
                        response.Results.Add(str);
                        this._applicationLogDL.AddTransactionMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto));
                    }
                    else
                    {
                        str = "ADD-SDACloud Opportunity with Quote Id Main Site:" + dto.QuoteIDMainSite + ", has been successfully added";
                        response.Results.Add(str);
                        this._applicationLogDL.AddTransactionMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto));
                    }
                }
                catch (Exception exception)
                {
                    string[] strArray2 = new string[] { "SDACloud CRM Opportunity Id:", dto.CRMOppID, ":Quote Id Main Site:", dto.QuoteIDMainSite, ",", exception.Message, (exception.InnerException != null) ? exception.InnerException.Message : "" };
                    str = string.Concat(strArray2);
                    if (this._applicationLogDL.AddErrorMessage(dto.ClientID, str, this._utilityBl.ConvertRecordToString(dto)))
                    {
                        response.Results.Add(str);
                        continue;
                    }
                    response.Errors.Add(str);
                }
            }
            return(response);
        }
Пример #3
0
        public ClientLoginDto GetClientSyncValues(int clientID)
        {
            var clientLoginDl = new ClientLoginDL();

            return(clientLoginDl.GetClientSyncValues(clientID));
        }
Пример #4
0
        public string GetCRMXrefCRMSystem(int clientID)
        {
            var clientLoginDl = new ClientLoginDL();

            return(clientLoginDl.GetCRMXrefCRMSystem(clientID));
        }
Пример #5
0
        /// <summary>
        /// Gets the CRM xref upd dt.
        /// </summary>
        /// <param name="clientID">The client identifier.</param>
        /// <returns></returns>
        public DateTime GetCRMXrefUpdDT(int clientID)
        {
            var clientLoginDl = new ClientLoginDL();

            return(clientLoginDl.GetCRMXrefUpdDT(clientID));
        }
Пример #6
0
        /// <summary>
        /// Manages the opportunities in CRM.
        /// </summary>
        /// <param name="clientID">The client identifier.</param>
        /// <returns></returns>
        public ClientLoginDto ManageOpportunitiesInCRM(int clientID)
        {
            var clientLoginDl = new ClientLoginDL();

            return(clientLoginDl.ManageOpportunitiesInCRM(clientID));
        }
Пример #7
0
        /// <summary>
        /// Validates the client login.
        /// </summary>
        /// <param name="clientLogin">The client login.</param>
        /// <returns></returns>
        public bool ValidateClientLogin(ClientLoginDto clientLogin)
        {
            var clientLoginDl = new ClientLoginDL();

            return(clientLoginDl.ValidateClientLogin(clientLogin));
        }