Example #1
0
        private void cmdSave_Click(object sender, System.EventArgs e)
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
            string mySql;


            if (bEditMode == false)
            {
                mySql = GetStyleInsertData();

                //拟稿
                DocID = df.AddDocument(UserName, FlowID, mySql);

                //上传文件
                UploadFile(DocID);

                df = null;

                //转到查看稿件
                Server.Transfer("NewDocument.aspx?FlowID=" + FlowID.ToString() + "&DocID=" + DocID.ToString());
            }
            else
            {
                mySql = GetStyleUpdateData(DocID);

                //Response.Write("<script language='javascript'>alert('" + mySql + "');</script>");
                df.UpdateDocument(mySql);

                string FileName = df.GetAttachName(DocID);
                if (FileName.Length > 0)
                {
                    df.DeleteAttach(DocID);
                    if (System.IO.File.Exists(Server.MapPath(@"." + FileName)) == true)
                    {
                        System.IO.File.Delete(Server.MapPath(@"." + FileName));
                    }
                }

                //上传文件
                UploadFile(DocID);

                df = null;
                //修改编辑文件
            }
            Response.AddHeader("Refresh", "1");
        }
Example #2
0
        private void cmdSave_Click(object sender, System.EventArgs e)
        {
            UDS.Components.DocumentFlow df = new UDS.Components.DocumentFlow();
            string mySql;

            if(bEditMode==false)
            {

                mySql= GetStyleInsertData();

                //���
                DocID=df.AddDocument(UserName,FlowID,mySql);

                //�ϴ��ļ�
                UploadFile(DocID);

                df = null;

                //ת���鿴���
                Server.Transfer("NewDocument.aspx?FlowID=" + FlowID.ToString() + "&DocID=" + DocID.ToString());

            }
            else
            {
                mySql = GetStyleUpdateData(DocID);

                //Response.Write("<script language='javascript'>alert('" + mySql + "');</script>");
                df.UpdateDocument(mySql);

                string FileName = df.GetAttachName(DocID);
                if(FileName.Length>0)
                {
                    df.DeleteAttach(DocID);
                    if(System.IO.File.Exists(Server.MapPath(@"." + FileName))==true)
                        System.IO.File.Delete(Server.MapPath(@"." + FileName));
                }

                //�ϴ��ļ�
                UploadFile(DocID);

                df = null;
                //�޸ı༭�ļ�
            }
            Response.AddHeader("Refresh","1");
        }