public JsonResult ReturnProjectAndSkill(int projectID) { var project = new ProjectDao().FindByID(projectID); var listSkill = new ProjectSkillDao().ListByProject(projectID); var listName = new List <string>(); var jmDao = new JobMajorDao(); foreach (var item in listSkill) { listName.Add(jmDao.NameJob(item.ProjectSkill1)); } if (project == null || listSkill == null) { return(Json(new { status = false })); } return(Json(new { status = true, project = project, listSkill = listSkill, listName = listName })); }
public ActionResult ListProject(int major = -1, string title = "", string listSkill = "", bool space = false, int page = 1) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "Account")); } var accID = int.Parse(User.Identity.Name); var acc = new AccountDao().FindAccountById(accID); var proDao = new ProjectDao(); var model = new ModelProject(); var arr = listSkill.Split('-'); var list = new List <int>(); if (listSkill != "") { foreach (var item in arr) { list.Add(int.Parse(item)); } } ViewBag.ListMajor = new JobMajorDao().ListJobMain(); ViewBag.ListSkill = new JobMajorDao().ListJobSub(); ViewBag.UserID = acc.UserId; model.ListFull = proDao.FindBySearch(major, title, list, space); model.ListUserCreate = proDao.ListByUserCreate(acc.UserId); model.ListUserJoin = proDao.ListByUserJoin(acc.UserId); return(View(model)); }
public async Task <int> GetDataCount() { using (var projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync().CountAsync()); } }
public List <Project> QueryMyProject(WorkflowProcessStatus processStatus) { ISqlMapper mapper = Common.GetMapperFromSession(); TaskDao taskdao = new TaskDao(mapper); WorkflowDao wfdao = new WorkflowDao(mapper); ProjectDao projectdao = new ProjectDao(mapper); UserBLL userbll = new UserBLL(); var user = userbll.GetCurrentUser(); string userid = user.User.ID; //string userid = "13"; var tasks = taskdao.Query(new TaskQueryForm { UserID = userid }); List <string> workflowids = (from t in tasks select t.WorkflowID).Distinct().ToList(); var workflows = wfdao.Query(new WorkflowQueryForm { IDs = workflowids, Status = (int)processStatus }); List <string> projectids = (from wf in workflows select wf.ProcessID).ToList(); return(projectdao.Query(new ProjectQueryForm { IDs = projectids })); }
public async Task RemoveProject(Guid id) { using (var projectDao = new ProjectDao()) { await projectDao.RemoveAsync(id); } }
public List <InitApprovalResultForm> QueryMyApply(QueryMyApplyServiceForm form) { List <InitApprovalResultForm> list = new List <InitApprovalResultForm>(); ISqlMapper mapper = Common.GetMapperFromSession(); UserBLL userbll = new UserBLL(); WorkflowDao wfdao = new WorkflowDao(mapper); ProjectDao projectdao = new ProjectDao(mapper); switch (form.Status) { case 4: //已终审(经理审批) form.ManagerAppvoal = true; break; case 5: //审批不通过 form.Disagree = true; break; case 1: case 2: case 3: form.WorkflowStatus = form.Status; break; case 6: form.Tracking = true; break; } var users = TableCacheHelper.GetDataFromCache <User>(typeof(UserDao)); var projects = projectdao.QueryMyApply(form); var projectids = (from w in projects select w.ID).Distinct().ToList(); return(Query(projectids, null, form.UserID)); }
public JsonResult AcceptRequest(int projectID, Guid userID, string email) { var check = new ProjectMemberDao().Accept(projectID, userID); if (!check) { return(Json(new { status = false })); } try { var project = new ProjectDao().FindByID(projectID); string content = System.IO.File.ReadAllText(Server.MapPath("~/Assets/Client/Template/SendAcceptProject.html")); content = content.Replace("{{NameProject}}", project.Title); new MailHelper().SendMail(email, "Thông báo tham gia Dự án", content); return(Json(new { status = true })); } catch (Exception e) { return(Json(new { status = false })); } }
public async Task <bool> ExistsProject(Guid projectId) { using (IDAL.Master.IProjectDao projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync().AnyAsync(m => m.Id == projectId)); } }
public StageEditor(StageDao dao) : base() { this.dao = dao; this.projectDao = new ProjectDao(); InitializeComponent(); InitData(); }
public List <ProjectTask> QueryProjectByRelationship(QueryProjectServiceForm form) { ISqlMapper mapper = Common.GetMapperFromSession(); ProjectDao dao = new ProjectDao(mapper); var list = dao.QueryProjectByRelationship(form); return(list); }
public JsonResult SendRequestApply(int projectID, string description, string email) { if (!User.Identity.IsAuthenticated) { return(Json(new { status = 0 })); } var accID = int.Parse(User.Identity.Name); var acc = new AccountDao().FindAccountById(accID); var listMember = new ProjectMemberDao().ListByProject(projectID); if (listMember.Select(x => x.MemberID).Contains(acc.UserId)) { return(Json(new { status = -1 })); } var projectMember = new ProjectMember(); projectMember.ProjectID = projectID; projectMember.MemberID = acc.UserId; projectMember.CreateDate = DateTime.Now; projectMember.Status = "request"; projectMember.Description = description; var check = new ProjectMemberDao().Insert(projectMember); if (!check) { return(Json(new { stauts = 0 })); } try { var user = new UserDao().FindById(acc.UserId); var project = new ProjectDao().FindByID(projectID); string content = System.IO.File.ReadAllText(Server.MapPath("~/Assets/Client/Template/SendRequestApply.html")); content = content.Replace("{{NameUser}}", user.UserName); content = content.Replace("{{NameProject}}", project.Title); content = content.Replace("{{Description}}", description); new MailHelper().SendMail(email, "Request Apply Dự án", content); return(Json(new { status = 1, })); } catch (Exception e) { return(Json(new { status = 0, })); } }
public JsonResult DeleteProject(int projectID) { var check = new ProjectDao().Delete(projectID); return(Json(new { status = check })); }
public OutputUtils() { this.projectDao = new ProjectDao(); this.stageDao = new StageDao(); this.buildingDao = new BuildingDao(); this.floorplanDao = new FloorplanDao(); this.apartmentDao = new ApartmentDao(); this.mediaDao = new MediaDao(); }
public BuildingEditor(BuildingDao dao) : base() { this.dao = dao; this.projectDao = new ProjectDao(); this.stageDao = new StageDao(); InitializeComponent(); InitData(); }
public async Task CreateProject(string name) { using (var projectDao = new ProjectDao()) { await projectDao.CreateAsync(new Project() { Name = name, }); } }
public async Task EditProject(Guid projectId, string name) { using (var projectDao = new ProjectDao()) { var project = await projectDao.GetOneByIdAsync(projectId); project.Name = name; await projectDao.EditAsync(project); } }
public ActionResult AddAndEditProject(FormProject model) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "Account")); } var accID = int.Parse(User.Identity.Name); var acc = new AccountDao().FindAccountById(accID); var project = new Project(); if (model.typeAction == "add") { project.CreateDate = DateTime.Now; project.MasterID = acc.UserId; } else { project.ProjectID = model.saveID; } project.ProjectMajor = model.major; project.Title = model.title; project.Amount = model.amount; project.Apply = 1; project.Description = model.description; var check = -1; if (model.typeAction == "add") { check = new ProjectDao().Insert(project); var projectMember = new ProjectMember(); projectMember.ProjectID = check; projectMember.MemberID = acc.UserId; projectMember.CreateDate = DateTime.Now; projectMember.Status = "master"; var checkSecond = new ProjectMemberDao().Insert(projectMember); } else { var edit = new ProjectDao().Edit(project); } if (model.skill != null && model.skill.Count != 0) { var prSkillDao = new ProjectSkillDao(); foreach (var item in model.skill) { var prk = new ProjectSkill(); prk.ProjectSkill1 = item; prk.ProjectID = check != -1 ? check : model.saveID; var echInsert = prSkillDao.Insert(prk); } } return(RedirectToAction("ListProject")); }
public ActionResult GetInforProject(int ProjectID) { var currentUser = (User)Session[CommonConstants.USE_SESSISON]; //get information witd ProjectID var ttproject = new ProjectDao().GetByID(ProjectID); //lay thong tin member var dsUser = new UserDao().GetAllUserByProjectID(ProjectID); //lay thong tin leader var ttleader = (new ProjectDao().GetLeaderProject(ProjectID)); if (ttleader == null) { ttproject.Leadername = "No Assign"; } else { ttproject.Leadername = ttleader.FullName; } Dictionary <int, string> dsmember = new Dictionary <int, string>(); List <FeatureMember> dsFeatureMb = new List <FeatureMember>(); foreach (var item in dsUser) { if (item.RoleID != CommonConstants.MANAGER) { dsmember.Add(item.UserID, item.FullName); } List <Feature> ft = new FeatureDao().GetByUserID(item.UserID, ProjectID); foreach (var fc in ft) { FeatureMember fm = new FeatureMember(); fm.FeatureOwer = item.FullName; fm.FeatureName = fc.FeatureName; fm.FeatureStatus = fc.StatusCheck.StatusName; fm.FeatureID = fc.FeatureID; dsFeatureMb.Add(fm); } } //dsmember.Remove(currentUser.UserID); //lấy thông tin Feature theo ID member ArrayList dl = new ArrayList(); dl.Add(dsmember.ToList()); //dl[0]="danh sách các member" dl.Add(ttproject.ProjectName); //dl[1]=tên project dl.Add(ttproject.Leadername); //dl[2]==tên leader dl.Add(ttproject.StartDate); //dl[3]==ngày bắt đầu project dl.Add(ttproject.EndDate); //dl[4]==ngày kết thúc project dl.Add(dsFeatureMb); //dl[5] danh sách feature và member đảm nhiệm return(Json(dl, JsonRequestBehavior.AllowGet)); }
// GET: Process public ActionResult Index(long id) { //Kiểm tra quyền truy cập của user UserLogin us = (UserLogin)Session[CommonConstant.USER_SESSION]; ProjectUserDao puDao = new ProjectUserDao(); //Kiểm tra quyền truy cập của lạnh đạo bool inGroup = false; GroupUserDao gru = new GroupUserDao(); //Kiểm tra theo user có thuộc nhóm lãnh đạo kho Guid grid = new Guid("964D283D-BEA0-4D85-B7C0-355487A5DF0C"); if (gru.FiindByID(grid, us.UserID) != null) { inGroup = true; } //Kiểm tra theo user có thuộc nhóm trong dự án ko ProjectUser objPU = puDao.FindByID(us.UserID, id); if (objPU != null) { inGroup = true; } if (inGroup == false) { SetAlert("Bạn không có quyền cập nhật tiến độ dự án", Common.CommonConstant.ALERT_DANGER); return(RedirectToAction("Details", "Project", new { id = id })); } ProjectDao bdDao = new ProjectDao(); ViewBag.Project = bdDao.FindByID(id); if (ViewBag.Project.Status < 1) { SetAlert("Dự án chưa được duyệt!", Common.CommonConstant.ALERT_WARNING); return(RedirectToAction("Details", "Project", new { id = id })); } if (ViewBag.Project.Status > 2) { SetAlert("Dự án đã kết thúc!", Common.CommonConstant.ALERT_WARNING); return(RedirectToAction("Details", "Project", new { id = id })); } ProcessDao prcessDao = new ProcessDao(); ViewBag.lstprocess = prcessDao.ToListProcessUserByProjectID(id); ViewBag.lstProjectProcessMessege = prcessDao.GetListProjectProcessMessege(id).ToArray <ProjectMessage>(); ViewBag.Messege = prcessDao.CountProcessMessage(id).ToString(); FeedbackDao feedDao = new FeedbackDao(); ViewBag.Feedback = feedDao.ToListByProjectID(id).Count.ToString(); return(View()); }
public async Task <IActionResult> Statistics() { int?id = HttpContext.Session.GetInt32("id"); if (!id.HasValue) { return(Redirect("None")); } List <ProjectsProgress> res = await ProjectDao.getInstance().ProgressList((int)id); return(View(res)); }
public ActionResult <Models.Project> CreateProject(ProjectDao project) { try { return(Created("https://localhost:5001/Project", _project.CreateProject(project))); } catch (Exception ex) { _logger.LogError("Error", ex); return(BadRequest()); } }
public Models.Project CreateProject(ProjectDao project) { var projectDao = new ProjectDao() { Name = project.Name, Date = DateTime.Now, UpdateDate = null }; const string insertQuery = "INSERT INTO Electric.Project VALUES (@name, @date, @updateDate); SELECT * FROM Electric.Project WHERE id = SCOPE_IDENTITY()"; return(TransformDaoToBusinessLogicProject(_database.QueryFirst <ProjectDao>(insertQuery, projectDao))); }
public ProjectItemPage(int _idx) { NavigationPage.SetHasNavigationBar(this, true); idx = _idx; if (idx != -1) { dao = new ProjectDao(idx); } // Set Title Title = (idx < 0) ? "Add Project" : "Edit Project"; }
public async Task <List <ProjectDto> > GetAllProject(int pageIndex, int pageSize, bool asc = true) { using (var projectDao = new ProjectDao()) { return(await projectDao.GetAllByPageOrderAsync(pageIndex - 1, pageSize, asc).Select(m => new DTO.Master.ProjectDto() { Id = m.Id, Name = m.Name, CreateTime = m.CreateTime, }).ToListAsync()); } }
public JsonResult ChangeStatus(string statusName, int idProject) { int idStatus = CommonConstants.INACTIVE; if (statusName == "InActive") { idStatus = CommonConstants.ACTIVE; } int result = new ProjectDao().Update(idStatus, idProject); return(Json(result)); }
private Models.Project TransformDaoToBusinessLogicProject(ProjectDao projectDao) { var enclosures = _enclosure.GetEnclosuresByProjectId(projectDao.Id); return(new Models.Project() { Id = projectDao.Id, Name = projectDao.Name, Date = projectDao.Date, UpdateDate = projectDao.UpdateDate, Enclosures = enclosures }); }
public bool FinanceConfirmSave(string projectid, int confirm, string userid, string refundName, string refundAccount, string refundBank, decimal?refundAmount, DateTime?refundTime, decimal?delayFee, DateTime?delayTime, DateTime?delayTimeEnd, string returnBackRemark, decimal?rollFee, string rollRemark, List <ReturnBackConfirm> returnBackMoneyInfo) { //处理项目 ISqlMapper mapper = Common.GetMapperFromSession(); ProjectDao projectdao = new ProjectDao(mapper); ReturnBackConfirmDao rbcdao = new ReturnBackConfirmDao(mapper); Project project = projectdao.Query(new ProjectQueryForm { ID = projectid, IsDeleted = 0 }).FirstOrDefault(); if (project == null) { throw new Exception("项目ID:" + projectid + "不存在"); } projectdao.Update(new ProjectUpdateForm { Entity = new Project { ReturnBackRemark = returnBackRemark, DelayFee = delayFee, DelayTime = delayTime, DelayTimeEnd = delayTimeEnd, RollFee = rollFee, RollRemark = rollRemark, LastUpdator = userid, FinanceConfirm = confirm, RefundAccount = refundAccount, RefundBankName = refundBank, RefundDate = refundTime, RefundMoney = refundAmount, RefundName = refundName, }, ProjectQueryForm = new ProjectQueryForm { ID = projectid, } }); if (returnBackMoneyInfo != null) { rbcdao.Delete(new ReturnBackConfirmQueryForm { ProjectID = projectid }); foreach (var returnback in returnBackMoneyInfo) { returnback.ProjectID = projectid; rbcdao.Add(returnback); } } return(true); }
public JsonResult Update(string projectName, int newManagerID, DateTime startDate, DateTime endDate, int projectID) { var manager = (User)Session[CommonConstants.USE_SESSISON]; ProjectDao dao = new ProjectDao(); Project pr = new Project(); pr.ProjectName = projectName; pr.StartDate = startDate; pr.EndDate = endDate; pr.ProjectID = projectID; int result = dao.Update(pr, newManagerID, manager.UserID); return(Json(result)); }
public async Task <DTO.Master.ProjectDto> GetOneProjectById(Guid projectId) { using (IDAL.Master.IProjectDao projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync() .Where(m => m.Id == projectId) .Select(m => new DTO.Master.ProjectDto() { Name = m.Name, CreateTime = m.CreateTime, }).FirstAsync()); } }
public List <Project> getAllProject() { List <Project> allProject; try { daoProject = new ProjectDao(); allProject = daoProject.getAllProject(); return(allProject); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(null); }
public JsonResult ListProjectItem(string projectid) { IList<ProjectProduct> list = new ProjectProductDao().FindByProjectID(Int32.Parse(projectid)); string strlist = string.Empty; if (list.Count != 0) { string projectname = new ProjectDao().Find(Int32.Parse(projectid)).Name; foreach (ProjectProduct p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='itemeachone'><input type='hidden' class='hidItemID' value='" + p.ID + "'</td>"; strlist += "<td>" + projectname + "</td>"; strlist += "<td>" + new CompareDataDao().FindByMedicineCode(p.ProductCode).Single().ChineseProductName + "</td>"; strlist += "</tr>"; } } return Json(strlist); }
//选择自动匹配竞品的时候多走一步此页面 public ActionResult Middle(int? Projectid, string itemid, int? PageNo, string parm, FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; ViewData["pid"] = Projectid.Value; ViewData["itemid"] = itemid; PageSizeList = 20; int page = PageNo ?? 1; Project pro = new ProjectDao().Find(Projectid.Value); int IsStandard = pro.IsStandard; ViewData["IsStandard"] = IsStandard; ViewData["IsBusseniss"] = pro.IsBussiness * pro.IsBest;//根据是否商务标走不同的页面 Hashtable ht = new Hashtable(); ht["itemid"] = itemid; ht["pid"] = Projectid.Value; IDictionary medicineinfo = (IsStandard == 1) ? StandardDataMapper.Get().QueryForObject<IDictionary>("CompareData.ListSingleName", itemid) : EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("CompareDataProject.ListSingleName", ht); ViewData["medicineinfo"] = medicineinfo; Dictionary<string, string> dict = ParmHelper.Analysis(collection); Hashtable htparm = new Hashtable(); htparm["pid"] = Projectid.Value; htparm["start"] = PageSizeList * (page - 1) + 1; //记录开始数 htparm["end"] = page * PageSizeList; //记录结束数 htparm["ownid"] = itemid; htparm["uid"] = Int32.Parse(sitemaster["userid"]); IList<string> selfdefinecompetelist = EmedEvaluationProjectMapper.Get().QueryForList<string>("SelfDefineCompete.querycompetecode", htparm);//找到所有已匹配过的竞品列表 if (dict.Count == 0 && parm == null) { //所有参加评标的产品 if (IsStandard == 1) { IList<IDictionary> productlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.GetAllCompete", htparm); foreach (IDictionary p in productlist) { //判断是否在已经匹配过的竞品列表中 if (selfdefinecompetelist.Contains(p["ProductCode"].ToString())) p["IsSelected"] = 1; else p["IsSelected"] = 0; } int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("ProjectProduct.GetAllCompeteCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( productlist, page, PageSizeList, count); ViewData["Count"] = count; return View(list); } else { IList<IDictionary> productlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.GetAllCompeteEx", htparm); foreach (IDictionary p in productlist) { if (selfdefinecompetelist.Contains(p["ProductCode"].ToString())) p["IsSelected"] = 1; else p["IsSelected"] = 0; } int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("ProjectProduct.GetAllCompeteCountEx", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( productlist, page, PageSizeList, count); ViewData["Count"] = count; return View(list); } } if (dict.Count == 0 && parm != null) { if (IsStandard == 1) { Dictionary<string, string> use = ParmHelper.AnalysisParm(parm); ViewData["Form"] = use; foreach (KeyValuePair<string, string> k in use) { htparm.Add(k.Key, k.Value); } IList<IDictionary> productlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.GetAllCompete", htparm); foreach (IDictionary p in productlist) { //判断是否在已经匹配过的竞品列表中 if (selfdefinecompetelist.Contains(p["ProductCode"].ToString())) p["IsSelected"] = 1; else p["IsSelected"] = 0; } int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("ProjectProduct.GetAllCompeteCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( productlist, page, PageSizeList, count); ViewData["Count"] = count; return View(list); } else { Dictionary<string, string> use = ParmHelper.AnalysisParm(parm); ViewData["Form"] = use; foreach (KeyValuePair<string, string> k in use) { htparm.Add(k.Key, k.Value); } IList<IDictionary> productlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.GetAllCompeteEx", htparm); foreach (IDictionary p in productlist) { //判断是否在已经匹配过的竞品列表中 if (selfdefinecompetelist.Contains(p["ProductCode"].ToString())) p["IsSelected"] = 1; else p["IsSelected"] = 0; } int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("ProjectProduct.GetAllCompeteCountEx", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( productlist, page, PageSizeList, count); ViewData["Count"] = count; return View(list); } } else { if (dict.Count != 0) { string parmeter = ParmHelper.BuildParm(dict); return RedirectToAction("Middle", new { Projectid = Projectid.Value, itemid = itemid, PageNo = 1, parm = parmeter }); } } return View(); }
// public ActionResult Step1(int? Projectid, string itemid, int? scene, FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["uid"] = sitemaster["userid"]; //ViewData["SiteMaster"] = sitemaster; //ViewData["TenderEnterprise"] = EnterPriseMemberInfo.EnterpriseName; //EnterpriseCode ec = new EnterpriseCodeDao().FindByEnterprise(EnterPriseMemberInfo.EnterpriseName).First(); //int eid = ec.ID; //string ecode = ec.EnterpiseCode; //ViewData["eid"] = eid; bool needregion = false; //此项目是否启用标准化 int IsStandard = new ProjectDao().Find(Projectid.Value).IsStandard; Hashtable ht = new Hashtable(); ht["pid"] = Projectid.Value; ht["itemid"] = itemid; IDictionary medicineinfo = (IsStandard == 1) ? StandardDataMapper.Get().QueryForObject<IDictionary>("CompareData.ListSingleName", itemid) : EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("CompareDataProject.ListSingleName", ht); ViewData["medicineinfo"] = medicineinfo; ViewData["Projectid"] = Projectid.Value; int IsBest = new ProjectDao().Find(Projectid.Value).IsBest; ViewData["IsBest"] = IsBest;//是否技术标的标志 ViewData["ProductID"] = itemid; ViewData["Detail"] = ""; //是否是通过原来保存的场景过来的 if (scene != null) { ViewData["Detail"] = EmedEvaluationProjectMapper.Get().QueryForObject<string>("Scene.FindByScenceNo", scene.Value); } //是否是通过原来保存的场景过来的--完 //如果有通用名分组情况,构建通用名分组列表 StringBuilder commonnamegrouphtml = new StringBuilder(); Hashtable cghtparm = new Hashtable(); cghtparm["pid"] = Projectid.Value; cghtparm["namecode"] = medicineinfo["MedicineCode"].ToString().Substring(0, 7); string namecodes = EmedEvaluationProjectMapper.Get().QueryForObject<string>("CommonNameGroup.GetNameCodes", cghtparm); if (namecodes != null && namecodes != "") { commonnamegrouphtml.Append("<tr><td >" + medicineinfo["ChineseProductName"] + "</td><td>" + medicineinfo["Formulation"] + "</td><td>" + medicineinfo["ChineseSpecification"] + "</td><tr>"); string[] namecodelist = namecodes.Split(','); string[] medicinecodelist = new string[namecodelist.Length]; int i = 0; foreach (string n in namecodelist) { medicinecodelist[i] = namecodelist[i] + medicineinfo["MedicineCode"].ToString().Substring(7, 8); i++; } Hashtable namegrouphtparm = new Hashtable(); namegrouphtparm["ownmc"] = medicineinfo["MedicineCode"]; namegrouphtparm["mclist"] = medicinecodelist; namegrouphtparm["pid"] = Projectid.Value; IList<IDictionary> commonnamegroup = (IsStandard == 1) ? StandardDataMapper.Get().QueryForList<IDictionary>("CompareMedicine.ListMedicineEx", namegrouphtparm) : EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("MedicineDataProject.ListMedicineEx", namegrouphtparm); foreach (IDictionary c in commonnamegroup) { commonnamegrouphtml.Append("<tr><td >" + c["ChineseProductName"] + "</td><td>" + c["Formulation"] + "</td><td>" + c["ChineseSpecification"] + "</td><tr>"); } } ViewData["CommonNameGroup"] = commonnamegrouphtml.ToString(); //如果有通用名分组情况,构建通用名分组列表--完 //如果有剂型分组情况,构建剂型分组列表 StringBuilder formulationgrouphtml = new StringBuilder(); Hashtable fghtparm = new Hashtable(); fghtparm["pid"] = Projectid.Value; fghtparm["namecode"] = medicineinfo["MedicineCode"].ToString().Substring(0, 10); string fomulationcodes = EmedEvaluationProjectMapper.Get().QueryForObject<string>("FormulationGroup.GetNameCodes", fghtparm); if (fomulationcodes != null && fomulationcodes != "") { commonnamegrouphtml.Append("<tr><td >" + medicineinfo["ChineseProductName"] + "</td><td>" + medicineinfo["Formulation"] + "</td><td>" + medicineinfo["ChineseSpecification"] + "</td><tr>"); string[] formulationcodelist = fomulationcodes.Split(','); string[] medicinecodelist = new string[formulationcodelist.Length]; int i = 0; foreach (string n in formulationcodelist) { medicinecodelist[i] = formulationcodelist[i] + medicineinfo["MedicineCode"].ToString().Substring(10, 5); i++; } Hashtable namegrouphtparm = new Hashtable(); namegrouphtparm["ownmc"] = medicineinfo["MedicineCode"]; namegrouphtparm["mclist"] = medicinecodelist; namegrouphtparm["pid"] = Projectid.Value; IList<IDictionary> formulationnamegroup = (IsStandard == 1) ? StandardDataMapper.Get().QueryForList<IDictionary>("CompareMedicine.ListMedicineEx", namegrouphtparm) : EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("MedicineDataProject.ListMedicineEx", namegrouphtparm); foreach (IDictionary c in formulationnamegroup) { formulationgrouphtml.Append("<tr><td >" + c["ChineseProductName"] + "</td><td>" + c["Formulation"] + "</td><td>" + c["ChineseSpecification"] + "</td><tr>"); } } ViewData["FormulationGroup"] = formulationgrouphtml.ToString(); //如果有剂型分组情况,构建剂型分组列表--完 //构建指标分类的tabel IList<PointCategory> pointcategorylist = new PointCategoryDao().FindByProjectOid(Projectid.Value); StringBuilder CategoryHtml = new StringBuilder(); StringBuilder PointHtml = new StringBuilder(); int totalpointNum = 0; foreach (PointCategory p in pointcategorylist) { if (p.Name == "价格分") needregion = true; int pointnum = EmedEvaluationProjectMapper.Get().QueryForObject<int>("Point.count", p.ID); IList<Point> plist = new PointDao().FindByCategoryID(p.ID); int count = 0; foreach (Point pp in plist) { count++; if (pp.Iseorp == 1) PointHtml.Append("<td nowrap='nowrap'><Label style='cursor:pointer;text-decoration:underline;' class='pointdetail'>指标" + count + "</Lable><input type='hidden' class='pointname' value='" + pp.Name + "' /><br /><input pointid='" + pp.ID + "' class='usedatabase' type='button' value='自动打分' Field='" + pp.Field + "' Eorp='" + pp.EORP + "'></td>"); else PointHtml.Append("<td nowrap='nowrap'><Label style='cursor:pointer;text-decoration:underline;' class='pointdetail'>指标" + count + "</Lable><input type='hidden' class='pointname' value='" + pp.Name + "' /></td>"); } CategoryHtml.Append("<td class='bidpoint' nowrap='nowrap' colspan='" + pointnum + "'>" + p.Name + "</td>"); totalpointNum += pointnum; } foreach (PointCategory p in pointcategorylist) { PointHtml.Append("<td nowrap='nowrap'>" + p.Name + "(总计)" + "</td>"); } ViewData["CategoryHtml"] = CategoryHtml.ToString(); ViewData["CategoryCount"] = totalpointNum; if (IsBest == 1) ViewData["ScoreCount"] = pointcategorylist.Count + 3; else ViewData["ScoreCount"] = pointcategorylist.Count + 2; ViewData["PointHtml"] = PointHtml.ToString(); //构建指标分类的tabel--完 StringBuilder content = new StringBuilder(); Hashtable elhtparm = new Hashtable(); //elhtparm["pc"]=itemid.Substring(0,15); elhtparm["pid"] = Projectid.Value; elhtparm["ownitem"] = itemid; elhtparm["ownid"] = itemid.Substring(15, 12); //IList<int> enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<int>("AuthorizationProject.queryenterpriseid", elhtparm); List<string> mclist = new List<string>(); mclist.Add(itemid.Substring(0, 15)); //如果包含通用名分组,要并入列表一起进行评标 if (namecodes != null && namecodes != "") { string[] namecodelist = namecodes.Split(','); //string[] medicinecodelist = new string[namecodelist.Length]; int i = 0; foreach (string n in namecodelist) { mclist.Add(namecodelist[i] + medicineinfo["MedicineCode"].ToString().Substring(7, 8)); i++; } //elhtparm["mcodes"] = medicinecodelist; } //如果包含通用名分组,要并入列表一起进行评标--完 //如果包含剂型分组,要并入列表一起进行评标 if (fomulationcodes != null && fomulationcodes != "") { string[] formulationcodelist = fomulationcodes.Split(','); string[] medicinecodelist = new string[formulationcodelist.Length]; int i = 0; foreach (string n in formulationcodelist) { mclist.Add(formulationcodelist[i] + medicineinfo["MedicineCode"].ToString().Substring(7, 8)); i++; } //elhtparm["mcodes"] = medicinecodelist; } elhtparm["mcodes"] = mclist.ToArray(); //如果包含剂型分组,要并入列表一起进行评标--完 //加入匹配条件质量层次 elhtparm["levelid"] = EmedEvaluationProjectMapper.Get().QueryForObject<object>("ProjectProduct.queryforlevel", elhtparm); //根据是否采用标准化数据,用不同的sql语句查找企业列表 IList<IDictionary> enterpriselist = new List<IDictionary>(); if (IsStandard == 1) enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.queryenterpriseid", elhtparm); else { if (needregion) enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.queryenterpriseidex", elhtparm); else enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("ProjectProduct.queryenterpriseidexnoprice", elhtparm); } //根据是否采用标准化数据,用不同的sql语句查找企业列表--完 //开始构建核心table的自己产品那一行,其中第一列为企业信息,且为隐藏状态 StringBuilder EnterpriseList = new StringBuilder(); content.Append("<tr id='OwnProduct' class='sort'>"); Hashtable ecphtparm = new Hashtable(); ecphtparm["pid"] = Projectid.Value; ecphtparm["ec"] = itemid.Substring(15, 12); //string ownenterprise = (IsStandard == 1) ? new EnterpriseCodeDao().FindByEnterpiseCode(itemid.Substring(15, 12)).First().Enterprise : EmedEvaluationProjectMapper.Get().QueryForObject<string>("EnterpriseCodeProject.Findename",ecphtparm); string ownenterprise = new EnterpriseCodeDao().FindByEnterpiseCode(itemid.Substring(15, 12)).First().Enterprise; EnterpriseList.Append("<tr><td>" + ownenterprise + "</td></tr>"); if (IsStandard == 1) content.Append("<td nowrap='nowrap' id='Own' style='display:none;'>" + ownenterprise + "<input type='hidden' class='pc' value='" + itemid + "' /><input type='hidden' export='excel' value='" + ownenterprise + "' /></td>"); else { if (needregion) content.Append("<td nowrap='nowrap' id='Own' style='display:none;'>" + ownenterprise + "<input type='hidden' class='pc' value='" + medicineinfo["StandardProductCode"] + "' /><input type='hidden' export='excel' value='" + ownenterprise + "' /></td>"); else content.Append("<td nowrap='nowrap' id='Own' style='display:none;'>" + ownenterprise + "<input type='hidden' class='pc' value='" + medicineinfo["ProductCode"] + "' /><input type='hidden' export='excel' value='" + ownenterprise + "' /></td>"); } //开始构建指标分项以及分值输入框 foreach (PointCategory p in pointcategorylist) { IList<Point> plist = new PointDao().FindByCategoryID(p.ID); foreach (Point pp in plist) { IList<SmallPoint> splist = new SmallPointDao().FindByPointID(pp.ID); content.Append("<td nowrap='nowrap' eid='" + itemid.Substring(15, 12) + "' class='" + pp.ID + "'>"); string defaultvalue = string.Empty; if (pp.Method != 3) { char sptitle = 'A'; foreach (SmallPoint sp in splist) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); defaultvalue = sp.Score.Value.ToString(); } else content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); /*if (sp.Name.Length <= 8) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; } else { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; }*/ sptitle = (char)(((int)sptitle) + 1); } if (pp.FormatID == null) content.Append("<div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'><input type='button' class='queryprice' value='测算报价'/><br /><label style='color:'red;'>输入价格:</label><input Format='1' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div></td>"); } } else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'>" + pp.ExtraHtml + "<label style='color:'red;'>输入数值:</label><input Format='0' Method='" + pp.Method + "' type='text' paramnum='" + pp.ParamNum + "' class='inputscore' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div><div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' Method='" + pp.Method + "' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); } } } //开始构建指标分项以及分值输入框--完 //每种指标分类的总分列 foreach (PointCategory p in pointcategorylist) { content.Append("<td export='excel' nowrap='nowrap' percent='" + p.Percentage + "' class='eachcategory' Category='" + p.ID + "'></td>"); } //每种指标分类的总分列--完 //是否技术标,table列有所区别 if (IsBest == 1) content.Append("<td export='excel' nowrap='nowrap' class='Quote'></td><td export='excel' class='best' nowrap='nowrap'></td><td export='excel' nowrap='nowrap' class='result'></td></tr>"); else content.Append("<td export='excel' nowrap='nowrap' class='Quote'></td><td export='excel' nowrap='nowrap' class='result'></td></tr>"); //开始构建其他竞品 foreach (IDictionary enterprise in enterpriselist) { string enterid = enterprise["EnterpiseCode"].ToString(); EnterpriseList.Append("<tr><td>" + enterprise["enterprise"] + "</td></tr>"); content.Append("<tr class='sort'>"); content.Append("<td nowrap='nowrap' style='display:none'>" + enterprise["enterprise"] + "<input type='hidden' class='pc' value='" + enterprise["ProductCode"].ToString() + "' /><input type='hidden' export='excel' value='" + enterprise["enterprise"] + "' /></td>"); foreach (PointCategory p in pointcategorylist) { IList<Point> plist = new PointDao().FindByCategoryID(p.ID); foreach (Point pp in plist) { IList<SmallPoint> splist = new SmallPointDao().FindByPointID(pp.ID); content.Append("<td nowrap='nowrap' eid='" + enterid + "' class='" + pp.ID + "'>"); string defaultvalue = string.Empty; if (pp.Method != 3) { char sptitle = 'A'; foreach (SmallPoint sp in splist) { /*if (sp.Name.Length <= 8) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; } else { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; defaultvalue = sp.Score.Value.ToString(); } else { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; } }*/ if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); defaultvalue = sp.Score.Value.ToString(); } else content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); sptitle = (char)(((int)sptitle) + 1); } if (pp.FormatID == null) content.Append("<div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' value='" + defaultvalue + "' /><div></td>"); else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'><input type='button' class='queryprice' value='测算报价'/><br /><label style='color:'red;'>输入价格:</label><input Format='1' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' /><input type='hidden' class='format' value='" + format["code"] + "' /><div></td>"); } } else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'>" + pp.ExtraHtml + "<label style='color:'red;'>输入数值:</label><input Format='0' Method='" + pp.Method + "' type='text' paramnum='" + pp.ParamNum + "' class='inputscore' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div><div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' Method='" + pp.Method + "' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); } } } foreach (PointCategory p in pointcategorylist) { content.Append("<td export='excel' nowrap='nowrap' percent='" + p.Percentage + "' class='eachcategory' Category='" + p.ID + "'></td>"); } if (IsBest == 1) content.Append("<td export='excel' nowrap='nowrap' class='Quote'></td><td export='excel' class='best' nowrap='nowrap'></td><td export='excel' nowrap='nowrap' class='result'></td></tr>"); else content.Append("<td export='excel' nowrap='nowrap' class='Quote'></td><td export='excel' nowrap='nowrap' class='result'></td></tr>"); } //开始构建其他竞品--完 //如果有评测报价,初始化省份地区 if (needregion) { ViewData["Regionhtml"] = GetCityRegion(); } ViewData["content"] = content.ToString(); ViewData["EnterpriseList"] = EnterpriseList.ToString(); ViewData["formurl"] = "/SimulationE/Export.mvc/" + Projectid.Value + "/" + itemid; return View(); }
public ActionResult Step4(int? Projectid, string itemid, int? scene, FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["uid"] = sitemaster["userid"]; bool needregion = false; //此项目是否启用标准化 Project pro = new ProjectDao().Find(Projectid.Value); int IsStandard = pro.IsStandard; Hashtable ht = new Hashtable(); ht["pid"] = Projectid.Value; ht["itemid"] = itemid; IDictionary medicineinfo = (IsStandard == 1) ? StandardDataMapper.Get().QueryForObject<IDictionary>("CompareData.ListSingleName", itemid) : EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("CompareDataProject.ListSingleName", ht); ViewData["ProjectRule"] = pro.ProjectRule; ViewData["medicineinfo"] = medicineinfo; ViewData["Projectid"] = Projectid.Value; ViewData["IsBusseniss"] = pro.IsBussiness * pro.IsBest; int IsBest = pro.IsBest; ViewData["IsBest"] = pro.IsBest; ViewData["ProductID"] = itemid; ViewData["Detail"] = ""; if (scene != null) { ViewData["Detail"] = EmedEvaluationProjectMapper.Get().QueryForObject<string>("Scene.FindByScenceNo", scene.Value); } IList<PointCategory> pointcategorylist = new PointCategoryDao().FindByProjectOid(Projectid.Value); StringBuilder CategoryHtml = new StringBuilder(); StringBuilder PointHtml = new StringBuilder(); int totalpointNum = 0; foreach (PointCategory p in pointcategorylist) { if (p.Name == "价格分") needregion = true; int pointnum = EmedEvaluationProjectMapper.Get().QueryForObject<int>("Point.count", p.ID); IList<Point> plist = new PointDao().FindByCategoryID(p.ID); int count = 0; foreach (Point pp in plist) { count++; if (pp.Iseorp == 1) PointHtml.Append("<td nowrap='nowrap'><Label style='cursor:pointer;text-decoration:underline;' class='pointdetail'>指标" + count + "</Lable><input type='hidden' class='pointname' value='" + pp.Name + "' /><br /><input pointid='" + pp.ID + "' class='usedatabase' type='button' value='自动打分' Field='" + pp.Field + "' Eorp='" + pp.EORP + "'></td>"); else PointHtml.Append("<td nowrap='nowrap'><Label style='cursor:pointer;text-decoration:underline;' class='pointdetail'>指标" + count + "</Lable><input type='hidden' class='pointname' value='" + pp.Name + "' /></td>"); } CategoryHtml.Append("<td class='bidpoint' nowrap='nowrap' colspan='" + pointnum + "'>" + p.Name + "</td>"); totalpointNum += pointnum; } string temp = string.Empty; foreach (PointCategory p in pointcategorylist) { if (p.Name != "价格分") temp += p.Name + "+"; PointHtml.Append("<td nowrap='nowrap'>" + p.Name + "(总计)" + "</td>"); } PointHtml.Append("<td nowrap='nowrap'>" + temp.Substring(0, temp.Length - 1) + "</td>"); ViewData["CategoryHtml"] = CategoryHtml.ToString(); ViewData["CategoryCount"] = totalpointNum; if (IsBest == 1) ViewData["ScoreCount"] = pointcategorylist.Count + 5; else ViewData["ScoreCount"] = pointcategorylist.Count + 4; ViewData["PointHtml"] = PointHtml.ToString(); StringBuilder content = new StringBuilder(); Hashtable elhtparm = new Hashtable(); //elhtparm["pc"]=itemid.Substring(0,15); elhtparm["pid"] = Projectid.Value; elhtparm["ownitem"] = itemid; elhtparm["ownid"] = itemid.Substring(15, 12); elhtparm["uid"] = sitemaster["userid"]; //IList<int> enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<int>("AuthorizationProject.queryenterpriseid", elhtparm); List<string> mclist = new List<string>(); mclist.Add(itemid.Substring(0, 15)); elhtparm["mcodes"] = mclist.ToArray(); IList<IDictionary> enterpriselist = new List<IDictionary>(); if (IsStandard == 1) enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("SelfDefineCompete.queryenterpriseid", elhtparm); else enterpriselist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("SelfDefineCompete.queryenterpriseidex", elhtparm); StringBuilder EnterpriseList = new StringBuilder(); content.Append("<tr id='OwnProduct' class='sort'>"); Hashtable ecphtparm = new Hashtable(); ecphtparm["pid"] = Projectid.Value; ecphtparm["ec"] = itemid.Substring(15, 12); //string ownenterprise = (IsStandard == 1) ? new EnterpriseCodeDao().FindByEnterpiseCode(itemid.Substring(15, 12)).First().Enterprise : EmedEvaluationProjectMapper.Get().QueryForObject<string>("EnterpriseCodeProject.Findename",ecphtparm); string ownenterprise = new EnterpriseCodeDao().FindByEnterpiseCode(itemid.Substring(15, 12)).First().Enterprise; EnterpriseList.Append("<tr><td>" + ownenterprise + "</td></tr>"); if (IsStandard == 1) content.Append("<td nowrap='nowrap' id='Own' style='display:none;'>" + ownenterprise + "<input type='hidden' class='pc' value='" + itemid + "' /><input type='hidden' export='excel' value='" + ownenterprise + "' /></td>"); else content.Append("<td nowrap='nowrap' id='Own' style='display:none;'>" + ownenterprise + "<input type='hidden' class='pc' value='" + medicineinfo["StandardProductCode"] + "' /><input type='hidden' export='excel' value='" + ownenterprise + "' /></td>"); foreach (PointCategory p in pointcategorylist) { IList<Point> plist = new PointDao().FindByCategoryID(p.ID); foreach (Point pp in plist) { IList<SmallPoint> splist = new SmallPointDao().FindByPointID(pp.ID); content.Append("<td nowrap='nowrap' eid='" + itemid.Substring(15, 12) + "' class='" + pp.ID + "'>"); string defaultvalue = string.Empty; if (pp.Method != 3) { char sptitle = 'A'; foreach (SmallPoint sp in splist) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); defaultvalue = sp.Score.Value.ToString(); } else content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); /*if (sp.Name.Length <= 8) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; } else { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + itemid.Substring(15, 12) + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; }*/ sptitle = (char)(((int)sptitle) + 1); } if (pp.FormatID == null) content.Append("<div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div class='formatinfo'>等待报价前评分</div><div class='formatrealcontent' style='display:none;margin-top:20px;'><input type='button' class='queryprice' value='测算报价'/><br /><label style='color:'red;'>输入价格:</label><input Format='1' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div></td>"); } } else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'>" + pp.ExtraHtml + "<label style='color:'red;'>输入数值:</label><input Format='0' Method='" + pp.Method + "' type='text' paramnum='" + pp.ParamNum + "' class='inputscore' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div><div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' Method='" + pp.Method + "' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); } } } foreach (PointCategory p in pointcategorylist) { content.Append("<td export='excel' nowrap='nowrap' percent='" + p.Percentage + "' class='eachcategory' Category='" + p.ID + "'></td>"); } content.Append("<td export='excel' nowrap='nowrap' class='littlesum'></td>"); if (IsBest == 1) content.Append("<td export='excel' class='best' nowrap='nowrap'></td><td export='excel' nowrap='nowrap' class='result'></td><td export='excel' nowrap='nowrap' class='Quote'></td>"); else content.Append("<td export='excel' nowrap='nowrap' class='result'></td><td export='excel' nowrap='nowrap' class='Quote'></td>"); content.Append("<td export='excel' nowrap='nowrap' class='bidresult'></td></tr>"); foreach (IDictionary enterprise in enterpriselist) { string enterid = enterprise["EnterpiseCode"].ToString(); EnterpriseList.Append("<tr><td>" + enterprise["enterprise"] + "</td></tr>"); content.Append("<tr class='sort'>"); content.Append("<td nowrap='nowrap' style='display:none'>" + enterprise["enterprise"] + "<input type='hidden' class='pc' value='" + enterprise["OtherProductcode"].ToString() + "' /><input type='hidden' export='excel' value='" + enterprise["enterprise"] + "' /></td>"); foreach (PointCategory p in pointcategorylist) { IList<Point> plist = new PointDao().FindByCategoryID(p.ID); foreach (Point pp in plist) { IList<SmallPoint> splist = new SmallPointDao().FindByPointID(pp.ID); content.Append("<td nowrap='nowrap' eid='" + enterid + "' class='" + pp.ID + "'>"); string defaultvalue = string.Empty; if (pp.Method != 3) { char sptitle = 'A'; foreach (SmallPoint sp in splist) { /*if (sp.Name.Length <= 8) { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; defaultvalue = sp.Score.Value.ToString(); } else content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name + "<br />"; } else { if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; defaultvalue = sp.Score.Value.ToString(); } else { content += "<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' />" + sp.Name.Substring(0, 8) + "..." + "<Span><Label style='font-style:italic;cursor:pointer;text-decoration:underline;' class='smallpointdetail'>详细</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"; } }*/ if (sp.IsDefault.HasValue && sp.IsDefault.Value == 1) { content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='checked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); defaultvalue = sp.Score.Value.ToString(); } else content.Append("<input BigCategory='" + p.ID + "' Score='" + sp.Score + "' type='radio' checked='unchecked' class='smallpoint' name='" + enterid + sp.PointID + "' value='" + sp.Score + "' /><Span><Label style='cursor:pointer;text-decoration:underline;' class='smallpointdetail'>" + sptitle + ".</Label><input type='hidden' class='pointname' value='" + sp.Name + "' /></Span><br />"); sptitle = (char)(((int)sptitle) + 1); } if (pp.FormatID == null) content.Append("<div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' value='" + defaultvalue + "' /><div></td>"); else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div class='formatinfo'>等待报价前评分</div><div class='formatrealcontent' style='display:none;margin-top:20px;'><input type='button' class='queryprice' value='测算报价'/><br /><label style='color:'red;'>输入价格:</label><input Format='1' CategoryScore='" + p.ID + "' type='text' export='excel' class='score' size='6' /><input type='hidden' class='format' value='" + format["code"] + "' /><div></td>"); } } else { IDictionary format = EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("Format.GetFormat", pp.FormatID); content.Append("<div style='margin-top:20px;'>" + pp.ExtraHtml + "<label style='color:'red;'>输入数值:</label><input Format='0' Method='" + pp.Method + "' type='text' paramnum='" + pp.ParamNum + "' class='inputscore' size='6'/><input keyword='" + format["keyword"] + "' type='hidden' class='format' value='" + format["code"] + "' /></div><div style='margin-top:20px;'><label style='color:'red;'>得分:</label><input Format='0' CategoryScore='" + p.ID + "' type='text' Method='" + pp.Method + "' export='excel' class='score' size='6' value='" + defaultvalue + "'/><div></td>"); } } } foreach (PointCategory p in pointcategorylist) { content.Append("<td export='excel' nowrap='nowrap' percent='" + p.Percentage + "' class='eachcategory' Category='" + p.ID + "'></td>"); } content.Append("<td export='excel' nowrap='nowrap' class='littlesum'></td>"); if (IsBest == 1) content.Append("<td export='excel' class='best' nowrap='nowrap'></td><td export='excel' nowrap='nowrap' class='result'></td><td export='excel' nowrap='nowrap' class='Quote'></td>"); else content.Append("<td export='excel' nowrap='nowrap' class='result'></td><td export='excel' nowrap='nowrap' class='Quote'></td>"); content.Append("<td export='excel' nowrap='nowrap' class='bidresult'></td></tr>"); } if (needregion) { ViewData["Regionhtml"] = GetCityRegion(); } ViewData["content"] = content.ToString(); ViewData["EnterpriseList"] = EnterpriseList.ToString(); ViewData["formurl"] = "/SimulationE/Export.mvc/" + Projectid.Value + "/" + itemid; return View(); }
public ActionResult AllProjectMedicine(int? projectid, int? id, string parm, FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; if (Int32.Parse(sitemaster["isadmin"]) == 5) { Dictionary<string, string> dict = ParmHelper.Analysis(collection); //如果是刚打开页面 if (dict.Count == 0 && parm == null) { int PageNo = id ?? 1; Hashtable htparm = new Hashtable(); htparm["start"] = PageSizeList * (id - 1) + 1; //记录开始数 htparm["end"] = id * PageSizeList; //记录结束数 htparm["pid"] = projectid.Value; IList<string> list = EmedEvaluationProjectMapper.Get().QueryForList<string>("ProjectMedicine.ListMedicineCode", htparm); IList<IDictionary> resultlist = new List<IDictionary>(); if (list.Count != 0) { htparm["ids"] = list.ToArray(); htparm["start"] = 1; htparm["end"] = 20; resultlist = StandardDataMapper.Get().QueryForList<IDictionary>("CompareMedicine.ListMedicine", htparm); } ViewData["ProjectDescription"] = new ProjectDao().Find(projectid.Value).Name; ViewData["Summary"] = new ProjectDao().Find(projectid.Value).Description; ViewData["OID"] = projectid.Value; int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("ProjectMedicine.ListMedicineCodeCount", projectid.Value); ; ViewData["Count"] = count; PagedList<IDictionary> plist = new PagedList<IDictionary>(resultlist, PageNo, PageSizeList, count); return View(plist); } //如果有查询参数了 if (dict.Count == 0 && parm != null) { Dictionary<string, string> use = ParmHelper.AnalysisParm(parm); int PageNo = id ?? 1; IList<string> list = EmedEvaluationProjectMapper.Get().QueryForList<string>("ProjectMedicine.ListMedicineCode", projectid.Value); Hashtable htparm = new Hashtable(); htparm["ids"] = list.ToArray(); htparm["name"] = use["CommonName"]; htparm["start"] = PageSizeList * (id - 1) + 1; //记录开始数 htparm["end"] = id * PageSizeList; //记录结束数 IList<IDictionary> resultlist = StandardDataMapper.Get().QueryForList<IDictionary>("CompareData.ListMedicine", htparm); ViewData["ProjectDescription"] = new ProjectDao().Find(projectid.Value).Name; ViewData["Summary"] = new ProjectDao().Find(projectid.Value).Description; ViewData["OID"] = projectid.Value; ViewData["Form"] = use; int count = list.Count; PagedList<IDictionary> plist = new PagedList<IDictionary>(resultlist, PageNo, PageSizeList, count); return View(plist); } else { //把表单转为参数 if (dict.Count != 0) { string parmeter = ParmHelper.BuildParm(dict); return RedirectToAction("AllProjectMedicine", new { id = 1, parm = parmeter }); } } } else return RedirectToAction("MemberLevelError", "Base"); return View(); }
public ActionResult ProjectSurvey(int? Page, string Param, FormCollection FormData) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; int PageNo = Page ?? 1; int PageSize = 10; int DataCount = 0; Dictionary<string, string> FormDict = ParmHelper.Analysis(FormData); ProjectDao ProjectD = new ProjectDao(); ViewData["UserId"] = sitemaster["userid"]; if (FormDict.Count == 0 && Param == null) { IList<IDictionary> DataList = ProjectD.DataList<IDictionary>(PageNo, PageSize, out DataCount, null); PagedList<IDictionary> PageList = new PagedList<IDictionary>(DataList, PageNo, PageSize, DataCount); ViewData["DataCount"] = DataCount; return View(PageList); } //如果有查询参数了 if (FormDict.Count == 0 && Param != null) { Dictionary<string, string> Dict = ParmHelper.AnalysisParm(Param); IList<IDictionary> DataList = ProjectD.DataList<IDictionary>(PageNo, PageSize, out DataCount, Dict); PagedList<IDictionary> PageList = new PagedList<IDictionary>(DataList, PageNo, PageSize, DataCount); ViewData["Form"] = Dict; ViewData["DataCount"] = DataCount; return View(PageList); } else { //把表单转为参数 if (FormDict.Count != 0) { string Parameter = ParmHelper.BuildParm(FormDict); return RedirectToAction("ProjectSurvey", new { Page = 1, Param = Parameter }); } } return View(); }
public FileResult SurveyExport(string ExportType, FormCollection FormData) { Dictionary<string, string> sitemaster = GetSiteMaster(); int UserId = Convert.ToInt32(sitemaster["userid"]); Dictionary<string, string> FormDict = ParmHelper.Analysis(FormData); ProjectDao ProjectD = new ProjectDao(); ScheduleDao SchDao = new ScheduleDao(); IList<IDictionary> ProjectList = ProjectD.ProjectExport<IDictionary>(FormDict); DateTime Now = DateTime.Now; DateTime DateStart = Now; DateTime DateEnd = Now; switch (ExportType) { case "day": DateStart = Convert.ToDateTime(Now.ToShortDateString() + " 00:00"); DateEnd = Convert.ToDateTime(Now.ToShortDateString() + " 23:59"); break; case "week": DateStart = Now.AddDays(1 - Convert.ToInt32(Now.DayOfWeek.ToString("d"))); DateEnd = DateStart.AddDays(6); break; case "month": DateStart = Now.AddDays(1 - Now.Day); DateEnd = Now.AddMonths(1).AddDays(-1); break; default: break; } string result = string.Empty; foreach (var Project in ProjectList) { IList<IDictionary> DayScheduleList = SchDao.GetDateSchedule<IDictionary>(Convert.ToInt32(Project["Id"]), UserId, DateStart, DateEnd); //if (DayScheduleList.Count > 0) //{ result += ExportStr(Project, DayScheduleList); //} } byte[] data = Encoding.UTF8.GetBytes(result.ToString()); return File(data, "application/ms-excel", "export.xls"); }
public JsonResult ListProjectRuleGroup(string projectid) { string strlist = string.Empty; if (projectid != "0") { IList<ProjectRule> list = new ProjectRuleDao().FindByProjectID(Int32.Parse(projectid)); string projectname = new ProjectDao().Find(Int32.Parse(projectid)).Name; foreach (ProjectRule p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='ruleeachone'><input type='hidden' class='hidrulegroupID' value='" + p.ID + "'</td>"; strlist += "<td>" + p.Total + "</td>"; strlist += "<td>" + p.Rest + "</td>"; strlist += "<td>" + projectname + "</td>"; strlist += "</tr>"; } } return Json(strlist); }
public JsonResult ListSingleProject(string pid) { int p = Int32.Parse(pid); Project pro = new ProjectDao().Find(p); string NewBiddingDate = string.Empty; string NewPriceTimeFrom = string.Empty; string FromHour = string.Empty; string FromMin = string.Empty; string NewPriceTimeTo = string.Empty; string ToHour = string.Empty; string ToMin = string.Empty; string NewOpeningTime = string.Empty; string OpeningHour = string.Empty; string OpeningMin = string.Empty; if (pro.AnounceDate.HasValue) { NewBiddingDate = pro.AnounceDate.Value.ToShortDateString(); } if (pro.PriceTimeFrom.HasValue) { NewPriceTimeFrom = pro.PriceTimeFrom.Value.ToShortDateString(); FromHour = pro.PriceTimeFrom.Value.Hour.ToString(); FromMin = pro.PriceTimeFrom.Value.Minute.ToString(); } if (pro.PriceTimeTo.HasValue) { NewPriceTimeTo = pro.PriceTimeTo.Value.ToShortDateString(); ToHour = pro.PriceTimeTo.Value.Hour.ToString(); ToMin = pro.PriceTimeTo.Value.Minute.ToString(); } if (pro.OpeningTime.HasValue) { NewOpeningTime = pro.OpeningTime.Value.ToShortDateString(); OpeningHour = pro.OpeningTime.Value.Hour.ToString(); OpeningMin = pro.OpeningTime.Value.Minute.ToString(); } return Json(new { NewProjectName = pro.Name, Desc = pro.Description, Source = pro.Original, NewRegion = pro.Region, NewStatus = pro.Status, NewBiddingDate = NewBiddingDate, NewPriceTimeFrom = NewPriceTimeFrom, FromHour = FromHour, FromMin = FromMin, NewPriceTimeTo = NewPriceTimeTo, ToHour = ToHour, ToMin = ToMin, NewOpeningTime = NewOpeningTime, OpeningHour = OpeningHour, OpeningMin = OpeningMin }); }
//导出表格 public ActionResult Export(int? projectid, string itemid, FormCollection collection) { int IsStandard = new ProjectDao().Find(projectid.Value).IsStandard; Hashtable ht = new Hashtable(); ht["pid"] = projectid.Value; ht["itemid"] = itemid; IDictionary medicineinfo = (IsStandard == 1) ? StandardDataMapper.Get().QueryForObject<IDictionary>("CompareData.ListSingleName", itemid) : EmedEvaluationProjectMapper.Get().QueryForObject<IDictionary>("CompareDataProject.ListSingleName", ht); if (collection.Count != 0 && collection["excel"] == "1") { ExcelExport mx = new ExcelExport(); mx.InitTh(); mx._fileName = medicineinfo["ChineseProductName"].ToString() + DateTime.Now.ToShortDateString() + ".xls"; //项目名称 TableItemStyle tiName = new TableItemStyle(); tiName.Font.Size = 14; tiName.ForeColor = System.Drawing.Color.Red; tiName.HorizontalAlign = HorizontalAlign.Center; mx.HeadExtrInfo.Add("评价药品:" + medicineinfo["ChineseProductName"] + medicineinfo["Formulation"] + medicineinfo["ChineseSpecification"] + medicineinfo["ChineseManufactureName"], tiName); //得到第二行表头名称 TableItemStyle tiSecondName = new TableItemStyle(); tiSecondName.Font.Size = 14; tiSecondName.ForeColor = System.Drawing.Color.Black; tiSecondName.HorizontalAlign = HorizontalAlign.Center; mx.SecondExtrInfo.Add(collection["secondhead"], tiSecondName); string[] spanlist = collection["spanlist"].Split(','); string[] header = collection["header"].Split(','); string[] bodycontent = collection["content"].Split('|'); List<Dictionary<string, string>> list = new List<Dictionary<string, string>>(); foreach (string bc in bodycontent) { string[] each = bc.Split('^'); Dictionary<string, string> contentdict = new Dictionary<string, string>(); int count = 0; foreach (string e in each) { contentdict.Add(header[count], e); count++; } list.Add(contentdict); } DataTable data = new DataTable(); data = ConvertTo(header, list); mx.DataTableToExcelForSimulate(data, spanlist); } return View(); }
/*public ActionResult Detail(int? id,int?PageNo,string parm,FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; //此项目是否启用标准化 int IsStandard = new ProjectDao().Find(id.Value).IsStandard; PageSizeList = 50; int page = PageNo ?? 1; int userid = Int32.Parse(CurrentUserInfo.UserID); Hashtable ecechtparm = new Hashtable(); ecechtparm["pid"] = id.Value; ecechtparm["name"] = EnterPriseMemberInfo.EnterpriseName; EnterpriseCode ec = (IsStandard == 1) ? new EnterpriseCodeDao().FindByEnterprise(EnterPriseMemberInfo.EnterpriseName).First() : EmedEvaluationProjectMapper.Get().QueryForObject<EnterpriseCode>("EnterpriseCodeProject.Findecode", ecechtparm); int eid = ec.ID; Hashtable ht = new Hashtable(); ht["eid"] = eid; ht["pid"] = id.Value; int scenecount = EmedEvaluationProjectMapper.Get().QueryForObject<int>("Scene.AllCount", ht); StringBuilder html = new StringBuilder(); //string html = string.Empty; if (scenecount > 0) { IList<IDictionary> scenelist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("Scene.AllScene", ht); if (IsStandard == 1) { foreach (IDictionary s in scenelist) { html.Append("<tr><td><a onclick='return false;' href='" + s["URL"] + "' class='scenelink' />" + s["SceneName"] + "</a></td>"); html.Append( "<td>" + new ProjectDao().Find(Int32.Parse(s["ProjectID"].ToString())).Name + "</td>"); html.Append("<td>" + StandardDataMapper.Get().QueryForObject<string>("CompareData.FindName", s["MedicineCode"].ToString()) + "</td>"); html.Append( "<td>" + (s["CreateTime"] != null ? s["CreateTime"].ToString() : "") + "</td>"); html.Append( "<td>" + (s["Description"] != null ? s["Description"].ToString() : "") + "</td></tr>"); } } else { Hashtable hparm = new Hashtable(); hparm["pid"] = id.Value; foreach (IDictionary s in scenelist) { html.Append( "<tr><td><a onclick='return false;' href='" + s["URL"] + "' class='scenelink' />" + s["SceneName"] + "</a></td>"); html.Append( "<td>" + new ProjectDao().Find(Int32.Parse(s["ProjectID"].ToString())).Name + "</td>"); hparm["mcode"] = s["MedicineCode"].ToString(); html.Append( "<td>" + EmedEvaluationProjectMapper.Get().QueryForObject<string>("CompareDataProject.FindName", hparm) + "</td>"); html.Append( "<td>" + (s["CreateTime"] != null ? s["CreateTime"].ToString() : "") + "</td>"); html.Append( "<td>" + (s["Description"] != null ? s["Description"].ToString() : "") + "</td></tr>"); } } } ViewData["html"] = html.ToString(); int memberid = ec.ID; Hashtable aphtparm=new Hashtable(); aphtparm["pid"] = id; aphtparm["eid"] = ec.ID; IList<string> medicinebaseidlist = EmedEvaluationProjectMapper.Get().QueryForList<string>("AuthorizationProject.queryid", aphtparm); /*IList<string> productbaselist = new List<string>(); foreach (string m in medicinebaseidlist) { productbaselist.Add(EmedEvaluationBaseMapper.Get().QueryForObject<string>("ChineseAndImportMed.GetMedicineCode",m)); } Hashtable htparm = new Hashtable(); htparm["pids"] = medicinebaseidlist; int count = medicinebaseidlist.Count; if (count == 0) { //如果生产企业,可以不需要授权 htparm["pid"]=id.Value; htparm["eccode"]=ec.EnterpiseCode; string[] idlist=EmedEvaluationProjectMapper.Get().QueryForList<string>("ProjectProduct.listproduct",htparm).ToArray(); htparm["pids"]=idlist; count = idlist.Length; } htparm["start"] = PageSizeList * (page - 1) + 1; //记录开始数 htparm["end"] = page * PageSizeList; //记录结束数 Dictionary<string, string> dict = ParmHelper.Analysis(collection); if (dict.Count == 0 && parm == null) { if (IsStandard == 1) { IList<IDictionary> medicinelist = StandardDataMapper.Get().QueryForList<IDictionary>("CompareData.ListMedicine", htparm); //int count = StandardDataMapper.Get().QueryForObject<int>("CompareData.ListMedicineCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinelist, page, PageSizeList, count); ViewData["Count"] = count; ViewData["Projectid"] = id.Value; return View(list); } else { htparm["pid"] = id.Value; IList<IDictionary> medicinelist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("CompareDataProject.ListMedicine", htparm); //int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("CompareDataProject.ListMedicineCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinelist, page, PageSizeList, count); ViewData["Count"] = count; ViewData["Projectid"] = id.Value; return View(list); } } if (dict.Count == 0 && parm != null) { Dictionary<string, string> use = ParmHelper.AnalysisParm(parm); ViewData["Form"] = use; foreach (KeyValuePair<string, string> k in use) { htparm.Add(k.Key, k.Value); } if (IsStandard == 1) { IList<IDictionary> medicinelist = StandardDataMapper.Get().QueryForList<IDictionary>("CompareData.ListMedicine", htparm); int parmcount = StandardDataMapper.Get().QueryForObject<int>("CompareData.ListMedicineCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinelist, page, PageSizeList, parmcount); ViewData["Count"] = parmcount; ViewData["Projectid"] = id.Value; return View(list); } else { htparm["pid"] = id.Value; IList<IDictionary> medicinelist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("CompareDataProject.ListMedicine", htparm); int parmcount = EmedEvaluationProjectMapper.Get().QueryForObject<int>("CompareDataProject.ListMedicineCount", htparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinelist, page, PageSizeList, parmcount); ViewData["Count"] = count; ViewData["Projectid"] = id.Value; return View(list); } } else { if (dict.Count != 0) { string parmeter = ParmHelper.BuildParm(dict); return RedirectToAction("Detail", new { id = id.Value,PageNo=1, parm = parmeter }); } } return View(); }*/ public ActionResult Detail(int? id, int? PageNo, string parm, FormCollection collection) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; //此项目是否启用标准化 Project pro = new ProjectDao().Find(id.Value); int IsStandard = pro.IsStandard; ViewData["IsBusseniss"] = pro.IsBussiness * pro.IsBest;//根据是否商务标确定下一步评标用哪个aspx(判断在前台) PageSizeList = 20; int page = PageNo ?? 1; int userid = Int32.Parse(CurrentUserInfo.UserID); Hashtable ecechtparm = new Hashtable(); ecechtparm["pid"] = id.Value; ecechtparm["name"] = EnterPriseMemberInfo.EnterpriseName; int eid = 0; //if(IsStandard == 1) //{ EnterpriseCode ec = new EnterpriseCodeDao().FindByEnterprise(EnterPriseMemberInfo.EnterpriseName).First(); eid = ec.ID; //} //else //{ // EnterpriseCodeProject ec = EmedEvaluationProjectMapper.Get().QueryForObject<EnterpriseCodeProject>("EnterpriseCodeProject.Findecode", ecechtparm); //eid = ec.ID; //} //获得场景列表 Hashtable ht = new Hashtable(); ht["eid"] = eid; ht["pid"] = id.Value; int scenecount = EmedEvaluationProjectMapper.Get().QueryForObject<int>("Scene.AllCount", ht); StringBuilder html = new StringBuilder(); //string html = string.Empty; if (scenecount > 0) { IList<IDictionary> scenelist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("Scene.AllScene", ht); if (IsStandard == 1) { foreach (IDictionary s in scenelist) { html.Append("<tr><td><a onclick='return false;' href='" + s["URL"] + "' class='scenelink' />" + s["SceneName"] + "</a></td>"); html.Append("<td>" + new ProjectDao().Find(Int32.Parse(s["ProjectID"].ToString())).Name + "</td>"); html.Append("<td>" + StandardDataMapper.Get().QueryForObject<string>("CompareData.FindName", s["MedicineCode"].ToString()) + "</td>"); html.Append("<td>" + (s["CreateTime"] != null ? s["CreateTime"].ToString() : "") + "</td>"); html.Append("<td>" + (s["Description"] != null ? s["Description"].ToString() : "") + "</td></tr>"); } } else { Hashtable hparm = new Hashtable(); hparm["pid"] = id.Value; foreach (IDictionary s in scenelist) { html.Append("<tr><td><a onclick='return false;' href='" + s["URL"] + "' class='scenelink' />" + s["SceneName"] + "</a></td>"); html.Append("<td>" + new ProjectDao().Find(Int32.Parse(s["ProjectID"].ToString())).Name + "</td>"); hparm["mcode"] = s["MedicineCode"].ToString(); html.Append("<td>" + EmedEvaluationProjectMapper.Get().QueryForObject<string>("CompareDataProject.FindName", hparm) + "</td>"); html.Append("<td>" + (s["CreateTime"] != null ? s["CreateTime"].ToString() : "") + "</td>"); html.Append("<td>" + (s["Description"] != null ? s["Description"].ToString() : "") + "</td></tr>"); } } } ViewData["html"] = html.ToString(); //获得场景列表--完 //int memberid = ec.ID; //得到授权产品的列表 Hashtable aphtparm = new Hashtable(); aphtparm["pid"] = id; aphtparm["eid"] = eid; aphtparm["start"] = PageSizeList * (page - 1) + 1; //记录开始数 aphtparm["end"] = page * PageSizeList; //记录结束数 Dictionary<string, string> dict = ParmHelper.Analysis(collection); if (dict.Count == 0 && parm == null) { IList<IDictionary> medicinebaseidlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("AuthorizationProject.queryid", aphtparm); int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("AuthorizationProject.queryidcount", aphtparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinebaseidlist, page, PageSizeList, count); for (int i = 0; i < list.Count; i++) { Hashtable htc = new Hashtable(); htc["pid"] = aphtparm["pid"]; htc["itemid"] = list[i]["ProductCode"].ToString().Substring(0, 15); list[i]["CompeteCount"] = EmedEvaluationProjectMapper.Get().QueryForObject<int>("CompareDataProject.GetCompeteCount", htc); } ViewData["Count"] = count; ViewData["Projectid"] = id.Value; return View(list); } if (dict.Count == 0 && parm != null) { Dictionary<string, string> use = ParmHelper.AnalysisParm(parm); ViewData["Form"] = use; foreach (KeyValuePair<string, string> k in use) { aphtparm.Add(k.Key, k.Value); } IList<IDictionary> medicinebaseidlist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("AuthorizationProject.queryid", aphtparm); int count = EmedEvaluationProjectMapper.Get().QueryForObject<int>("AuthorizationProject.queryidcount", aphtparm); PagedList<IDictionary> list = new PagedList<IDictionary>( medicinebaseidlist, page, PageSizeList, count); for (int i = 0; i < list.Count; i++) { Hashtable htc = new Hashtable(); htc["pid"] = aphtparm["pid"]; htc["itemid"] = list[i]["ProductCode"].ToString().Substring(0, 15); list[i]["CompeteCount"] = EmedEvaluationProjectMapper.Get().QueryForObject<int>("CompareDataProject.GetCompeteCount", htc); } ViewData["Count"] = count; ViewData["Projectid"] = id.Value; return View(list); } else { if (dict.Count != 0) { string parmeter = ParmHelper.BuildParm(dict); return RedirectToAction("Detail", new { id = id.Value, PageNo = 1, parm = parmeter }); } } //得到授权产品的列表--完 return View(); }
//数据库自动打分 public JsonResult GetDateBase(string cids, string field, string pid, string eorp, string projectid) { int flag = -1; //找到指标计算方法 List<string> finalscore = new List<string>(); int projid = Int32.Parse(projectid); //此项目是否启用标准化 int IsStandard = new ProjectDao().Find(projid).IsStandard; int p = Int32.Parse(pid); int Method = EmedEvaluationProjectMapper.Get().QueryForObject<int>("Point.GetMethod", p); string nodatacompany = string.Empty; //拼接企业code的sql字符串 string cidlist = "("; string[] tempids = cids.Trim(',').Split(','); foreach (string i in tempids) { cidlist += "'" + i + "',"; } cidlist = cidlist.Substring(0, cidlist.Length - 1); cidlist += ")"; //拼接企业code的sql字符串--完 //非主观分 if (Method != 4) { string[] clist = cids.Substring(0, cids.Length - 1).Split(','); //找到指标分项的KeyValue IList<IDictionary> keyvaluelist = EmedEvaluationProjectMapper.Get().QueryForList<IDictionary>("SmallPoint.GetKeyValue", p); if (keyvaluelist.Count > 0) flag = 1;//表明有指标分项,自动赋值要赋值radiobutton else flag = 0; SqlConnection sqlconn = new SqlConnection("Data Source=180.186.73.141;Initial Catalog=EmedEvaluationBase;Persist Security Info=True;User ID=DataCenter;Password=sqlpassword"); sqlconn.Open(); string strcommand1 = string.Empty; switch (eorp) { case "1": strcommand1 = "select " + field + ",EnterpriseCode from EnterpriseAttributeProject where ProjectID=" + projid + " and EnterpriseCode in" + cidlist + " order by CHARINDEX(','+ RTRIM(EnterpriseCode) + ',' , ',' + '" + cids.Substring(0, cids.Length - 1) + "' + ',')"; break; case "0": strcommand1 = "select " + field + ",ProductCode,Substring(ProductCode,16,12) as EnterpriseCode from ProductAttributeProject where ProjectID=" + projid + " and ProductCode in" + cidlist + " order by CHARINDEX(','+ RTRIM(productcode) + ',' , ',' + '" + cids.Substring(0, cids.Length - 1) + "' + ',')"; break; case "3": strcommand1 = "select " + field + ",EnterpriseCode from EnterpriseAttributeCommon where EnterpriseCode in" + cidlist + " order by CHARINDEX(','+ RTRIM(EnterpriseCode) + ',' , ',' + '" + cids.Substring(0, cids.Length - 1) + "' + ',')"; break; case "2": strcommand1 = "select " + field + ",ProductCode,Substring(ProductCode,16,12) as EnterpriseCode from ProductAttributeCommon where ProductCode in" + cidlist + " order by CHARINDEX(','+ RTRIM(productcode) + ',' , ',' + '" + cids.Substring(0, cids.Length - 1) + "' + ',')"; break; } SqlCommand sqlcomm = new SqlCommand(strcommand1, sqlconn); SqlDataReader reader = sqlcomm.ExecuteReader(); int num = 0; Hashtable htparm = new Hashtable(); htparm["pid"] = projid; while (reader.Read()) { switch (Method) { case 1: //区间求值 bool i = false; foreach (IDictionary k in keyvaluelist) { string[] ks = k["keyValue"].ToString().Split(','); if (float.Parse(reader[0].ToString()) <= float.Parse(ks[1]) && float.Parse(reader[0].ToString()) > float.Parse(ks[0].ToString())) { i = true; finalscore.Add(k["Score"].ToString()); break; } else continue; } if (!i) { htparm["ec"] = reader["EnterpriseCode"].ToString(); nodatacompany += new EnterpriseCodeDao().FindByEnterpiseCode(reader["EnterpriseCode"].ToString()).First().Enterprise + ","; finalscore.Add("0"); } break; case 2: //包含 bool j = false; foreach (IDictionary k in keyvaluelist) { if (k["keyValue"].ToString() == reader[0].ToString()) { j = true; finalscore.Add(k["Score"].ToString()); break; } else continue; } if (!j) { htparm["ec"] = reader["EnterpriseCode"].ToString(); nodatacompany += new EnterpriseCodeDao().FindByEnterpiseCode(reader["EnterpriseCode"].ToString()).First().Enterprise + ","; finalscore.Add("0"); } break; case 3: //公式 int additinal = 0; for (int k = num; k < clist.Length; k++) { if (k > 0 && clist[k] == clist[k - 1]) { finalscore.Add(finalscore[finalscore.Count - 1]); additinal++; continue; } if (reader[1].ToString() == clist[k]) { finalscore.Add(reader[0].ToString()); additinal++; break; } else { if (eorp == "1") { htparm["ec"] = clist[k]; nodatacompany += new EnterpriseCodeDao().FindByEnterpiseCode(clist[k]).First().Enterprise + ","; } else { htparm["ec"] = clist[k].Substring(15, 12); nodatacompany += new EnterpriseCodeDao().FindByEnterpiseCode(clist[k].Substring(15, 12)).First().Enterprise + ","; } finalscore.Add("暂无数据"); additinal++; continue; } } num = num + additinal; break; default: break; } } reader.Close(); sqlconn.Close(); } else { //主观分计算 flag = 3; SubjectPoint sp = new SubjectPointDao().FindByPointID(p).Single(); string[] ids = cids.Trim(',').Split(','); Hashtable hhtparm = new Hashtable(); foreach (string code in ids) { string ecode = code.Substring(15, 12); hhtparm["pid"] = Int32.Parse(projectid); hhtparm["ecode"] = ecode; IList<double> fds = EmedEvaluationProjectMapper.Get().QueryForList<double>("Expert.FindFD", hhtparm);//找到相应的专家行为分析数据 double score = 0; if (fds.Count != 0) score = sp.Average.Value + sp.MaxValue.Value * fds.First(); else { Hashtable htparm = new Hashtable(); htparm["pid"] = projid; htparm["ec"] = ecode; nodatacompany += new EnterpriseCodeDao().FindByEnterpiseCode(ecode).First().Enterprise + ","; } finalscore.Add(score.ToString()); } } string result = string.Empty; foreach (string s in finalscore) { result += s + ","; } return Json(new { result = result.Trim(','), flag = flag, nodatacompany = nodatacompany }); }
public JsonResult ListProject() { IList<Project> list = new ProjectDao().FindAll(); string strlist = string.Empty; string sellist = "<option value='0'>无</option>"; foreach (Project p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='projecteachone'><input type='hidden' class='hidID' value='" + p.ID + "'</td>"; strlist += "<td><a class='projectlink' href='javascript:void(0)'>" + p.Name + "</a></td>"; strlist += "<td>" + p.AnounceDate + "</td>"; strlist += "<td>" + p.PriceTimeFrom + "----" + p.PriceTimeTo + "</td>"; strlist += "<td>" + p.OpeningTime + "</td>"; strlist += "<td>" + p.Region + "</td>"; if (p.Status == 1) strlist += "<td><input class='projectstatus' type='button' value='停用' /></td>"; else strlist += "<td><input class='projectstatus' type='button' value='启用' /></td>"; strlist += "</tr>"; sellist += "<option value='" + p.ID + "'>" + p.Name + "</option>"; } return Json(new { table = strlist, select = sellist }); }
public JsonResult ListBehavior(string pid) { string strlist = string.Empty; if (pid != "0") { IList<Expert> list = new ExpertDao().FindByProjectID(Int32.Parse(pid)); string projectname = new ProjectDao().Find(Int32.Parse(pid)).Name; foreach (Expert p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='behavioreachone'><input type='hidden' class='hidbehaviorID' value='" + p.ID + "'</td>"; strlist += "<td>" + new EnterpriseCodeDao().FindByEnterpiseCode(p.EnterpriseCode).Single().Enterprise + "</td>"; strlist += "<td>" + p.Behavior + "</td>"; strlist += "<td>" + projectname + "</td>"; strlist += "</tr>"; } } return Json(strlist); }
public JsonResult ListProjectCategory(string projectid) { IList<PointCategory> list = new PointCategoryDao().FindByProjectOid(Int32.Parse(projectid)); string strlist = string.Empty; string sellist = "<option value='0'>无</option>"; if (list.Count != 0) { string projectname = new ProjectDao().Find(Int32.Parse(projectid)).Name; foreach (PointCategory p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='categoryeachone'><input type='hidden' class='hidcategoryID' value='" + p.ID + "'</td>"; strlist += "<td>" + projectname + "</td>"; strlist += "<td>" + p.Name + "</td>"; strlist += "<td>" + p.Description + "</td>"; strlist += "<td>" + p.Score + "</td>"; strlist += "<td>" + p.Percentage + "</td>"; strlist += "</tr>"; sellist += "<option value='" + p.ID + "'>" + p.Name + "</option>"; } } return Json(new { table = strlist, select = sellist }); }
public JsonResult ListProjectLevelGroup(string projectid) { IList<LevelGroup> list = new LevelGroupDao().FindByProjectOid(Int32.Parse(projectid)); string strlist = string.Empty; string projectname = new ProjectDao().Find(Int32.Parse(projectid)).Name; foreach (LevelGroup p in list) { strlist += "<tr class='content tr_bg'>"; strlist += "<td align='center'><input type='checkbox' class='levelgroupeachone'><input type='hidden' class='hidlevelgroupID' value='" + p.ID + "'</td>"; strlist += "<td>" + p.BigLevel + "</td>"; strlist += "<td>" + p.SmallLevel + "</td>"; strlist += "<td>" + projectname + "</td>"; strlist += "</tr>"; } return Json(strlist); }