public ActionResult BonusPointData_10() { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; int UserId = Convert.ToInt32(sitemaster["userid"]); int Type = 10; BonusPointDataDao Dao = new BonusPointDataDao(); int Count = Dao.GetCountByUserIdAndTypeId(UserId, Type); BonusPointData Obj = new BonusPointData(); if (Count == 0) { MakeBidDocZJDao Daozj = new MakeBidDocZJDao(); IList<MakeBidDocZJ> ObjzjList = Daozj.FindByUserId(UserId); MakeBidDocZJ Objzj = new MakeBidDocZJ(); if (ObjzjList != null && ObjzjList.Count != 0) { Objzj = ObjzjList.First(); } Obj.Label1 = Objzj.Label9; Obj.Label2 = Objzj.Label10; Obj.Label3 = Objzj.Label11; Obj.UserId = UserId; Obj.Type = Type; Dao.Insert(Obj); return View(Obj); } else { Obj = Dao.FindByUserIdAndTypeId(UserId, Type); return View(Obj); } }
public FileResult MakeFileDownload(int Type) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; int UserId = Convert.ToInt32(sitemaster["userid"]); BonusPointDataDao Dao = new BonusPointDataDao(); BonusPointData Model = Dao.FindByUserIdAndTypeId(UserId, Type); Dictionary<string, string> Labels = new Dictionary<string, string>(); if (Model.Label1 != null) { Labels["Label1_text_1"] = Model.Label1; } if (Model.Label2 != null) { Labels["Label2_text_1"] = Model.Label2; } if (Model.Label3 != null) { Labels["Label3_text_1"] = Model.Label3; } if (Model.Label4 != null) { Labels["Label4_text_1"] = Model.Label4; } if (Model.Label5 != null) { Labels["Label5_text_1"] = Model.Label5; } if (Model.Label6 != null) { Labels["Label6_text_1"] = Model.Label6; } //================================================== if (Model.Label21 != null) { Labels["Label21_file_1"] = Model.Label21; } if (Model.Label22 != null) { Labels["Label22_file_1"] = Model.Label22; } if (Model.Label23 != null) { Labels["Label23_file_1"] = Model.Label23; } if (Model.Label24 != null) { Labels["Label24_file_1"] = Model.Label24; } if (Model.Label25 != null) { Labels["Label25_file_1"] = Model.Label25; } if (Model.Label26 != null) { Labels["Label26_file_1"] = Model.Label26; } string TemplatePath = Server.MapPath("~/Template/BonusPoint/" + Type + ".doc"); string FilePath = MakeFile(TemplatePath, Labels); string ShowName = "Download"; switch (Type) { case 1: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册1(专利证明文件)"; break; case 2: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册2(国家保密处方中成药产品)"; break; case 3: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册3(获得国家级奖项的产品)"; break; case 4: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册4(国家一类新药)"; break; case 5: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册5(中药保护品种)"; break; case 6: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册6(执行单独质量标准和定价的药品)"; break; case 7: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册7(进入欧美主流市场实际发生销售的国产产品)"; break; case 8: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册8(剂型特点)"; break; case 9: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册9(储备条件)"; break; case 10: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册10(药品质量检验报告)"; break; case 11: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册11(自产原料)"; break; case 12: ShowName = "2011年浙江省基层医疗卫生机构基本药物集中采购加分材料册12(药品有效期)"; break; } return File(FilePath, "application/msword", ShowName + ".doc"); }
public ContentResult BonusPointData_Save(BonusPointData Obj) { Dictionary<string, string> sitemaster = GetSiteMaster(); ViewData["SiteMaster"] = sitemaster; int UserId = Convert.ToInt32(sitemaster["userid"]); BonusPointDataDao Dao = new BonusPointDataDao(); //BonusPointData Model = Dao.FindByUserIdAndTypeId( Obj.UserId = UserId; try { Dao.UpdateByUserIdAndTypeId(Obj); return Content("添加成功"); } catch (Exception) { return Content("添加失败"); } }