/// <summary>
 /// 获得一条论文的详细信息
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Treatise details(Guid id)
 {
     Treatise treatise = new Treatise();
     DatabaseAccess database = new DatabaseAccess();
     String sql = "select treatise.*,xpath.websitename,xpath.baseurl from treatise,xpath where treatise.id='" + id + "' and treatise.sourceid=xpath.id";
     try {
         SqlDataReader result = database.executeQuery(sql);
         while (result.Read()) {
             treatise.Id = result.GetGuid(0);
             treatise.Articleurl = result.GetString(1);
             treatise.Sourceid = result.GetGuid(2);
             treatise.Cntitle = result.GetString(3);
             treatise.Entitle = result.GetString(4);
             treatise.Unitname = result.GetString(5);
             treatise.Types = result.GetString(6);
             treatise.Author = result.GetString(7);
             treatise.Articletype = result.GetString(8);
             treatise.Source = result.GetString(9);
             treatise.Language = result.GetString(10);
             treatise.Journalname = result.GetString(11);
             treatise.Publishtime = result.GetString(12);
             treatise.Levels = result.GetString(13);
             treatise.Recordtype = result.GetString(14);
             treatise.Websitename = result.GetString(15);
             treatise.Baseurl = result.GetString(16);
         }
     } catch (Exception e) {
         throw new Exception(e.Message);
     } finally {
         database.close();
     }
     return treatise;
 }
コード例 #2
0
        private void BindDetail()
        {
            Treatise t = bt.GetTreatisesByID(Utils.StrToInt(id, 0));

            lttitle.Text  = t.TreatiseName;
            ltauthor.Text = t.Author;

            ltexpert.Text  = t.EName ?? "无";
            ltlm.Text      = t.LmMemberName ?? "无";
            lttd.Text      = t.TdMemberName ?? "无";
            ltpublish.Text = t.Publishing;
            ltdate.Text    = t.FinishTime.ToString();
            ltproject.Text = t.ProjectName ?? "无";
            aimg.ImageUrl  = PicFilePathV + t.Picpath;
            ltsum.Text     = t.Summary;
            ltcatalog.Text = t.Catalog;
        }
コード例 #3
0
        private void BindDetail()
        {
            hftreatiseID.Value = treatiseID;
            Treatise t = bt.GetTreatisesByID(Utils.StrToInt(hftreatiseID.Value, 0));

            txtBookName.Text   = t.TreatiseName;
            txtauthor.Text     = t.Author;
            txtPublishing.Text = t.Publishing;
            string str = t.Catalog;

            str              = str.Replace("&lt;", "<");
            str              = str.Replace("&gt;", ">");
            str              = str.Replace("&nbsp;", " ");
            str              = str.Replace("<br>", "\r\n");
            txtCatalog.Text  = str;
            txtsummary.Text  = t.Summary;
            StarTime.Text    = t.FinishTime.ToString();
            ImgNews.ImageUrl = PicFilePathV + t.Picpath;

            if (t.ExpertID != null || t.ExpertID != 0)
            {
                dpExpert.SelectedValue = t.ExpertID.ToString();
            }

            if (t.ProjectID != null || t.ProjectID != 0)
            {
                dpProject.SelectedValue = t.ProjectID.ToString();
            }

            if (t.LmMemberID != null || t.LmMemberID != 0)
            {
                dpLm.SelectedValue = t.LmMemberID.ToString();
            }

            if (t.TdMemberID != null || t.TdMemberID != 0)
            {
                dpTd.SelectedValue = t.TdMemberID.ToString();
            }
            if (t.StuMemberID != null || t.StuMemberID != 0)
            {
                dpstu.SelectedValue = t.StuMemberID.ToString();
            }
        }
