Esempio n. 1
0
 public ActionResult UpLoad()
 {
     try
     {
         HttpPostedFileBase file = Request.Files["File"];
         Guid      Paper_Id      = Guid.NewGuid();
         PaperInfo paperinfo     = new PaperInfo
         {
             Paper_Id       = Paper_Id,
             Paper_Subject  = Request["Subject_upload"],
             Paper_Grade    = Request["Grade_upload"],
             Paper_Kind     = Request["Kind"],
             Paper_Province = Request["Province"],
             Paper_Year     = Request["Year"],
             Paper_Author   = Request["Author"],
             Paper_Time     = DateTime.Now,
             Paper_Download = 0,
             Paper_State    = true,
             Paper_Name     = file.FileName,
             Paper_Path     = "/medium/paper/" + Paper_Id.ToString() + ".docx"
         };
         file.SaveAs(Server.MapPath("~/medium/paper/" + Paper_Id.ToString() + ".docx"));
         EODB eodb = new EODB();
         eodb.paperinfo.Add(paperinfo);
         eodb.SaveChanges();
         return(RedirectToAction("Extension", new { Type = "上传试卷", Tip = "success" }));
     }
     catch
     {
         return(RedirectToAction("Extension", new { Type = "新建试题", Tip = "error" }));
     }
 }
Esempio n. 2
0
        private void UpdatePaperKeywords(string[] selectedOptions, PaperInfo paperInfoToUpdate)
        {
            if (selectedOptions == null)
            {
                paperInfoToUpdate.PaperKeywords = new List <PaperKeyword>();
                return;
            }

            var selectedOptionsHS = new HashSet <string>(selectedOptions);
            var papKey            = new HashSet <int>(paperInfoToUpdate.PaperKeywords.Select(b => b.KeywordID));

            foreach (var s in _context.Keywords)
            {
                if (selectedOptionsHS.Contains(s.ID.ToString()))
                {
                    if (!papKey.Contains(s.ID))
                    {
                        paperInfoToUpdate.PaperKeywords.Add(new PaperKeyword
                        {
                            KeywordID   = s.ID,
                            PaperInfoID = paperInfoToUpdate.ID
                        });
                    }
                }
                else
                {
                    if (papKey.Contains(s.ID))
                    {
                        PaperKeyword specToRemove = paperInfoToUpdate.PaperKeywords.SingleOrDefault(d => d.KeywordID == s.ID);
                        _context.Remove(specToRemove);
                    }
                }
            }
        }
