protected void FillHeading(string strId) { TaskResultBLL taskResultBLL = new TaskResultBLL(); PaperBLL kBLL = new PaperBLL(); RailExam.Model.TaskResult taskResult = taskResultBLL.GetTaskResult(int.Parse(strId)); RailExam.Model.Paper paper = null; if (taskResult != null) { paper = kBLL.GetPaper(taskResult.PaperId); lblExamBeginDateTime.Text = taskResult.BeginTime.ToString(); lblExamEndDateTime.Text = taskResult.EndTime.ToString(); lblExamineeName.Text = taskResult.EmployeeName; lblJudgeBeginDateTime.Text = taskResult.JudgeBeginTime.ToString(); lblJudgeEndDateTime.Text = taskResult.JudgeEndTime.ToString(); lblJudgerName.Text = taskResult.JudgeName; taskResultBLL.UpdateJudgeBeginTime(int.Parse(strId), DateTime.Now); } if (paper != null) { labeltitle.Text = paper.PaperName; labelTitleRight.Text = "总共 " + paper.ItemCount + " 题,共 " + paper.TotalScore + " 分"; } }
private void CheckAnswer(string strAnswer) { string strId = Request.QueryString.Get("id"); PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(strId)); PaperItemBLL paperItemBLL = new PaperItemBLL(); string[] strAnswers = strAnswer.Split(new char[] { '$' }); decimal nanswerScore = 0; decimal nScore = paper.TotalScore; for (int n = 0; n < strAnswers.Length; n++) { string str2 = strAnswers[n].ToString(); string[] str3 = str2.Split(new char[] { '|' }); string strPaperItemId = str3[0].ToString(); PaperItem paperItem = paperItemBLL.GetPaperItem(int.Parse(strPaperItemId)); string strTrueAnswer = str2.ToString().Substring(strPaperItemId.Length + 1); if (paperItem.StandardAnswer == strTrueAnswer) { nanswerScore += paperItem.Score; } } string strA = "得分为" + nanswerScore + ",正确率为" + (nanswerScore * 100 / nScore).ToString("0.00") + "%"; Response.Write("<script>alert('提交成功!" + strA + "'); top.window.close();</script>"); }
public ViewResult SearchList(string key, string type) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperSearchList(key, type); paperListViewModel.paperInfoList.total = paperListViewModel.paperInfoList.rows.Count(); paperListViewModel.paperInfoList.rows = paperListViewModel.paperInfoList.rows.Take(9).ToList <PaperInfo>(); if (string.IsNullOrEmpty(type)) { ViewData["type"] = ""; } else { ViewData["type"] = type; } ViewData["key"] = key; ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("SearchList", paperListViewModel)); }
public ViewResult TmpDetail(string id, string type) { string userId = string.Empty; if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; userId = list[0].UserId; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperDetailViewModel paperDetailViewModel = new PaperDetailViewModel(); if (string.IsNullOrEmpty(type)) { paperDetailViewModel = paperBLL.PaperDetailById(id, userId); } else { paperDetailViewModel = paperBLL.TmpDetailById(id); } ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("TemplateDetail", paperDetailViewModel)); }
protected void FillPage(string strId) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(strId)); if (paper != null) { lblTitle.Text = paper.PaperName; } PaperItemBLL paperItemBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> paperItems = paperItemBLL.GetItemsByPaperId(int.Parse(strId)); int nItemCount = paperItems.Count; // 用于前台JS判断是否完成全部试题 hfPaperItemsCount.Value = nItemCount.ToString(); decimal nTotalScore = 0; for (int i = 0; i < paperItems.Count; i++) { nTotalScore += paperItems[i].Score; } lblTitleRight.Text = "总共" + nItemCount + "题,共 " + nTotalScore + "分"; lblOrgName.Text = PrjPub.CurrentStudent.OrgName; lblPost.Text = PrjPub.CurrentStudent.PostName; lblName.Text = PrjPub.CurrentStudent.EmployeeName; }
public ViewResult TmpListPaging(int pageNo, string type, string flag) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(null, flag, null); paperListViewModel.paperTmpPage.total = paperListViewModel.paperTmpPage.rows.Count(); paperListViewModel.paperTmpPage.rows = paperListViewModel.paperTmpPage.rows.Skip((pageNo - 1) * 6).Take(6).ToList <TemplateDownloadInfo>(); if (string.IsNullOrEmpty(flag)) { ViewData["Tmptype"] = "0"; } else { ViewData["Tmptype"] = flag; } return(View("_tmplateDownloadPaging", paperListViewModel)); }
public ViewResult SearchListPaging(int pageNo, string key, string type) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperSearchList(key, type); paperListViewModel.paperInfoList.total = paperListViewModel.paperInfoList.rows.Count(); paperListViewModel.paperInfoList.rows = paperListViewModel.paperInfoList.rows.Skip((pageNo - 1) * 9).Take(9).ToList <PaperInfo>(); if (string.IsNullOrEmpty(type)) { ViewData["type"] = ""; } else { ViewData["type"] = type; } return(View("_searchListPaging", paperListViewModel)); }
protected void FillHeading(string strId) { ExamResultBLL examResultBLL = new ExamResultBLL(); PaperBLL kBLL = new PaperBLL(); RailExam.Model.ExamResult examResult = examResultBLL.GetExamResultByOrgID(Convert.ToInt32(strId), Convert.ToInt32(ViewState["OrgID"].ToString())); RailExam.Model.Paper paper = null; EmployeeBLL ebLL = new EmployeeBLL(); RailExam.Model.Employee Employee = ebLL.GetEmployee(examResult.ExamineeId); string strOrgName = Employee.OrgName; string strStationName = ""; string strOrgName1 = ""; int n = strOrgName.IndexOf("-"); if (n != -1) { strStationName = strOrgName.Substring(0, n); strOrgName1 = strOrgName.Substring(n + 1); } else { strStationName = strOrgName; strOrgName1 = ""; } lblOrg.Text = strStationName; lblWorkShop.Text = strOrgName1; lblPost.Text = Employee.PostName; lblName.Text = Employee.EmployeeName; lblTime.Text = examResult.BeginDateTime.ToString("yyyy-MM-dd HH:mm"); lblScore.Text = examResult.Score.ToString(); if (examResult != null) { paper = kBLL.GetPaper(examResult.PaperId); } PaperItemBLL paperItemBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> paperItems = paperItemBLL.GetItemsByPaperId(paper.PaperId); int nItemCount = paperItems.Count; decimal nTotalScore = 0; for (int i = 0; i < paperItems.Count; i++) { nTotalScore += paperItems[i].Score; } if (paper != null) { lblTitle.Text = paper.PaperName; lblTitleRight.Text = "总共 " + nItemCount + " 题,共 " + nTotalScore + " 分"; } }
protected void FillPage(string strId) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(strId)); if (paper != null) { lblTitle.Text = paper.PaperName; lblTitleRight.Text = "总共" + paper.ItemCount + "题共 " + paper.TotalScore + "分"; hfPaperItemsCount.Value = paper.ItemCount.ToString(); } }
public ViewResult TemplateDownload(string flag, string key) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(null, flag, key); paperListViewModel.paperTmpPage.total = paperListViewModel.paperTmpPage.rows.Count(); paperListViewModel.paperTmpPage.rows = paperListViewModel.paperTmpPage.rows.Take(6).ToList <TemplateDownloadInfo>(); TemplateDownloadBLL templateDownloadBLL = new TemplateDownloadBLL(); TemplateTypeList templateTypeList = new TemplateTypeList(); templateTypeList = templateDownloadBLL.getTemplateTypeData(); List <SelectListItem> select = new List <SelectListItem>(); select.Add(new SelectListItem { Text = "全部分类", Value = "0" }); for (int i = 0; i < templateTypeList.rows.Count; i++) { select.Add(new SelectListItem { Text = templateTypeList.rows[i].TemplateType.ToString(), Value = templateTypeList.rows[i].Id.ToString() }); } if (string.IsNullOrEmpty(flag)) { ViewData["Tmptype"] = "0"; } else { ViewData["Tmptype"] = flag; } ViewData["selTmpType"] = new SelectList(select, "Value", "Text", ""); ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("TemplateDownload", paperListViewModel)); }
public void DisplayAPaper(int paperId) { PaperModel ppM = Mapper.FromDataTransferObject(PaperBLL.GetPaper(paperId)); View.Id = ppM.PaperId; View.MaNhaCungCap = ppM.PaperCode; View.TenGiay = ppM.PaperName; View.DinhLuong = ppM.Substance; View.ShortDim = ppM.ShortDim; View.LongDim = ppM.LongDim; View.UnitPrice = ppM.UnitPrice; View.ProfiMarginSet = ppM.ProfitMarginSet; View.CateId = ppM.CategoryId; View.CategoryName = (PaperCateBLL.GetRecord(ppM.CategoryId)).CategoryName; }
public JsonResult WXPayUrl(PaperInfo paperInfo) { if (Session["user"] == null) { return(Json(new { success = false, data = "请您先登录,才能购买商品哦!" }, JsonRequestBehavior.AllowGet)); } else { string userId = string.Empty; List <UserRecord> list = (List <UserRecord>)Session["user"]; userId = list[0].UserId; NativePay nativePay = new NativePay(); PaperBLL paperBLL = new PaperBLL(); PaperDetailViewModel paperDetailViewModel = paperBLL.PaperDetailById(paperInfo.Id.ToString(), userId); string _outTradeNo = string.Empty; string url = nativePay.GetPayUrl(paperDetailViewModel.detail[0], out _outTradeNo); if (string.IsNullOrEmpty(url)) { return(Json(new { success = false, data = "微信生成订单时出现错误,请您重新支付!" }, JsonRequestBehavior.AllowGet)); } else { Business business = new Business(); List <UserRecord> rows = (List <UserRecord>)Session["user"]; business.UserId = rows[0].UserId; business.Name = rows[0].Name; business.CreateTime = DateTime.Now; business.OutTradeNo = _outTradeNo; business.PaperCode = paperDetailViewModel.detail[0].Code; business.PaperId = paperDetailViewModel.detail[0].Id; business.Title = paperDetailViewModel.detail[0].Title; business.Version = paperDetailViewModel.detail[0].Version; business.Price = paperDetailViewModel.detail[0].Price; business.PayState = 0; bool result = paperBLL.CreateBusiness(business); if (result == true) { return(Json(new { success = true, data = url, orderNumber = _outTradeNo }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false, data = "微信生成订单时出现错误,请您重新支付!" }, JsonRequestBehavior.AllowGet)); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["mode"] = Request.QueryString.Get("mode"); hfMode.Value = ViewState["mode"].ToString(); string strId = Request.QueryString.Get("id"); ExamBLL examBLL = new ExamBLL(); RailExam.Model.Exam exam = examBLL.GetExam(int.Parse(strId)); if (exam != null) { txtPaperName.Text = exam.ExamName; if (exam.paperId != 0) { PaperBLL paperBLL = new PaperBLL(); IList <RailExam.Model.Paper> paperList = paperBLL.GetPaperByPaperId(exam.paperId); if (paperList != null) { Grid1.DataSource = paperList; Grid1.DataBind(); } } } } else { if (!string.IsNullOrEmpty(hfPaperId.Value)) { PaperBLL paperBLL = new PaperBLL(); IList <RailExam.Model.Paper> paperList = paperBLL.GetPaperByPaperId(int.Parse(hfPaperId.Value)); if (paperList != null) { Grid1.DataSource = paperList; Grid1.DataBind(); } } } }
public ViewResult Index() { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperInit paperInit = paperBLL.PaperInit(); ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("Home", paperInit)); }
protected void FillPage(int nId) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(nId); if (paper != null) { txtCategoryName.Text = paper.CategoryName; ddlMode.SelectedValue = paper.CreateMode.ToString(); PaperSubjectBLL paperSubjectBLL = new PaperSubjectBLL(); IList <PaperSubject> psList = paperSubjectBLL.GetPaperSubjectByPaperId(paper.PaperId); if (psList.Count > 0) { ddlMode.Enabled = false; ddlStrategyMode.Enabled = false; } else { ddlMode.Enabled = true; ddlStrategyMode.Enabled = true; } txtPaperName.Text = paper.PaperName; hfCategoryId.Value = paper.CategoryId.ToString(); txtDescription.Text = paper.Description; txtMemo.Text = paper.Memo; if (ddlMode.SelectedValue == "3") { ddlStrategyMode.Visible = true; LabelMode.Visible = true; } } if (ViewState["mode"].ToString() == "ReadOnly") { txtPaperName.Enabled = false; txtDescription.Enabled = false; txtMemo.Enabled = false; } }
protected void FillHeading(string strId) { TaskResultBLL taskResultBLL = new TaskResultBLL(); PaperBLL kBLL = new PaperBLL(); RailExam.Model.TaskResult taskResult = taskResultBLL.GetTaskResult(int.Parse(strId)); RailExam.Model.Paper paper = null; if (taskResult != null) { paper = kBLL.GetPaper(taskResult.PaperId); } if (paper != null) { lblTitle.Text = paper.PaperName; lblTitleRight.Text = "总共 " + paper.ItemCount + " 题,共 " + paper.TotalScore + " 分"; } }
public ViewResult About() { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(null, null, null); ViewBag.ImageModel = paperBLL.SearchImgManage().rows; ViewBag.About = paperBLL.SearchAboutUs(); return(View("About", paperListViewModel)); }
public ViewResult ToolDownload() { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(null, null, null); paperListViewModel.paperToolPage.total = paperListViewModel.paperToolPage.rows.Count(); paperListViewModel.paperToolPage.rows = paperListViewModel.paperToolPage.rows.Take(6).ToList <ToolDownloadInfo>(); ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("ToolDownload", paperListViewModel)); }
private void OutputData(string id) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(id)); string str = "<table border='0' cellpadding='0' cellspacing='0' >"; str += "<tr><td colspan='2' align='center' style='font-size:28px' >" + paper.PaperName + "</td> </tr><tr> <td colspan='2' align='right'>总共" + paper.ItemCount + "题共 " + paper.TotalScore + "分</td></tr> "; str += "<tr> <td style='width: 15%; vertical-align: top'>"; str += "<table border='1' cellpadding='0' cellspacing='0' ><tr><td style='width: 100px; height: 50px' valign='top'> 所属单位:</td> </tr> <tr><td style='height: 50px' valign='top'>车间:</td> </tr><tr><td style='height: 50px' valign='top'>姓名:</td></tr><tr><td style='height: 50px' valign='top'>职名:</td></tr><tr><td style='height: 50px' valign='top'>考试日期:</td></tr></table> </td> "; str += " <td style='width: 85%; vertical-align: top'> "; str += GetFillPaperString(id); str += "</td></tr></table> "; string strReplace; if (PrjPub.IsServerCenter) { strReplace = "http://" + ConfigurationManager.AppSettings["ServerIP"] + "/RailExamBao/"; } else { strReplace = "http://" + ConfigurationManager.AppSettings["StationIP"] + "/RailExamBao/"; } str = str.Replace("/RailExamBao/", strReplace); Response.Clear(); Response.Charset = "utf-7"; Response.Buffer = true; EnableViewState = false; Response.AppendHeader("Content-Disposition", "attachment;filename=Paper.doc"); Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-7"); Response.ContentType = "application/ms-word"; Response.Write(str); Response.End(); }
public ViewResult List(string type, string flag) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(type, flag, null); paperListViewModel.paperInfoList.total = paperListViewModel.paperInfoList.rows.Count(); paperListViewModel.paperInfoList.rows = paperListViewModel.paperInfoList.rows.Take(9).ToList <PaperInfo>(); ViewData["type"] = type; ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("PaperListV", paperListViewModel)); }
public ViewResult ToolListPaging(int pageNo) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(null, null, null); paperListViewModel.paperToolPage.total = paperListViewModel.paperToolPage.rows.Count(); paperListViewModel.paperToolPage.rows = paperListViewModel.paperToolPage.rows.Skip((pageNo - 1) * 6).Take(6).ToList <ToolDownloadInfo>(); return(View("_toolDownloadPaging", paperListViewModel)); }
public ViewResult ListPaging(int pageNo, string type) { if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; } else { ViewData["login"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); PaperListViewModel paperListViewModel = paperBLL.PaperTypeList(type, null, null); paperListViewModel.paperInfoList.total = paperListViewModel.paperInfoList.rows.Count(); paperListViewModel.paperInfoList.rows = paperListViewModel.paperInfoList.rows.Skip((pageNo - 1) * 9).Take(9).ToList <PaperInfo>(); return(View("_paperListVPaging", paperListViewModel)); }
protected void FillHeading(string strId) { ExamResultBLL examResultBLL = new ExamResultBLL(); PaperBLL kBLL = new PaperBLL(); RailExam.Model.ExamResult examResult = examResultBLL.GetExamResult(int.Parse(strId)); RailExam.Model.Paper paper = null; if (examResult != null) { paper = kBLL.GetPaper(examResult.PaperId); lblExamBeginDateTime.Text = examResult.BeginDateTime.ToString(); lblExamEndDateTime.Text = examResult.EndDateTime.ToString(); lblExamineeName.Text = examResult.ExamineeName; HiddenFieldEmployeeName.Value = lblExamineeName.Text; lblJudgeBeginDateTime.Text = examResult.JudgeBeginDateTime.ToString(); lblJudgeEndDateTime.Text = examResult.JudgeEndDateTime.ToString(); lblJudgerName.Text = examResult.JudgeName; if (examResult.Score <= 0M) { lblScore.Text = examResult.AutoScore.ToString(); ViewState["Score"] = examResult.AutoScore; lblScore.Text += "分"; } else { lblScore.Text = examResult.Score.ToString(); ViewState["Score"] = examResult.Score; lblScore.Text += "分"; } HiddenFieldScore.Value = lblScore.Text; examResultBLL.UpdateJudgeBeginTime(int.Parse(strId), DateTime.Now); } if (paper != null) { this.lblTitle.Text = paper.PaperName; this.lblTitleRight.Text = "总共 " + paper.ItemCount + " 题,共 " + paper.TotalScore + " 分"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["mode"] = Request.QueryString.Get("mode"); hfMode.Value = ViewState["mode"].ToString(); btnPreview.Visible = false; btnEdit.Visible = false; string strId = Request.QueryString.Get("id"); this.btnPreview.Attributes.Add("onclick", "ManagePaper(" + strId + ")"); PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(strId)); if (paper != null) { lblPaperName.Text = paper.PaperName; lblPaperCategoryName.Text = paper.CategoryName; hfCategoryId.Value = paper.CategoryId.ToString(); } } }
private void BindGrid() { PaperBLL objPaperBll = new PaperBLL(); IList <RailExam.Model.Paper> objPaperList = objPaperBll.GetPaperByCategoryID(Convert.ToInt32(ViewState["CategoryID"].ToString()), Convert.ToInt32(ddlType.SelectedValue), txtName.Text, txtPerson.Text); ArrayList objList = GetPaperList(); if (objList.Count > 0) { foreach (RailExam.Model.Paper paper in objPaperList) { if (objList.IndexOf(paper.PaperId) != -1) { paper.Flag = true; } } } Grid1.DataSource = objPaperList; Grid1.DataBind(); }
private void OutputData(string id) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(int.Parse(id)); PaperItemBLL paperItemBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> paperItems = paperItemBLL.GetItemsByPaperId(int.Parse(id)); int nItemCount = paperItems.Count; decimal nTotalScore = 0; for (int i = 0; i < paperItems.Count; i++) { nTotalScore += paperItems[i].Score; } string str = "<table border='0' cellpadding='0' cellspacing='0' >"; str += "<tr><td colspan='2' align='center' style='font-size:28px' >" + paper.PaperName + "</td> </tr><tr> <td colspan='2' align='right'>总共" + nItemCount + "题共 " + nTotalScore + "分</td></tr> "; str += "<tr> <td style='width: 15%; vertical-align: top'>"; str += "<table border='1' cellpadding='0' cellspacing='0' ><tr><td style='width: 100px; height: 50px' valign='top'> 所属单位:</td> </tr> <tr><td style='height: 50px' valign='top'>车间:</td> </tr><tr><td style='height: 50px' valign='top'>姓名:</td></tr><tr><td style='height: 50px' valign='top'>职名:</td></tr><tr><td style='height: 50px' valign='top'>考试日期:</td></tr></table> </td> "; str += " <td style='width: 85%; vertical-align: top'> "; str += GetFillPaperString(id); str += "</td></tr></table> "; Response.Clear(); Response.Charset = "utf-7"; Response.Buffer = true; EnableViewState = false; Response.AppendHeader("Content-Disposition", "attachment;filename=Paper.doc"); Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-7"); Response.ContentType = "application/ms-word"; Response.Write(str); Response.End(); }
public ViewResult Detail(string id) { string userId = string.Empty; if (Session["user"] != null) { List <UserRecord> list = (List <UserRecord>)Session["user"]; ViewData["login"] = list[0].Name; ViewData["admin"] = list[0].AdminState; userId = list[0].UserId; } else { ViewData["login"] = string.Empty; ViewData["admin"] = string.Empty; } PaperBLL paperBLL = new PaperBLL(); paperBLL.AddReadCount(id); PaperDetailViewModel paperDetailViewModel = paperBLL.PaperDetailById(id, userId); ViewBag.ImageModel = paperBLL.SearchImgManage().rows; return(View("PaperDetail", paperDetailViewModel)); }
protected void FillPage(int nId) { PaperBLL paperBLL = new PaperBLL(); RailExam.Model.Paper paper = paperBLL.GetPaper(nId); if (paper != null) { lblTitle.Text = paper.PaperName; } PaperItemBLL paperItemBLL = new PaperItemBLL(); IList <RailExam.Model.PaperItem> paperItems = paperItemBLL.GetItemsByPaperId(nId); int nItemCount = paperItems.Count; decimal nTotalScore = 0; for (int i = 0; i < paperItems.Count; i++) { nTotalScore += paperItems[i].Score; } lblTitleRight.Text = "总共" + nItemCount + "题,共 " + nTotalScore + "分"; }
private void DeleteData(int nPaperID) { PaperBLL paperBLL = new PaperBLL(); paperBLL.DeletePaper(nPaperID); }
protected void Page_Load(object sender, EventArgs e) { string strPaperCategoryId = Request.QueryString.Get("id"); string strflag = Request.QueryString.Get("flag"); if (!string.IsNullOrEmpty(strPaperCategoryId)) { int nPaperCategoryId = -1; try { nPaperCategoryId = Convert.ToInt32(strPaperCategoryId); } catch { } ComponentArt.Web.UI.TreeView tv = new ComponentArt.Web.UI.TreeView(); PaperBLL paperBLL = new PaperBLL(); IList <RailExam.Model.Paper> papers = paperBLL.GetPaperByCategoryID(nPaperCategoryId); if (papers.Count > 0) { TreeViewNode tvn = null; foreach (RailExam.Model.Paper paper in papers) { tvn = new TreeViewNode(); tvn.ID = paper.PaperId.ToString(); tvn.Value = paper.PaperId.ToString(); tvn.Text = paper.PaperName; tvn.ToolTip = paper.PaperName; tvn.Attributes.Add("isPaper", "true"); tvn.ImageUrl = "~/App_Themes/" + StyleSheetTheme + "/Images/TreeView/Book.gif"; if (strflag != null && strflag == "1") { tvn.ShowCheckBox = true; } tv.Nodes.Add(tvn); } } Response.Clear(); Response.ClearHeaders(); Response.ContentType = "text/xml"; Response.Cache.SetNoStore(); string strXmlEncoding = string.Empty; try { strXmlEncoding = System.Configuration.ConfigurationManager.AppSettings["CallbackEncoding"]; } catch { strXmlEncoding = "gb2312"; #if DEBUG System.Diagnostics.Debug.WriteLine("Error Accessing Web.Config File!\r\n" + "Using \"gb2312\"!"); #endif } if (string.IsNullOrEmpty(strXmlEncoding)) { strXmlEncoding = "gb2312"; #if DEBUG System.Diagnostics.Debug.WriteLine("CallbackEncoding Empty in Web.Config File!\r\n" + "Using \"gb2312\"!"); #endif } else { try { System.Text.Encoding enc = System.Text.Encoding.GetEncoding(strXmlEncoding); } catch { #if DEBUG System.Diagnostics.Debug.WriteLine("Invalid Encoding in Web.Config File!\r\n" + "Using \"gb2312\"!"); #endif strXmlEncoding = "gb2312"; } } Response.Write("<?xml version=\"1.0\" encoding=\"" + strXmlEncoding + "\" standalone=\"yes\" ?>\r\n" + tv.GetXml()); Response.Flush(); Response.End(); } }