⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 paperdynamic.aspx.cs

📁 学术会议在线投稿系统 fghgfhgfhgfhfgh
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ViewPage_PaperDynamic : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int ArticleId = Convert.ToInt32(Session["ArticleId"].ToString());
        PaperOp select_paper = new PaperOp();

        DataTable dt = new DataTable();
        dt = select_paper.select_paperinformation_dynamic(ArticleId);
        if (dt.Rows.Count == 0)
        {
            Server.Transfer("~/ViewPage/LoginError.aspx");
        }
        else
        {
            foreach (DataRow dr in dt.Rows)
            {
                TableRow tr = new TableRow();
                for (int j = 0; j < dt.Columns.Count - 1; j++)
                {
                    switch (j)
                    {
                        case 0:
                          Writertb.Text= dr[0].ToString();
                            break;
                        case 1:
                          Subjecttb.Text = dr[1].ToString();
                            break;
                        case 2:
                           Dd1.SelectedValue = dr[2].ToString();
                            break;
                        case 3:
                            Abstracttb.Text = dr[3].ToString();
                            break;
                        case 4:
                            String temp = dr[4].ToString();
                            Keywordstb1.Text = temp;
                            break;
                  

                    }

                }

            }
        }
    }
    protected void Submitbtn_Click(object sender, EventArgs e)
    {
        String FileName ="";
        String ArticleUrl="";
        int ArticleId = Convert.ToInt32(Session["ArticleId"].ToString());
        HttpFileCollection files = HttpContext.Current.Request.Files;
       
        for (int i = 0; i < files.Count; i++)
        {
            if (files[i].FileName != "" || files[i] != null)
            {
                int FileSize = 6 * 1024 * 1024;
                HttpPostedFile myFile = files[i];
                string strFilePath = myFile.FileName.ToString().Trim();
                this.lblAttachmentError.Text = "<" + strFilePath + ">"; // Show file name 
                int nFindSlashPos = strFilePath.Trim().LastIndexOf("\\") + 1;
                string UploadFileName = strFilePath.Substring(nFindSlashPos);
                FileName = "YeeWen" + "_" + Session["Email"].ToString() + "_" + UploadFileName;

                if (myFile.FileName.Trim() == "") // Empty value in Browse Box
                {
                    this.lblAttachmentError.Text = "No file selected.";
                    return;
                }

                if (myFile.ContentLength != 0)
                {
                    if (myFile.ContentLength > FileSize)
                    {
                        this.lblAttachmentError.Text = "File Size is limited to 6 MB only.";
                        return;
                    }
                    //this.lblAttachment.Text += "<BR>" + FileName;
                    this.lblAttachmentError.Text = "";
                    //       string s=this.Request.PhysicalApplicationPath.ToString().Trim();
                    //       string s1=this.Request.ApplicationPath.ToString().Trim();
                    //       string s3=this.Server.MapPath("");
                    myFile.SaveAs(this.Request.PhysicalApplicationPath.ToString().Trim() + @"\uploads\" + FileName);
                    //myFile.SaveAs(Server.MapPath("uploads" + FileName));
                    ///ArrayFileName[i] = FileName;
                    //       //       return;
                    ArticleUrl = this.Request.PhysicalApplicationPath.ToString().Trim() + @"\uploads\" + FileName;
                }
                else
                {
                    this.lblAttachmentError.Text = "File not found.";
                    return;
                }
            }

            else
                this.lblAttachmentError.Text = "Uploaded File exceed limits.";

        }
        Int32 ModNumber;
        String ArticleName, Subject, Writer, Abstract, Discipline, Statics, Keywords;
        DateTime SubmitDate;
        ArticleName =FileName;
        if (FileName == "")
        {
            GetArticleName getarticlename = new GetArticleName();
            ArticleName = getarticlename.getarticlename(ArticleId);
        }
        Subject = Subjecttb.Text.Trim();
        Writer = Writertb.Text.Trim();
        Keywords = Keywordstb1.Text.Trim() + "," + Keywordstb2.Text.Trim() + "," + Keywordstb3.Text.Trim();
        Abstract = Abstracttb.Text.Trim();
        Discipline = Dd1.SelectedValue;
        GetModNumber getmodnumber = new GetModNumber();
        ModNumber = getmodnumber.getmodnumber_modify(ArticleId)+1;
        Statics= "New";
        SubmitDate = DateTime.Now;
        GetArticleUrl getarticleurl=new GetArticleUrl();
        if (ArticleUrl == "")
        {
            ArticleUrl = getarticleurl.getarticleurl(ArticleId);
        }
        PaperOp update_paper= new PaperOp();
        update_paper.update_article_envoyers(ArticleId,ArticleName,Subject,Writer,Abstract,Discipline,
            Keywords,ArticleUrl,Statics,ModNumber,SubmitDate);
       
    }
    protected void Backbtn_Click(object sender, EventArgs e)
    {
        Server.Transfer("~/ViewPage/PaperList_New_Envoyers.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -