public int ReprocessQualifiedLeadsContingency()
        {
            DepartmentServices _serviceDepartment = new DepartmentServices();
            Bitrix24Services   objService         = new Bitrix24Services();

            try
            {
                foreach (QualifiedLead lead in GetAll())
                {
                    Department itemDepartment = _serviceDepartment.GetDepartmentsById(lead.DepartmentID);
                    string     webHookPath    = itemDepartment.WebHook.WebhookPath;

                    objService.CreateQualifiedLead(lead, webHookPath, "*****@*****.**", "", true);
                }
                return(1);
            }
            catch
            {
                return(0);
            }
        }
Exemple #2
0
        public bool InsertQualifiedLeadtoBitrixQueue(QualifiedLead form, bool isQualified, string status)
        {
            Bitrix24Services objService = new Bitrix24Services();

            try
            {
                List <string> nextDepartmentAttendantQueue = GetNextUserDepartmentLeadQualifield();
                form.InsertDate   = DateTime.Now;
                form.AttendantID  = int.Parse(nextDepartmentAttendantQueue[1]);
                form.DepartmentID = int.Parse(nextDepartmentAttendantQueue[0]);
                string webHookPath = nextDepartmentAttendantQueue[2];

                objService.CreateQualifiedLead(form, webHookPath, "*****@*****.**", status, false);

                return(true);
            }
            catch
            {
                return(false);
            }
        }