예제 #1
0
        /// <summary>
        /// 上传一个文书档案原件
        /// </summary>
        /// <param name="title">文件名(不含扩展名)</param>
        /// <param name="localFilePath">完整路径</param>
        public void UploadFile_WS(string title, string localFilePath, bool IsDeleteOld)
        {
            SetValue(title);
            int DocID = uploadScan_WS.GetDocID(ContentNum, FileNum, DocNum);

            if (DocID != 0)
            {
                bool upload = UpLoadDownLoad.UpLoadFile(localFilePath, ref fileName, ref fileNameExt, ref RemoteFileName, ref uploadURI);

                //上传原件成功后,将原件信息存储至数据库
                if (upload)
                {
                    int    xh          = Convert.ToInt32(IndexNum);                        //序号
                    string description = fileName.Substring(0, fileName.LastIndexOf(".")); //获取文件名称为描述
                    int    index       = UpLoadDownLoad.TopUploadURI.Length;
                    string saveURI     = uploadURI.Substring(index);

                    //添加原件信息到数据库
                    int YjID = uploadScan_WS.GetYjID(ContentNum, FileNum, DocNum, IndexNum);
                    if (YjID > 0)
                    {
                        if (IsDeleteOld)
                        {
                            uploadScan_WS.DeleteYj(YjID);
                        }
                        else
                        {
                            return;
                        }
                    }
                    uploadScan_WS.InsertYj(DocID, xh, description, fileNameExt, saveURI, RemoteFileName);
                }
            }
        }
예제 #2
0
        private void UpLoadYj(int YjID)
        {
            bool upload = UpLoadDownLoad.UpLoadFile(localFilePath, ref fileName, ref fileNameExt, ref RemoteFileName, ref uploadURI);

            //上传原件成功后,将原件信息存储至数据库
            if (upload)
            {
                int    xh          = OldCJ_yj.getYjMaxNum(DocID) + 1;                  //序号
                string description = fileName.Substring(0, fileName.LastIndexOf(".")); //获取文件名称为描述
                int    index       = UpLoadDownLoad.TopUploadURI.Length;
                string saveURI     = uploadURI.Substring(index);

                //添加原件信息到数据库
                if (YjID == 0)
                {
                    YjID = OldCJ_yj.insertYj(DocID, xh, description, fileNameExt, saveURI, RemoteFileName);
                    if (YjID <= 0)
                    {
                        return;
                    }
                }
                else
                {
                    //修改原件的存储信息
                    OldCJ_yj.ChangeYj(YjID, description, fileNameExt, saveURI, RemoteFileName);
                }

                //刷新dgv
                ds               = OldCJ_yj.getData(DocID);
                dgvRows          = ds.Tables[0].Rows.Count + 1;
                dgvYj.DataSource = ds.Tables[0];
                table            = ds.Tables[0];
                lbldgvNum.Text   = Convert.ToString(dgvYj.Rows.Count - 1);
            }
        }
예제 #3
0
        private bool UpLoadYj(int newYjNum, int docID)
        {
            bool upload = UpLoadDownLoad.UpLoadFile(localFilePath, ref fileName, ref fileNameExt, ref RemoteFileName, ref uploadURI);

            //上传原件成功后,将原件信息存储至数据库
            if (upload)
            {
                int    xh          = newYjNum;                                         //序号
                string description = fileName.Substring(0, fileName.LastIndexOf(".")); //获取文件名称为描述
                int    index       = UpLoadDownLoad.TopUploadURI.Length;
                string saveURI     = uploadURI.Substring(index);

                if (uploadScan_CJ.insertCJYJ(isCJNew, docID, xh, description, fileNameExt, saveURI, RemoteFileName) > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #4
0
        /// <summary>
        /// 上传一个归档文件档案原件
        /// </summary>
        /// <param name="title">文件名(不含扩展名)</param>
        /// <param name="localFilePath">完整路径</param>
        public void UploadFile_GD(string title, string localFilePath, bool IsDeleteOld)
        {
            //Title:GD_10年_2010_党务人事类_001_002
            string[] list = title.Split('_');
            if (list != null && list.Length == 6)
            {
                Limit    = list[1].ToString();
                Year     = list[2].ToString();
                LeiMu    = list[3].ToString();
                DocNum   = list[4].ToString();
                IndexNum = list[5].ToString();
            }
            int DocID = uploadScan_GD.GetDocID(Limit, Year, LeiMu, DocNum);

            if (DocID != 0)
            {
                bool upload = UpLoadDownLoad.UpLoadFile(localFilePath, ref fileName, ref fileNameExt, ref RemoteFileName, ref uploadURI);

                //上传原件成功后,将原件信息存储至数据库
                if (upload)
                {
                    int    xh          = Convert.ToInt32(IndexNum);                        //序号
                    string description = fileName.Substring(0, fileName.LastIndexOf(".")); //获取文件名称为描述
                    int    index       = UpLoadDownLoad.TopUploadURI.Length;
                    string saveURI     = uploadURI.Substring(index);

                    //添加原件信息到数据库
                    int YjID = uploadScan_GD.GetYjID(Limit, Year, LeiMu, DocNum, IndexNum);
                    if (YjID > 0)
                    {
                        if (IsDeleteOld)
                        {
                            uploadScan_GD.DeleteYj(YjID);
                        }
                        else
                        {
                            return;
                        }
                    }
                    uploadScan_GD.InsertYj(DocID, xh, description, fileNameExt, saveURI, RemoteFileName);
                }
            }
        }