Esempio n. 3
0
        public bool Input(PaperInfo paperInfo)
        {
            StringBuilder sbAddUser = new StringBuilder();

            if (string.IsNullOrEmpty(paperInfo.Code))
            {
                paperInfo.Code = Guid.NewGuid().ToString("D");
            }
            string GetSessionWithDsmId = string.Format(@"INSERT INTO PAPER 
                (Title,Info,DetailInfo,Price,CreateDate,Type,ImgA,ImgB,ImgC,ImgD,ImgE,
                Video,VideoZip,Version,FileUrl,Code,ReadNum,PayNum) 
                VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}',
                '{11}','{12}','{13}','{14}','{15}','{16}','{17}')",
                                                       paperInfo.Title, paperInfo.Info, paperInfo.DetailInfo, paperInfo.Price,
                                                       paperInfo.CreateDate, paperInfo.Type, paperInfo.ImgA, paperInfo.ImgB,
                                                       paperInfo.ImgC, paperInfo.ImgD, paperInfo.ImgE, paperInfo.Video,
                                                       paperInfo.VideoZip, paperInfo.Version, paperInfo.FileUrl, paperInfo.Code,
                                                       paperInfo.ReadNum, paperInfo.PayNum);


            int iResult = DBHelper.ExcuteNoQuerySql(GetSessionWithDsmId);

            if (iResult == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,PaperTitle,PaperAbstract,PaperType,PaperLength,StatID")] PaperInfo paperInfo)
        {
            if (id != paperInfo.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(paperInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaperInfoExists(paperInfo.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(paperInfo));
        }
Esempio n. 5
0
        private async Task AddDocuments(PaperInfo paperInfo, IEnumerable <IFormFile> docs)
        {
            foreach (var f in docs)
            {
                if (f != null)
                {
                    string mimeType   = f.ContentType;
                    long   fileLength = f.Length;
                    if (!(mimeType == "" || fileLength == 0))//Looks like we have a file!!!
                    {
                        using (var memoryStream = new System.IO.MemoryStream())
                        {
                            await f.CopyToAsync(memoryStream);

                            File newFile = new File
                            {
                                FileContent  = memoryStream.ToArray(),
                                FileMimeType = mimeType,
                                FileName     = f.FileName
                            };
                            paperInfo.Files.Add(newFile);
                        }
                    }
                    ;
                }
            }
        }
Esempio n. 6
0
        public ActionResult DownloadPaper(Guid Paper_Id)
        {
            EODB      eodb  = new EODB();
            PaperInfo paper = eodb.paperinfo.Find(Paper_Id);

            return(Content(paper.Paper_Path));
        }
Esempio n. 7
0
        public void Delete(int id)
        {
            PaperInfo paperInfo = new PaperInfo();

            paperInfo.id = id;
            this.control.DeleteEntity(paperInfo);
        }
Esempio n. 8
0
        public ActionResult Explain(Guid Question_Id)
        {
            EODB         eodb = new EODB();
            QuestionInfo qi   = eodb.questioninfo.Find(Question_Id);

            if (qi.Question_Title.Length > 20)
            {
                ViewBag.Title = qi.Question_Title.Substring(0, 20).Replace("<p>", string.Empty).Replace("</p>", string.Empty);
            }
            else
            {
                ViewBag.Title = qi.Question_Title.Replace("<p>", string.Empty).Replace("</p>", string.Empty);
            }
            ViewBag.QuestionInfo = qi;
            qi.Question_Click++;
            eodb.SaveChanges();
            PaperInfo Related = eodb.paperinfo.Where(i => i.Paper_Grade == qi.Question_Grade && i.Paper_Subject == qi.Question_Subject).FirstOrDefault();

            if (Related == null)
            {
                ViewBag.Related = new PaperInfo
                {
                    Paper_Id   = Guid.NewGuid(),
                    Paper_Name = "无",
                    Paper_Path = "#"
                };
            }
            else
            {
                ViewBag.Related = Related;
            }
            return(View());
        }
Esempio n. 9
0
        /// <summary>
        /// 获取智能型试卷的详细信息,即生成好的试卷信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private static PaperInfo PaperInfo_Get(Paper model)
        {
            try
            {
                using (IDbConnection conn = DbHelper.ResourceService())
                {
                    PaperInfo pi = new PaperInfo();
                    var       p  = new DynamicParameters();
                    p.Add("@PaperID", model.PaperID);

                    var multi             = conn.QueryMultiple("PaperInfo_Get", p, commandType: CommandType.StoredProcedure);
                    var paper             = multi.Read <Paper>().Single();
                    var grouplist         = multi.Read <PaperGroup>().ToList();
                    var attachmentlist    = multi.Read <Attachment>().ToList();
                    var paperexerciselist = multi.Read <PaperExercise>().ToList();

                    pi.PaperID        = paper.PaperID;
                    pi.Type           = paper.Type;
                    pi.paper          = paper;
                    pi.papergrouplist = grouplist;
                    pi.attachmentlist = attachmentlist;
                    pi.exerciselist   = paperexerciselist;

                    return(pi);
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Esempio n. 10
0
        // GET: Reviews
        public async Task <IActionResult> Index(int PaperInfoID, int?ResearcherID, int?RoleID, string SearchString)
        {
            //if (!PaperInfoID.HasValue)
            //{
            //    return RedirectToAction("Index", "PaperInfos");
            //}
            //PopulateDropDownLists();
            ViewData["Filtering"] = "";

            var revs = from a in _context.ReviewAssigns.Include(a => a.PaperInfoID).Include(a => a.RecommendID)
                       where a.PaperInfoID == PaperInfoID
                       select a;



            //Now get the MASTER record, the patient, so it can be displayed at the top of the screen
            PaperInfo paper = _context.PaperInfos
                              .Include(p => p.ID)
                              .Include(p => p.Status)
                              .Include(pc => pc.PaperTitle)
                              .Where(p => p.ID == PaperInfoID).FirstOrDefault();

            ViewBag.PaperInfo = paper;
            return(View());
        }
Esempio n. 11
0
        public async Task <IActionResult> Create([Bind("ID,PaperTitle,PaperAbstract,PaperTypeID,PaperLength, StatusID")] PaperInfo paperInfo, string[] selectedOptions, IEnumerable <IFormFile> theFiles)
        //public async Task<IActionResult> Create([Bind("ID,PaperTitle,PaperAbstract,PaperTypeID,PaperLength,StatusID")] PaperInfo paperInfo, IEnumerable<IFormFile> theFiles, string[] selectedOptions)

        {
            try
            {
                UpdatePaperKeywords(selectedOptions, paperInfo);
                if (ModelState.IsValid)
                {
                    await AddDocuments(paperInfo, theFiles);

                    paperInfo.StatusID = 3;
                    _context.Add(paperInfo);
                    await _context.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
            }
            catch (Exception /* dex */)
            {
                ModelState.AddModelError("", "Unable to save changes after multiple attempts. Try again, and if the problem persists, see your system administrator.");
            }
            PopulateDropDownLists(paperInfo);

            PopulatePaperKeywordData(paperInfo);

            PopulateAssignedKeywordData(paperInfo);

            return(View(paperInfo));
        }
Esempio n. 12
0
        private void PopulateAssignedKeywordData(PaperInfo paper)
        {
            var allKeywords = _context.Keywords;
            var papKeywords = new HashSet <int>(paper.PaperKeywords.Select(b => b.KeywordID));
            var selected    = new List <KeywordVM>();
            var available   = new List <KeywordVM>();

            foreach (var s in allKeywords)
            {
                if (papKeywords.Contains(s.ID))
                {
                    selected.Add(new KeywordVM
                    {
                        KeywordID = s.ID,
                        KeyWord   = s.KeyWord
                    });
                }
                else
                {
                    available.Add(new KeywordVM
                    {
                        KeywordID = s.ID,
                        KeyWord   = s.KeyWord
                    });
                }
            }

            ViewData["selOpts"]   = new MultiSelectList(selected.OrderBy(s => s.KeyWord), "KeywordID", "KeyWord");
            ViewData["availOpts"] = new MultiSelectList(available.OrderBy(s => s.KeyWord), "KeywordID", "KeyWord");
        }
Esempio n. 13
0
        public ActionResult Save(PaperInfo paperInfo)
        {
            AdminBLL admin = new AdminBLL();

            bool b = admin.SavePaper(paperInfo);

            return(Json(new { success = b }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 14
0
        /// <summary>
        /// 获取已配置的纸张类型列表
        /// </summary>
        /// <returns>纸张类型列表</returns>
        public List <PaperInfo> GetPaperList()
        {
            List <PaperInfo> lstPaperInfos = new List <PaperInfo>();
            XmlDocument      xmlDoc        = GlobalMethods.Xml.GetXmlDocument(this.m_szPaperConfigFile);

            if (xmlDoc == null)
            {
                return(lstPaperInfos);
            }

            XmlNodeList nodes = GlobalMethods.Xml.SelectXmlNodes(xmlDoc, "//Item");

            if (nodes == null)
            {
                return(lstPaperInfos);
            }

            string szValue = null;
            int    nValue  = 0;

            for (int index = 0; index < nodes.Count; index++)
            {
                XmlNode   node      = nodes[index];
                PaperInfo paperInfo = new PaperInfo();
                if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Name", ref szValue))
                {
                    continue;
                }
                paperInfo.Name = szValue;

                if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Width", ref szValue))
                {
                    continue;
                }
                if (int.TryParse(szValue, out nValue))
                {
                    paperInfo.Width = nValue;
                }

                if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Height", ref szValue))
                {
                    continue;
                }
                if (int.TryParse(szValue, out nValue))
                {
                    paperInfo.Height = nValue;
                }

                if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Printer", ref szValue))
                {
                    continue;
                }
                paperInfo.Printer = szValue;

                lstPaperInfos.Add(paperInfo);
            }
            return(lstPaperInfos);
        }
Esempio n. 15
0
        public ActionResult AddDownloadNum(Guid Paper_Id)
        {
            EODB      eodb      = new EODB();
            PaperInfo paperinfo = eodb.paperinfo.Find(Paper_Id);

            paperinfo.Paper_Download++;
            eodb.SaveChanges();
            return(new EmptyResult());
        }
Esempio n. 16
0
        public async Task <IActionResult> Create([Bind("ID,PaperTitle,PaperAbstract,PaperType,PaperLength,StatID")] PaperInfo paperInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paperInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paperInfo));
        }
Esempio n. 17
0
    protected void Del_Btn(object obj, EventArgs e)
    {
        LinkButton        linkButton        = obj as LinkButton;
        RepeaterItem      repeaterItem      = linkButton.Parent as RepeaterItem;
        HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
        int       id   = Convert.ToInt32(htmlInputCheckBox.Value);
        PaperInfo byId = Paper.Init().GetById(id);

        Help.DeleteFiles(byId.FilePath);
        Paper.Init().Delete(id);
        this.Show();
    }
Esempio n. 18
0
        /// <summary>
        /// 获取指定的病历纸张类型信息
        /// </summary>
        /// <param name="szPaperName">纸张名称</param>
        /// <returns>纸张类型信息</returns>
        public PaperInfo GetPaperInfo(float width, float height)
        {
            XmlDocument xmlDoc = GlobalMethods.Xml.GetXmlDocument(this.m_szPaperConfigFile);

            if (xmlDoc == null)
            {
                return(null);
            }

            string      szXPath = string.Format("//Item[@Width='{0}' and @Height='{1}']", width.ToString(), height.ToString());
            XmlNodeList nodes   = GlobalMethods.Xml.SelectXmlNodes(xmlDoc, szXPath);

            if (nodes == null || nodes.Count <= 0)
            {
                return(null);
            }

            string    szValue   = null;
            int       nValue    = 0;
            XmlNode   node      = nodes[0];
            PaperInfo paperInfo = new PaperInfo();

            if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Name", ref szValue))
            {
                return(null);
            }
            paperInfo.Name = szValue;

            if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Width", ref szValue))
            {
                return(null);
            }
            if (int.TryParse(szValue, out nValue))
            {
                paperInfo.Width = nValue;
            }

            if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Height", ref szValue))
            {
                return(null);
            }
            if (int.TryParse(szValue, out nValue))
            {
                paperInfo.Height = nValue;
            }

            if (!GlobalMethods.Xml.GetXmlNodeValue(node, "./@Printer", ref szValue))
            {
                return(null);
            }
            paperInfo.Printer = szValue;
            return(paperInfo);
        }
    public void FillInfo()
    {
        PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business();
        PaperInfo             paper        = paperInfoMan.GetPaperInfoForAuthor(Convert.ToInt32(Request[RequestMSG.PaperID]));

        if (paper != null)
        {
            txtbAbstract.Text   = paper.Abstracts;
            txtbFeildPaper.Text = paper.Feilds;
            txtbKeyWord.Text    = paper.Keyword;
        }
    }
Esempio n. 20
0
 private void Show()
 {
     this.GetFirtNode();
     this.TypeID.DataSource     = this.li;
     this.TypeID.DataTextField  = "Sh";
     this.TypeID.DataValueField = "ID";
     this.TypeID.DataBind();
     if (!string.IsNullOrEmpty(base.Request.QueryString["pid"]))
     {
         PaperInfo byId = Paper.Init().GetById(Convert.ToInt32(base.Request.QueryString["pid"]));
         this.TypeID.SelectedValue = string.Concat(byId.TypeID);
         this.PaperName.Value      = byId.PaperName;
         this.Notes.Value          = byId.Notes;
         this.SendDep.Value        = byId.SendDep;
         this.PaperSymbol.Value    = byId.PaperSymbol;
         this.PaperGrade.Value     = byId.PaperGrade;
         this.PaperDate.Value      = byId.PaperDate;
         if (byId.ShareDeps != "")
         {
             this.sel.SelectedIndex      = 1;
             this.tr.Attributes["style"] = "";
             this.userlist_dep.Value     = byId.ShareDeps;
             this.namelist_dep.Value     = byId.namelist;
         }
         this.TypeID.SelectedValue = string.Concat(byId.TypeID);
         if (!string.IsNullOrEmpty(byId.FilePath) && byId.FilePath.Contains("|"))
         {
             this.Attachword.Visible = true;
             List <TmpInfo> list  = new List <TmpInfo>();
             string[]       array = byId.FilePath.Split(new char[]
             {
                 '|'
             });
             for (int i = 0; i < array.Length; i++)
             {
                 if (array[i].Trim() != "")
                 {
                     TmpInfo tmpInfo = new TmpInfo();
                     int     num     = array[i].LastIndexOf('/') + 1;
                     string  tmp     = array[i].Substring(num, array[i].Length - num);
                     string  tmp2    = array[i].Replace("~", "");
                     tmpInfo.Tmp1 = array[i];
                     tmpInfo.Tmp2 = tmp;
                     tmpInfo.Tmp3 = tmp2;
                     list.Add(tmpInfo);
                 }
             }
             this.rpt.DataSource = list;
             this.rpt.DataBind();
         }
     }
 }
Esempio n. 21
0
        // GET: PaperInfo/Create
        public IActionResult Create()
        {
            PaperInfo paperInfo = new PaperInfo();

            PopulatePaperKeywordData(paperInfo);

            //var paperInfo = new PaperInfo();
            //PopulateAssignedKeywordData(paperInfo);


            PopulateDropDownLists();
            return(View());
        }
Esempio n. 22
0
        /// <summary>
        /// 保存纸张类型列表
        /// </summary>
        /// <param name="lstPaperInfos">纸张类型列表</param>
        public bool SavePaperList(List <PaperInfo> lstPaperInfos)
        {
            if (lstPaperInfos == null || lstPaperInfos.Count <= 0)
            {
                GlobalMethods.IO.DeleteFile(this.m_szPaperConfigFile);
                return(false);
            }
            if (!GlobalMethods.Xml.CreateXmlFile(this.m_szPaperConfigFile, "PaperConfig"))
            {
                return(false);
            }

            XmlDocument xmlDoc = GlobalMethods.Xml.GetXmlDocument(this.m_szPaperConfigFile);

            if (xmlDoc == null)
            {
                return(false);
            }

            for (int index = 0; index < lstPaperInfos.Count; index++)
            {
                PaperInfo paperInfo = lstPaperInfos[index];
                XmlNode   node      = GlobalMethods.Xml.CreateXmlNode(xmlDoc, null, "Item", null);
                if (node == null)
                {
                    continue;
                }

                if (!GlobalMethods.Xml.SetXmlAttrValue(node, "Name", paperInfo.Name))
                {
                    continue;
                }

                if (!GlobalMethods.Xml.SetXmlAttrValue(node, "Width", paperInfo.Width.ToString()))
                {
                    continue;
                }

                if (!GlobalMethods.Xml.SetXmlAttrValue(node, "Height", paperInfo.Height.ToString()))
                {
                    continue;
                }

                if (!GlobalMethods.Xml.SetXmlAttrValue(node, "Printer", paperInfo.Printer))
                {
                    continue;
                }
            }
            return(GlobalMethods.Xml.SaveXmlDocument(xmlDoc, this.m_szPaperConfigFile));
        }
Esempio n. 23
0
        public bool SavePaper(PaperInfo paperInfo)
        {
            bool b = false;

            if (paperInfo.Id > 0)
            {
                b = adminDAL.UpdatePaper(paperInfo);
            }
            else
            {
                b = adminDAL.Input(paperInfo);
            }
            return(b);
        }
Esempio n. 24
0
 public ActionResult deletePaper(Guid Paper_Id)
 {
     try
     {
         EODB      eodb      = new EODB();
         PaperInfo paperinfo = eodb.paperinfo.Find(Paper_Id);
         eodb.paperinfo.Remove(paperinfo);
         eodb.SaveChanges();
         return(Content("success"));
     }
     catch {
         return(Content("error"));
     }
 }
Esempio n. 25
0
 protected void Del_All(object sender, EventArgs e)
 {
     foreach (RepeaterItem repeaterItem in this.rpt.Items)
     {
         HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
         if (htmlInputCheckBox.Checked)
         {
             int       id   = Convert.ToInt32(htmlInputCheckBox.Value);
             PaperInfo byId = Paper.Init().GetById(id);
             Help.DeleteFiles(byId.FilePath);
             Paper.Init().Delete(id);
         }
     }
     this.Show();
 }
Esempio n. 26
0
        public ViewResult Input(PaperInfo paperInfo)
        {
            var file1 = Request["img1"];
            var file2 = Request["img2"];
            var file3 = Request["img3"];
            var file4 = Request["img4"];
            var file5 = Request["img5"];

            var video = Request["video"];


            ViewBag.msg = "";

            return(View("Input"));
        }
Esempio n. 27
0
        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));
                    }
                }
            }
        }
Esempio n. 28
0
    protected void Save_Btn(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(base.Request.QueryString["pid"]))
        {
            PaperInfo paperInfo = Paper.Init().GetById(Convert.ToInt32(base.Request.QueryString["pid"]));
            paperInfo.FilePath        = this.UpdateFiles();
            paperInfo.PaperName       = this.PaperName.Value;
            paperInfo.Notes           = this.Notes.Value;
            paperInfo.SendDep         = this.SendDep.Value;
            paperInfo.PaperSymbol     = this.PaperSymbol.Value;
            paperInfo.PaperGrade      = this.PaperGrade.Value;
            paperInfo.PaperDate       = this.PaperDate.Value;
            paperInfo.ShareDeps       = this.userlist_dep.Value.Trim();
            paperInfo.namelist        = this.namelist_dep.Value;
            paperInfo.TypeID          = Convert.ToInt32(base.Request.Form["TypeID"]);
            paperInfo.AddTime         = DateTime.Now.ToString("yyyy-MM-dd");
            paperInfo.CreatorID       = Convert.ToInt32(this.Uid);
            paperInfo.CreatorRealName = this.RealName;
            paperInfo.CreatorDepName  = this.DepName;
            Paper.Init().Update(paperInfo);
        }
        else
        {
            PaperInfo paperInfo = new PaperInfo();
            paperInfo.FilePath        = this.UpdateFiles();
            paperInfo.PaperName       = this.PaperName.Value;
            paperInfo.Notes           = this.Notes.Value;
            paperInfo.SendDep         = this.SendDep.Value;
            paperInfo.PaperSymbol     = this.PaperSymbol.Value;
            paperInfo.PaperGrade      = this.PaperGrade.Value;
            paperInfo.PaperDate       = this.PaperDate.Value;
            paperInfo.ShareDeps       = this.userlist_dep.Value.Trim();
            paperInfo.namelist        = this.namelist_dep.Value;
            paperInfo.TypeID          = Convert.ToInt32(base.Request.Form["TypeID"]);
            paperInfo.AddTime         = DateTime.Now.ToString("yyyy-MM-dd");
            paperInfo.CreatorID       = Convert.ToInt32(this.Uid);
            paperInfo.CreatorRealName = this.RealName;
            paperInfo.CreatorDepName  = this.DepName;
            Paper.Init().Add(paperInfo);
        }
        string str = HttpContext.Current.Server.HtmlEncode("您好!电子档案已编辑成功!");

        base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
    }
        public void Export(string name)
        {
            ExportManager export = new ExportManager();

            var p = new List <PaperInfo>();

            foreach (var l in wallpaper.TimeLayer)
            {
                var paper = new PaperInfo(l.StartTime, l.Length);
                foreach (var e in l.Layer)
                {
                    var elem = new ElementInfo(e.Scale, e.Location, e.Image, e.Code);
                    paper.Layer.Add(elem);
                }
                p.Add(paper);
            }

            export.Export(new DirectoryInfo(Directory.GetCurrentDirectory()).FullName, name, p);
        }
    public void FillInfo()
    {
        int paperID = Convert.ToInt32(Request[RequestMSG.ID]);
        PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business();

        info = paperInfoMan.GetPaperInfo(paperID);
        if (info != null)
        {
            btnRefereesSelection.Visible        = info.CanBeSelectRefrees;
            btnEditorSelection.Visible          = info.CanBeSelectEditorByChefEditor;
            btnLanguageEditorSelection.Visible  = info.CanBeSelectLanguageEditor;
            btnAcceptByChefEditor.Visible       = info.CanBeAcceptByChefEditor;
            ddlEvaluationForm.Visible           = info.CanBeAcceptByChefEditor;
            btnRejectByChefEditor.Visible       = info.CanBeRejectByChefEditor;
            btnAcceptArbitration.Visible        = info.CanBeAcceptByReferee;
            btnRejectArbitrationArticle.Visible = info.CanBeRejectByReferee;
            btnEvaluation.Visible     = info.CanBeEvaluatByReferee;
            btnRevise.Visible         = info.CanBeReviseByEditor;
            btnReviseComment.Visible  = info.CanBeReviseByEditor;
            btnReviseByAuthor.Visible = info.CanBeReviseByAuthor_Step1;
            //btnRefereesOpinion.Visible = info.canbe
            btnFinalApproval.Visible = info.CanBeTechnicalApproval;
            //
            lblTitle.Text      = info.Title;
            lblAbstract.Text   = info.Abstracts;
            lblFieldPaper.Text = info.Feilds;
            lblKeyWord.Text    = info.Keyword;
            //------Fill GridView --------//
            gvAuthors.DataSource = info.Authors;
            DataBind();
            //
            gvReferees.DataSource = info.Referees;
            DataBind();
            //-----------Files------------//
            QuestionInfoMan_Business questionInfoMan = new QuestionInfoMan_Business();
            List <EvaluationForm>    list            = questionInfoMan.GetEvaluationForms();
            for (int i = 0; i < list.Count; i++)
            {
                ddlEvaluationForm.Items.Add(new ListItem(list[i].Title, list[i].ID.ToString()));
            }
        }
    }
 public void FillInfo()
 {
     int paperID = Convert.ToInt32(Request[RequestMSG.ID]);
     PaperInfoMan_Business paperInfoMan = new PaperInfoMan_Business();
     info = paperInfoMan.GetPaperInfo(paperID);
     if (info != null)
     {
         btnRefereesSelection.Visible = info.CanBeSelectRefrees;
         btnEditorSelection.Visible = info.CanBeSelectEditorByChefEditor;
         btnLanguageEditorSelection.Visible = info.CanBeSelectLanguageEditor;
         btnAcceptByChefEditor.Visible = info.CanBeAcceptByChefEditor;
         ddlEvaluationForm.Visible = info.CanBeAcceptByChefEditor;
         btnRejectByChefEditor.Visible = info.CanBeRejectByChefEditor;
         btnAcceptArbitration.Visible = info.CanBeAcceptByReferee;
         btnRejectArbitrationArticle.Visible = info.CanBeRejectByReferee;
         btnEvaluation.Visible = info.CanBeEvaluatByReferee;
         btnRevise.Visible = info.CanBeReviseByEditor;
         btnReviseComment.Visible = info.CanBeReviseByEditor;
         btnReviseByAuthor.Visible = info.CanBeReviseByAuthor_Step1;
         //btnRefereesOpinion.Visible = info.canbe
         btnFinalApproval.Visible = info.CanBeTechnicalApproval;
         //
         lblTitle.Text = info.Title;
         lblAbstract.Text = info.Abstracts;
         lblFieldPaper.Text = info.Feilds;
         lblKeyWord.Text = info.Keyword;
         //------Fill GridView --------//
         gvAuthors.DataSource = info.Authors;
         DataBind();
         //
         gvReferees.DataSource = info.Referees;
         DataBind();
         //-----------Files------------//
         QuestionInfoMan_Business questionInfoMan = new QuestionInfoMan_Business();
         List<EvaluationForm> list = questionInfoMan.GetEvaluationForms();
         for (int i = 0; i < list.Count; i++)
         {
             ddlEvaluationForm.Items.Add(new ListItem(list[i].Title, list[i].ID.ToString()));
         }
     }
 }
Esempio n. 32
0
 //获取试卷的详细信息
 /// <summary>
 /// 获取试卷的详细信息
 /// </summary>
 /// <param name="PaperID"></param>
 /// <returns></returns>
 public static PaperInfo PaperInfo_Get(int PaperID)
 {
     using (var conn = DbHelper.CommonService())
     {
         PaperInfo pi = new PaperInfo();
         var p = new DynamicParameters();
         p.Add("@PaperID", PaperID);
         var paperinfo = conn.QueryMultiple("PaperInfo_Get", p, commandType: CommandType.StoredProcedure);
         List<Paper> paper = paperinfo.Read<Paper>().ToList();
         if (paper != null && paper.Count > 0)
         {
             pi.paper = paper[0];
         }
         pi.papergrouplist = paperinfo.Read<PaperGroup>().ToList();
         pi.attachmentlist = paperinfo.Read<Attachment>().ToList();
         pi.exerciselist = paperinfo.Read<PaperExercise>().ToList();
         pi.ExerciseChoices = paperinfo.Read<ExerciseChoice>().ToList();
         pi.ExerciseAttachmentlist = paperinfo.Read<Attachment>().ToList();
         return pi;
     }
 }
Esempio n. 33
0
        /// <summary>
        /// 获取学生的考试用的试卷详细信息
        /// </summary>
        /// <param name="PaperID"></param>
        /// <param name="TestID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public static PaperInfo PaperInfo_Get(int PaperID, int TestID, int UserID)
        {
            using (var conn = DbHelper.CommonService())
            {
                PaperInfo pi = PaperInfo_Get(PaperID);
                PaperInfo pi_rand = new PaperInfo();

                var p = new DynamicParameters();
                p.Add("@TestID", TestID);
                p.Add("@PaperID", PaperID);
                p.Add("@UserID", UserID);
                var paperinfo = conn.QueryMultiple("TestTacticExercise_Get", p, commandType: CommandType.StoredProcedure);

                pi_rand.exerciselist = paperinfo.Read<PaperExercise>().ToList();
                pi_rand.ExerciseChoices = paperinfo.Read<ExerciseChoice>().ToList();
                pi_rand.ExerciseAttachmentlist = paperinfo.Read<Attachment>().ToList();

                if (pi.exerciselist.Count > 0)
                {
                    // pi.exerciselist.Concat(pi_rand.exerciselist);
                    if (pi_rand.exerciselist.Count > 0)
                    {
                        if (pi.paper != null)
                        {
                            pi.paper.IsTactic = 1;
                        }

                        for (int i = 0; i < pi_rand.exerciselist.Count; i++)
                        {
                            pi.exerciselist.Add(pi_rand.exerciselist[i]);
                        }

                        //for (int i = 0; i < pi.exerciselist.Count; i++)
                        //{
                        //    pi_rand.exerciselist.Add(pi.exerciselist[i]);
                        //}
                        //pi.exerciselist = pi_rand.exerciselist;
                    }
                }
                else
                {
                    if (pi_rand.exerciselist.Count > 0)
                    {
                        if (pi.paper != null)
                        {
                            pi.paper.IsTactic = 1;
                        }
                    }

                    pi.exerciselist = pi_rand.exerciselist;
                }
                if (pi.ExerciseChoices.Count > 0)
                {
                    // pi.ExerciseChoices.Concat(pi_rand.ExerciseChoices);
                    if (pi_rand.ExerciseChoices.Count > 0)
                    {
                        for (int i = 0; i < pi_rand.ExerciseChoices.Count; i++)
                        {
                            pi.ExerciseChoices.Add(pi_rand.ExerciseChoices[i]);
                        }
                    }

                }
                else
                {
                    pi.ExerciseChoices = pi_rand.ExerciseChoices;
                }
                if (pi.ExerciseAttachmentlist.Count > 0)
                {
                    //pi.ExerciseAttachmentlist.Concat(pi_rand.ExerciseAttachmentlist);
                    if (pi_rand.ExerciseAttachmentlist.Count > 0)
                    {
                        for (int i = 0; i < pi_rand.ExerciseAttachmentlist.Count; i++)
                        {
                            pi.ExerciseAttachmentlist.Add(pi_rand.ExerciseAttachmentlist[i]);
                        }
                    }
                }
                else
                {
                    pi.ExerciseAttachmentlist = pi_rand.ExerciseAttachmentlist;
                }

                if (pi.exerciselist.Count > 0)
                {
                    int flag=0;
                    for (int i = 0; i < pi.exerciselist.Count; i++)
                    {
                        if (pi.exerciselist[i].ParentExerciseID == 0) {
                            flag++;
                            pi.exerciselist[i].Orde = flag;
                            pi.exerciselist[i].OrdeIsShow =true;
                        }
                        else if (pi.exerciselist[i].ParentExerciseID ==-1)
                        {
                            int fcount =0;
                            List<PaperExercise> pkkk = pi.exerciselist.Where(x => x.ParentExerciseID == pi.exerciselist[i].ExerciseID).ToList();
                            for (int k = 0; k < pkkk.Count; k++)
                            {
                                if (pkkk[k].ParentExerciseID == pi.exerciselist[i].ExerciseID)
                                {
                                    fcount = k + 1;

                                    pkkk[k].Orde = flag + fcount;
                                    pkkk[k].OrdeIsShow = true;
                                }
                            }

                            flag = flag + pkkk.Count;

                        }

                    }
                }

                return pi;
            }
        }
Esempio n. 34
0
        /// <summary>
        /// 获取预览用的试卷详细信息
        /// </summary>
        /// <param name="PaperID"></param>
        /// <param name="TestID"></param>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public static PaperInfo PaperInfo_Get(int PaperID, string ExerciseIDs)
        {
            try
            {
                using (var conn = DbHelper.ResourceService())
                {
                    PaperInfo pi = new PaperInfo();
                    var p = new DynamicParameters();
                    p.Add("@PaperID", PaperID);
                    p.Add("@ExerciseIDS", ExerciseIDs);
                    var paperinfo = conn.QueryMultiple("PaperInfo_Get", p, commandType: CommandType.StoredProcedure);

                    List<Paper> paper = paperinfo.Read<Paper>().ToList();
                    if (paper != null && paper.Count > 0)
                    {
                        pi.paper = paper[0];
                    }
                    pi.papergrouplist = paperinfo.Read<PaperGroup>().ToList();
                    pi.attachmentlist = paperinfo.Read<Attachment>().ToList();
                    pi.exerciselist = paperinfo.Read<PaperExercise>().ToList();
                    pi.ExerciseChoices = paperinfo.Read<ExerciseChoice>().ToList();
                    pi.ExerciseAttachmentlist = paperinfo.Read<Attachment>().ToList();
                    return pi;
                }

            }
            catch (Exception e)
            {
                PaperInfo pi = new PaperInfo();
                Paper paper = new Paper();
                paper.Papername = e.Message;
                pi.paper = paper;
                return pi;
                throw;
            }
        }