public JsonResult ListProjectPoint(string categoryid)
        {
            if (categoryid != "0")
            {
                IList<Point> list = new PointDao().FindByCategoryID(Int32.Parse(categoryid));
                string strlist = string.Empty;
                string sellist = "<option value='0'>无</option>";
                string CategoryName = string.Empty;
                foreach (Point p in list)
                {
                    strlist += "<tr class='content tr_bg'>";
                    strlist += "<td align='center'><input type='checkbox' class='pointeachone'><input type='hidden' class='hidpointID' value='" + p.ID + "'</td>";
                    strlist += "<td>" + p.Name + "</td>";
                    CategoryName = new PointCategoryDao().Find(p.CategoryID.Value).Name;
                    strlist += "<td>" + CategoryName + "</td>";
                    strlist += "<td>" + p.Score + "</td>";
                    strlist += "<td>" + p.Status + "</td>";
                    strlist += "</tr>";

                    sellist += "<option value='" + p.ID + "'>" + p.Name + "</option>";

                }
                return Json(new { table = strlist, select = sellist });
            }
            return Json(new { table = "", select = "" });
        }
        //
        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 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 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();
        }