Esempio n. 1
0
        public void RefreshVisitList()
        {
            CRM_VisitLogic    cvs   = new CRM_VisitLogic();
            SystemUserLogic   sul   = new SystemUserLogic();
            CRM_CustomerLogic ccusl = new CRM_CustomerLogic();
            CRM_ContactLogic  cconl = new CRM_ContactLogic();
            var showvisitlist       = from visit in cvs.GetAll()
                                      join customer in ccusl.GetAll()
                                      on visit.CusId equals customer.Id
                                      join user in sul.GetAllUsers()
                                      on visit.VSuperiorId equals user.Id
                                      join contact in cconl.GetAll()
                                      on visit.ConId equals contact.Id
                                      select new
            {
                Id                  = visit.Id,
                CusCode             = customer.CusCode,
                CusName             = customer.CusName,
                UserName            = user.UserName,
                ContactName         = contact.Name,
                VTitle              = visit.VTitle,
                VContent            = visit.VContent,
                VType               = visit.VType,
                VPlanDate           = visit.VPlanDate,
                VCompleteDate       = visit.VCompleteDate,
                VSuperiorDate       = visit.VSuperiorDate,
                VSuperiorSuggestion = visit.VSuperiorSuggestion,
                VStatus             = visit.VStatus
            };

            this.dgvVisitInfo.DataSource = showvisitlist.ToList();
        }