Пример #1
0
        public JsonResult GetApplyUserInfo(string empNo)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<tr><td>单号</td><td>客户</td><td>目的地</td></tr>");
            BaseServices <FormCar> formcarService = new BaseServices <FormCar>();



            var allData = //formcarService.LoadEntities(c => true).ToList().Where(c => c.Form.CreateEmpNo == empNo && c.Form.FormStatus == (int)Form.StatusEnum.签核中).ToList();
                          // new Business.BaseServices<FormCar>().LoadEntities(c => c.Form.CreateEmpNo == empNo && c.Form.FormStatus == (int)Form.StatusEnum.签核中).ToList();
                          ContextFactory.ContextHelper.FormCars.Where(c => c.Form.CreateEmpNo == empNo && c.Form.FormStatus == (int)Form.StatusEnum.签核中).ToList();

            List <FormSign> formSigns = new Signing().GetSignDataList(base.EmpNo).Where(m => m.Form.FormId == 16).ToList();



            var listCar = new List <FormCar>();

            formSigns.ForEach(k => listCar.AddRange(allData.Where(c => c.FormNo == k.FormNo)));


            listCar.ForEach(
                k =>
            {
                sb.AppendLine("<tr>");
                sb.AppendLine("<td><input type='radio' name='form' />" + k.FormNo + "</td>");
                //sb.AppendLine("<td>" + k.Type + "</td>");
                sb.AppendFormat("<td>{0}/{1}</td>", k.CustomerNo, k.Customer.CustomerName);
                sb.AppendLine("<td>" + k.Addr + "</td>");
                sb.AppendLine("</tr>");
            });
            var user = listCar.FirstOrDefault();

            string[] result = { user != null ? $"{user.Form.BaseEmployee.DepartmentId}/{user.Form.CreateEmpNo}" : "", sb.ToString() };

            return(Json(result));
        }