Ejemplo n.º 1
0
        public List <AgentTeleLogsModel> ListFollowupAgentTeleLogs()
        {
            int sno    = 0;
            var result = ent.Core_AgentTeleLogs.Where(x => x.isNeedFollowUp == true).OrderByDescending(x => x.CreatedDate).ToList();;
            List <AgentTeleLogsModel> model = new List <AgentTeleLogsModel>();

            foreach (var item in result)
            {
                sno++;
                AgentTeleLogsModel obj = new AgentTeleLogsModel();
                obj.SNO                   = sno;
                obj.AgentTeleLogId        = item.AgentTeleLogId;
                obj.AgentId               = item.AgentId;
                obj.AgentName             = item.Agents.AgentName;
                obj.Title                 = item.Title == "" ? "" : item.Title;
                obj.ContactPerson         = item.ContactPerson;
                obj.ContactNumber         = item.ContactNumber == "" ? "" : item.ContactNumber;
                obj.ProblemCategoryName   = item.ProblemCategory == "" ? "" : item.ProblemCategory;
                obj.Remarks               = item.Remarks == "" ? "" : item.Remarks;
                obj.CompetitorInformation = item.CompetitorInformation == "" ? "" : item.CompetitorInformation;
                obj.isNeededFollowUp      = item.isNeedFollowUp;
                obj.CreatedBy             = item.CreatedBy;
                obj.CreatedName           = item.UsersDetails.FullName;
                obj.CreatedDate           = item.CreatedDate;

                model.Add(obj);
            }
            return(model);
        }
        public ActionResult Index(DateTime?FromDate, DateTime?ToDate, int?page)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            int defaultPageSize  = 30;

            TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"];

            AgentTeleLogsModel model = new AgentTeleLogsModel();

            if (FromDate == null && ToDate == null)
            {
                model.FromDate = GeneralRepository.CurrentDateTime().Date;
                model.ToDate   = GeneralRepository.CurrentDateTime().Date.AddHours(23).AddMinutes(59);
            }
            else
            {
                model.FromDate = FromDate;
                model.ToDate   = ToDate;
            }


            model.AgentTeleLogsList         = ser.ListAgentTeleLogs(model.FromDate, model.ToDate);
            model.AgentTeleLogsFollowupList = ser.ListFollowupAgentTeleLogs().ToPagedList(currentPageIndex, defaultPageSize);

            return(View(model));
        }
        public ActionResult Detail(int id)
        {
            AgentTeleLogsModel model = new AgentTeleLogsModel();

            model = ser.DetailAgentTeleLogs(id);
            return(View(model));
        }
Ejemplo n.º 4
0
        public List <AgentTeleLogsModel> ListAgentTeleLogs(DateTime?FromDate, DateTime?ToDate)
        {
            var result = ent.Core_AgentTeleLogs.Where(x => x.CreatedDate >= FromDate && x.CreatedDate <= ToDate).ToList();
            List <AgentTeleLogsModel> model = new List <AgentTeleLogsModel>();

            if (result.Count > 0)
            {
                foreach (var item in result)
                {
                    AgentTeleLogsModel obj = new AgentTeleLogsModel();

                    obj.AgentTeleLogId        = item.AgentTeleLogId;
                    obj.AgentId               = item.AgentId;
                    obj.AgentName             = item.Agents.AgentName;
                    obj.Title                 = item.Title == "" ? "" : item.Title;
                    obj.ContactPerson         = item.ContactPerson;
                    obj.ContactNumber         = item.ContactNumber == "" ? "" : item.ContactNumber;
                    obj.ProblemCategoryName   = item.ProblemCategory == "" ? "" : item.ProblemCategory;
                    obj.Remarks               = item.Remarks == "" ? "" : item.Remarks;
                    obj.CompetitorInformation = item.CompetitorInformation == "" ? "" : item.CompetitorInformation;
                    obj.isNeededFollowUp      = item.isNeedFollowUp;
                    obj.CreatedBy             = item.CreatedBy;
                    obj.CreatedName           = item.UsersDetails.FullName;
                    obj.CreatedDate           = item.CreatedDate;

                    model.Add(obj);
                }
                return(model.OrderByDescending(x => x.CreatedDate).ToList());
            }
            else if (FromDate == null || ToDate == null)
            {
                result = ent.Core_AgentTeleLogs.ToList();
                foreach (var item in result)
                {
                    AgentTeleLogsModel obj = new AgentTeleLogsModel();
                    obj.AgentTeleLogId        = item.AgentTeleLogId;
                    obj.AgentId               = item.AgentId;
                    obj.AgentName             = item.Agents.AgentName;
                    obj.Title                 = item.Title == "" ? "" : item.Title;
                    obj.ContactPerson         = item.ContactPerson;
                    obj.ContactNumber         = item.ContactNumber == "" ? "" : item.ContactNumber;
                    obj.ProblemCategoryName   = item.ProblemCategory == "" ? "" : item.ProblemCategory;
                    obj.Remarks               = item.Remarks == "" ? "" : item.Remarks;
                    obj.CompetitorInformation = item.CompetitorInformation == "" ? "" : item.CompetitorInformation;
                    obj.isNeededFollowUp      = item.isNeedFollowUp;
                    obj.CreatedBy             = item.CreatedBy;
                    obj.CreatedName           = item.UsersDetails.FullName;
                    obj.CreatedDate           = item.CreatedDate;

                    model.Add(obj);
                }
                return(model.OrderByDescending(x => x.CreatedDate).ToList());
            }
            return(null);
        }
