Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // This page is used to receive the file submitted by AceoffixCtrl.
     Aceoffix.FileRequest freq = new Aceoffix.FileRequest();
     freq.SaveToFile(Server.MapPath("doc/") + freq.FileName);
     freq.Close();
 }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.FileRequest freq = new Aceoffix.FileRequest();

        string id = Request.QueryString["id"];

        if (id != null && id.Length > 0)
        {
            string          strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|demo_paper.mdb";
            OleDbConnection conn    = new OleDbConnection(strConn);
            byte[]          aa      = freq.FileBytes;

            OleDbCommand cm = new OleDbCommand();
            cm.Connection  = conn;
            cm.CommandType = CommandType.Text;
            if (conn.State == 0)
            {
                conn.Open();
            }
            cm.CommandText = "UPDATE  Stream SET Word=@file WHERE ID=" + id;
            OleDbParameter spFile = new OleDbParameter("@file", OleDbType.Binary);
            spFile.Value = aa;
            cm.Parameters.Add(spFile);
            cm.ExecuteNonQuery();
            conn.Close();

            freq.CustomSaveResult = "ok";
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script1", "alert('Save Failure');location.href='Default.aspx';", true);
        }

        freq.Close();
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _user = _NguoidungDAL.GetUserByUserName(HPCSecurity.CurrentUser.Identity.Name);
        if (Request["matinbai"] != null)
        {
            matinbai = double.Parse(Request["matinbai"].ToString());
        }

        obj                 = SetItem();
        matinbai            = Daltinbai.InsertT_Tinbai_WordOnline(obj);
        Session["matinbai"] = matinbai;
        Pathfolder          = Global.Pathfiledoc;
        if (freq.FileExtName == ".htm")
        {
            Filedoc = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".htm";
        }
        else
        {
            Filedoc = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".doc";
        }
        CreateFolderByUserName(Pathfolder);
        Filedoc = Server.MapPath("/" + Pathfolder + Filedoc);
        freq.SaveToFile(Filedoc);
        freq.Close();
        string filehtm     = _user.UserID.ToString() + _user.UserName + matinbai.ToString() + "_" + Request["MaDoiTuong"].ToString() + ".htm";
        string pathfilehtm = Server.MapPath("/" + Pathfolder + filehtm);

        Daltinbai.sp_updatenoidungtin(matinbai, ReadHtmlFile(pathfilehtm));
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     // This page is used to receive the file submitted by AceoffixCtrl.
     Aceoffix.FileRequest freq = new Aceoffix.FileRequest();
     freq.SaveToFile(Server.MapPath("../doc/") + freq.FileName);
     Label1.Text = freq.DocumentText;
     freq.ShowPage(500, 500);
     freq.Close();
 }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.FileRequest freq = new Aceoffix.FileRequest();
        string subject            = freq.GetFormField("FileSubject");
        string newFileName        = Insert(subject);

        freq.SaveToFile(Server.MapPath("doc/") + newFileName);
        freq.CustomSaveResult = "ok";
        freq.Close();
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // This page is used to receive the file submitted by AceoffixCtrl.
        string strID = Request.QueryString["id"];

        if (strID == null)
        {
            Response.Write("The ID querystring of this page is not found.");
            return;
        }

        Aceoffix.FileRequest freq = new Aceoffix.FileRequest();

        string          connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|demo.mdb";
        OleDbConnection conn       = new OleDbConnection(connstring);

        conn.Open();
        OleDbCommand cmd = new OleDbCommand();

        cmd.Connection  = conn;
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "update documents set FileType = @filetype, FileName = @filename, FileExtName = @fileextname, FileSize = @filesize, FileBin = @file where ID = @id";
        //cmd.CommandText = "insert into documents(FileType, FileName, FileExtName, FileSize, FileBin) values(@filetype, @filename, @fileextname, @filesize, @file)"; // for adding new file.
        OleDbParameter spFileType = new OleDbParameter("@filetype", OleDbType.VarChar, 50);

        spFileType.Value = "Word";
        cmd.Parameters.Add(spFileType);
        OleDbParameter spFileName = new OleDbParameter("@filename", OleDbType.VarChar, 50);

        spFileName.Value = freq.FileName;
        cmd.Parameters.Add(spFileName);
        OleDbParameter spFileExtName = new OleDbParameter("@fileextname", OleDbType.VarChar, 50);

        spFileExtName.Value = freq.FileExtName;
        cmd.Parameters.Add(spFileExtName);
        OleDbParameter spFileSize = new OleDbParameter("@filesize", OleDbType.Integer);

        spFileSize.Value = freq.FileSize;
        cmd.Parameters.Add(spFileSize);
        OleDbParameter spFile = new OleDbParameter("@file", OleDbType.Binary);

        spFile.Value = freq.FileBytes;
        cmd.Parameters.Add(spFile);
        OleDbParameter spID = new OleDbParameter("@id", OleDbType.Integer);

        spID.Value = strID;
        cmd.Parameters.Add(spID);
        cmd.ExecuteNonQuery();
        conn.Close();

        freq.Close();
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Aceoffix.FileRequest freq = new Aceoffix.FileRequest();
        freq.SaveToFile(Server.MapPath("doc/") + freq.FileName);


        if (Request.QueryString["id"] != null && Request.QueryString["id"].Trim().Length > 0) //Get the parameter
        {
            id = int.Parse(Request.QueryString["id"].Trim());
        }


        if (freq.GetFormField("userName") != null && freq.GetFormField("userName").Trim().Length > 0) //Get the form field
        {
            userName = freq.GetFormField("userName");
        }


        if (freq.GetFormField("age") != null && freq.GetFormField("age").Trim().Length > 0)
        {
            age = int.Parse(freq.GetFormField("age"));
        }


        if (freq.GetFormField("selSex") != null && freq.GetFormField("selSex").Trim().Length > 0)
        {
            sex = freq.GetFormField("selSex");
        }

        string          connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|demo_param.mdb";
        OleDbConnection conn       = new OleDbConnection(connstring);

        conn.Open();

        string       strsql;
        OleDbCommand cmd = new OleDbCommand();

        cmd.Connection  = conn;
        cmd.CommandType = CommandType.Text;
        strsql          = "Update Users set UserName = '******', age = " + age + ",sex = '" + sex + "' where id = " + id;
        cmd.CommandText = strsql;
        cmd.ExecuteNonQuery();
        conn.Close();

        freq.ShowPage(300, 200);
        freq.Close();
    }
Ejemplo n.º 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Aceoffix.FileRequest freq = new Aceoffix.FileRequest();
     freq.SaveToFile(Server.MapPath("doc/") + freq.FileName);
     freq.Close();
 }