コード例 #4
0
        protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            string savepath = DateTime.Now.Year + "_" + DateTime.Now.Month + "/" + DateTime.Now.Day;

            Treatise t = new Treatise();

            t.TreatiseID   = bt.GetMaxID() + 1;
            t.TreatiseName = PubCom.CheckString(txtBookName.Text.Trim());
            t.FinishTime   = DateTime.Parse(StarTime.Text.Trim());
            t.Author       = PubCom.CheckString(txtauthor.Text.Trim());
            t.Publishing   = PubCom.CheckString(txtPublishing.Text.Trim());
            t.Summary      = PubCom.CheckString(txtsummary.Text.Trim());
            string str = txtCatalog.Text.Trim();

            str       = str.Replace("<", "&lt;");
            str       = str.Replace(">", "&gt;");
            str       = str.Replace(" ", "&nbsp;");
            str       = str.Replace("\r\n", "<br>");
            t.Catalog = str;
            if (dpExpert.SelectedValue != "")
            {
                t.ExpertID = Utils.StrToInt(dpExpert.SelectedValue, 0);
            }
            if (dpLm.SelectedValue != "")
            {
                t.LmMemberID = Utils.StrToInt(dpLm.SelectedValue, 0);
            }
            if (dpTd.SelectedValue != "")
            {
                t.TdMemberID = Utils.StrToInt(dpTd.SelectedValue, 0);
            }
            if (dpProject.SelectedValue != "")
            {
                t.ProjectID = Utils.StrToInt(dpProject.SelectedValue, 0);
            }
            if (dpstu.SelectedValue != "")
            {
                t.StuMemberID = Utils.StrToInt(dpstu.SelectedValue, 0);
            }
            if (bt.Insert(t) == 1)
            {
                bt.UploadValidate(pic_upload, lbl_pic, PicFilePath, savepath, t.TreatiseID);


                //// 插入日志 add
                SysOperateLog log = new SysOperateLog();
                log.LogID          = StringHelper.getKey();
                log.LogType        = LogType.专著信息.ToString();
                log.OperateUser    = GetLogUserName();
                log.OperateDate    = DateTime.Now;
                log.LogOperateType = "专著新增";

                log.LogAfterObject = JsonHelper.Obj2Json(t);
                bsol.Insert(log);
                Message.ShowOKAndRedirect(this, "添加专著成功", "TreatiseManage.aspx");
            }

            else
            {
                Message.ShowWrong(this, "添加专著失败!");
                return;
            }
        }
 /// <summary>
 /// 分页获得用户的所有论文
 /// </summary>
 /// <param name="page">分页时第几页</param>
 /// <param name="size">每页显示的数据量</param>
 /// <param name="zgxm">职业的姓名</param>
 /// <returns></returns>
 public List<Treatise> list(int page,int size,string zgxm)
 {
     List<Treatise> list = new List<Treatise>();
     DatabaseAccess database = new DatabaseAccess();
     String sql = "select top(" + size + ") * from treatise where author like '%" + zgxm + "%' and id not in(select top(" + (page - 1) * size + ") id from treatise where author like '%" + zgxm + "%' )";
     try {
         SqlDataReader result = database.executeQuery(sql);
         while (result.Read()) {
             Treatise treatise = new Treatise();
             treatise.Id = result.GetGuid(0);
             treatise.Articleurl = result.GetString(1);
             treatise.Sourceid = result.GetGuid(2);
             treatise.Cntitle = result.GetString(3);
             treatise.Entitle = result.GetString(4);
             treatise.Unitname = result.GetString(5);
             treatise.Types = result.GetString(6);
             treatise.Author = result.GetString(7);
             treatise.Articletype = result.GetString(8);
             treatise.Source = result.GetString(9);
             treatise.Language = result.GetString(10);
             treatise.Journalname = result.GetString(11);
             treatise.Publishtime = result.GetString(12);
             treatise.Levels = result.GetString(13);
             treatise.Recordtype = result.GetString(14);
             list.Add(treatise);
         }
     } catch (Exception e) {
         throw new Exception(e.Message);
     } finally {
         database.close();
     }
     return list;
 }
 /// <summary>
 /// 插入一条新的论文记录到数据库
 /// </summary>
 /// <param name="treatise"></param>
 /// <returns></returns>
 public Boolean insert(Treatise treatise)
 {
     Boolean insert = false;
     DatabaseAccess database = new DatabaseAccess();
     String sql = "insert into treatise (id,articleurl,sourceid,cntitle,entitle,unitname,types,author,articletype,source,language,journalname,publishtime,levels,recordtype) values(NewId(),'"+
        treatise.Articleurl+"','"+treatise.Sourceid+"','"+ treatise.Cntitle + "','" + treatise.Entitle + "','" + treatise.Unitname + "','" + treatise.Types + "','" + treatise.Author + "','" + treatise.Articletype + "','" + treatise.Source + "','" + treatise.Language + "','" + treatise.Journalname + "','" + treatise.Publishtime + "','" + treatise.Levels + "','" + treatise.Recordtype + "')";
     try{
         insert = database.executeUpdate(sql);
     }
     catch (Exception e){
         throw new Exception(e.Message);
     } finally {
         database.close();
     }
     return insert;
 }
コード例 #7
0
 public int Update(Treatise m)
 {
     return(db.Update <Treatise>(m));
 }
コード例 #8
0
 public int Delete(Treatise m)
 {
     return(db.Delete <Treatise>(m));
 }
コード例 #9
0
 public int Insert(Treatise m)
 {
     return(db.Insert <Treatise>(m));
 }
コード例 #10
0
 public int Delete(Treatise a)
 {
     return(da.Delete(a));
 }
コード例 #11
0
 public int Update(Treatise a)
 {
     return(da.Update(a));
 }
コード例 #12
0
 public int Insert(Treatise a)
 {
     return(da.Insert(a));
 }