Ejemplo n.º 5
0
        public void CommentsAdd(AgentTeleLogsModel modelToSave)
        {
            Core_AgentTeleLogComments datamodel = new Core_AgentTeleLogComments
            {
                AgentTeleLogId = modelToSave.AgentTeleLogId,
                Comment        = modelToSave.Comment,
                isDelete       = modelToSave.isDelete,
                CreatedBy      = modelToSave.CreatedBy,
                CreatedDate    = DateTime.Now
            };

            ent.AddToCore_AgentTeleLogComments(datamodel);
            ent.SaveChanges();
        }
        public ActionResult Create(AgentTeleLogsModel model)
        {
            TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"];

            model.CreatedBy = obj.AppUserId;
            try
            {
                ser.CreateAgentTeleLogs(model);
            }
            catch
            {
                return(View(model));
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult Comment(int id, AgentTeleLogsModel model)
        {
            TravelSession ts = (ATLTravelPortal.Helpers.TravelSession)Session["TravelPortalSessionInfo"];

            model.AgentTeleLogId = id;
            model.CreatedBy      = ts.AppUserId;
            try
            {
                ser.CommentsAdd(model);
            }
            catch
            {
            }

            return(RedirectToAction("Edit", new { @id = id }));
        }
Ejemplo n.º 8
0
        public void CreateAgentTeleLogs(AgentTeleLogsModel model)
        {
            Core_AgentTeleLogs obj = new Core_AgentTeleLogs();

            obj.AgentId               = (int)model.hdfAgentId;
            obj.Title                 = model.Title == "" ? "" : model.Title;
            obj.ContactPerson         = model.ContactPerson;
            obj.ContactNumber         = model.ContactNumber == "" ? "" : model.ContactNumber;
            obj.ProblemCategory       = model.ProblemCategoryId == "" ? "" : model.ProblemCategoryId;
            obj.Remarks               = model.Remarks == "" ? "" : model.Remarks;
            obj.CompetitorInformation = model.CompetitorInformation == "" ? "" : model.CompetitorInformation;
            obj.isNeedFollowUp        = model.isNeededFollowUp == true ? true : false;
            obj.CreatedBy             = model.CreatedBy;
            obj.CreatedDate           = DateTime.Now;

            ent.AddToCore_AgentTeleLogs(obj);
            ent.SaveChanges();
        }
Ejemplo n.º 9
0
        public void EditAgentTeleLogs(AgentTeleLogsModel model)
        {
            Core_AgentTeleLogs result = ent.Core_AgentTeleLogs.Where(x => x.AgentTeleLogId == model.AgentTeleLogId).FirstOrDefault();

            result.AgentId               = (int)model.hdfAgentId;
            result.Title                 = model.Title == "" ? "" : model.Title;
            result.ContactPerson         = model.ContactPerson;
            result.ContactNumber         = model.ContactNumber == "" ? "" : model.ContactNumber;
            result.ProblemCategory       = model.ProblemCategoryId == "" ? "" : model.ProblemCategoryId;
            result.Remarks               = model.Remarks == "" ? "" : model.Remarks;
            result.CompetitorInformation = model.CompetitorInformation == "" ? "" : model.CompetitorInformation;
            result.isNeedFollowUp        = model.isNeededFollowUp == true ? true : false;
            result.CreatedBy             = model.CreatedBy;
            result.CreatedDate           = DateTime.Now;

            ent.ApplyCurrentValues(result.EntityKey.EntitySetName, result);
            ent.SaveChanges();
        }
Ejemplo n.º 10
0
        public ActionResult DeleteAgentTeleLogComment(int telelogid, int commentid)
        {
            TravelSession      ts    = (ATLTravelPortal.Helpers.TravelSession)Session["TravelPortalSessionInfo"];
            AgentTeleLogsModel model = new AgentTeleLogsModel();

            model.CreatedBy = ts.AppUserId;
            AgentTeleLogsProvider Provider = new AgentTeleLogsProvider();
            int TeleLogcommentid           = Provider.GetCommentCreatedBy(commentid);

            if (model.CreatedBy == TeleLogcommentid)
            {
                Provider.DeleteComment(telelogid, commentid);
            }
            else
            {
            }
            return(RedirectToAction("Edit", "AgentTeleLogs", new { @id = telelogid }));
        }
Ejemplo n.º 11
0
        public AgentTeleLogsModel DetailAgentTeleLogs(int AgentTeleLogId)
        {
            Core_AgentTeleLogs result = ent.Core_AgentTeleLogs.Where(x => x.AgentTeleLogId == AgentTeleLogId).FirstOrDefault();
            AgentTeleLogsModel model  = new AgentTeleLogsModel();

            model.AgentTeleLogId        = result.AgentTeleLogId;
            model.hdfAgentId            = result.AgentId;
            model.AgentName             = result.Agents.AgentName;
            model.Title                 = result.Title == "" ? "" : result.Title;
            model.ContactPerson         = result.ContactPerson;
            model.ContactNumber         = result.ContactNumber == "" ? "" : result.ContactNumber;
            model.ProblemCategoryId     = result.ProblemCategory == "" ? "" : result.ProblemCategory;
            model.Remarks               = result.Remarks == "" ? "" : result.Remarks;
            model.CompetitorInformation = result.CompetitorInformation == "" ? "" : result.CompetitorInformation;
            model.isNeededFollowUp      = result.isNeedFollowUp == true ? true : false;
            model.CreatedBy             = result.CreatedBy;
            model.CreatedDate           = result.CreatedDate;

            return(model);
        }
Ejemplo n.º 12
0
        public ActionResult Index(AgentTeleLogsModel model, int?page)
        {
            int currentPageIndex = page.HasValue ? page.Value : 1;
            int defaultPageSize  = 100;

            if (model.FromDate != null)
            {
                model.FromDate = model.FromDate.Value.Date;
            }

            if (model.ToDate != null)
            {
                model.ToDate = model.ToDate.Value.Date.AddHours(23).AddMinutes(59);
            }

            model.AgentTeleLogsList         = ser.ListAgentTeleLogs(model.FromDate, model.ToDate);
            model.AgentTeleLogsFollowupList = ser.ListFollowupAgentTeleLogs().ToPagedList(currentPageIndex, defaultPageSize);

            return(View(model));
        }
Ejemplo n.º 13
0
        public List <AgentTeleLogsModel> GetAgentTeleLogsList(int id)
        {
            List <AgentTeleLogsModel> model = new List <AgentTeleLogsModel>();
            var result = ent.Core_AgentTeleLogComments;

            foreach (var item in result)
            {
                AgentTeleLogsModel obj = new AgentTeleLogsModel();

                obj.commentid      = item.AgentTeleLogCommentId;
                obj.AgentTeleLogId = item.AgentTeleLogId;
                obj.Comment        = item.Comment;
                obj.isDelete       = item.isDelete;
                obj.CreatedBy      = item.CreatedBy;
                obj.CreatedName    = item.UsersDetails.FullName;
                obj.CreatedDate    = item.CreatedDate;

                model.Add(obj);
            }
            return(model.Where(x => x.AgentTeleLogId == id && x.isDelete == false).ToList());
        }
Ejemplo n.º 14
0
        public ActionResult Edit(int Id, AgentTeleLogsModel model)
        {
            TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"];

            model.AgentTeleLogId = Id;

            model.CreatedBy = obj.AppUserId;

            int agentid = ser.GetAgentId(model.AgentName);

            model.AgentId = agentid;
            try
            {
                ser.EditAgentTeleLogs(model);
            }
            catch
            {
                return(View(model));
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 15
0
        public ActionResult Edit(int Id)
        {
            AgentTeleLogsModel model = new AgentTeleLogsModel();
            List <Core_AgentTeleLogComments> commentmodel = ser.GeCommentByID(Id);

            model.AgentTeleLogId = Id;
            model = ser.DetailAgentTeleLogs(Id);

            try
            {
                foreach (var item in commentmodel)
                {
                    model.commentid = (int)item.AgentTeleLogCommentId;
                }
            }
            catch
            {
            }
            model.CommentList = ser.GetAgentTeleLogsList(Id);

            return(View(model));
        }