Ejemplo n.º 1
0
        public void AcceptManagerPlan(string idClient)
        {
            CallsComment callsComment = _context.Set <CallsComment>().FirstOrDefault(c => c.ClientId.ToString() == idClient && c.Type == "План");

            if (callsComment != null)
            {
                _context.Set <CallsComment>().FirstOrDefault(c => c.Id == callsComment.Id && c.Type == "План").AcceptControlerCalss = AcceptControlerCalss.ManagerAccept;
                _context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void DefaultCallClient(string comment, string clientId)
        {
            CallsComment callsComment = _context.Set <CallsComment>().FirstOrDefault(c => c.ClientId.ToString() == clientId && c.Type == "Клиент");

            if (callsComment != null)
            {
                callsComment.Comment = comment;
                callsComment.AcceptControlerCalss = AcceptControlerCalss.Default;
            }
            else
            {
                _context.Set <CallsComment>().Add(new CallsComment()
                {
                    AcceptControlerCalss = AcceptControlerCalss.Default,
                    Comment  = comment,
                    ClientId = Convert.ToInt32(clientId),
                    Type     = "Клиент"
                });
            }
            _context.SaveChanges();
        }
Ejemplo n.º 3
0
        public void NoAcceptCall(string comment, string callId, string clientId)
        {
            string color = null;

            if (_accountInformationService.CurrentUser() is Data.Entities.Users.Manager)
            {
                color = ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "1" ? "black" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "2" ? "lightskyblue"
                : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "3" ? "blue" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "4" ? "blueviolet"
                : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "5" ? "brown" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "6" ? "chocolate"
                : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "7" ? "coral" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "8" ? "darkblue"
                : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "9" ? "deeppink" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "10" ? "gold"
                : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "11" ? "green" : ((Data.Entities.Users.Manager)_accountInformationService.CurrentUser()).ColorPen == "12" ? "tomato"
                : "black";
            }
            else
            {
                color = "black";
            }
            CallsComment callsComment = _context.Set <CallsComment>().FirstOrDefault(c => c.ClientId.ToString() == clientId && c.ContactClientId.ToString() == callId && c.Type == "Звонок");

            if (callsComment != null)
            {
                callsComment.Comment = comment;
                callsComment.AcceptControlerCalss = AcceptControlerCalss.ControlerNoAccept;
                callsComment.ColorPen             = color;
            }
            else
            {
                _context.Set <CallsComment>().Add(new CallsComment()
                {
                    AcceptControlerCalss = AcceptControlerCalss.ControlerNoAccept,
                    Comment         = comment,
                    ClientId        = Convert.ToInt32(clientId),
                    ContactClientId = Convert.ToInt32(callId),
                    ColorPen        = color,
                    Type            = "Звонок"
                });;
            }
            _context.SaveChanges();
        }