Exemplo n.º 1
0
        public void DeleteFile(string archiveListCellRptID, string singleProjectID)
        {
            T_EFile_BLL bll = new T_EFile_BLL();

            T_EFile_MDL model = new T_EFile_MDL();

            model = bll.GetModel(Convert.ToInt32(archiveListCellRptID));
            if (model != null)
            {
                //删除电子文件
                //if (model != null && model.PDFFilePath != "" && System.IO.File.Exists(PdfPath + model.PDFFilePath))
                //{
                //    System.IO.File.Delete(PdfPath + model.PDFFilePath);
                //}
                //string filePath = string.Concat(model.RootPath, singleProjectID, "\\ODOC\\", model.FilePath);

                //if (filePath != "" && System.IO.File.Exists(filePath))
                //{
                //    System.IO.File.Delete(filePath);
                //}
                //删除电子文件记录
                bll.Delete(Convert.ToInt32(archiveListCellRptID));

                //Leo 更新文件夹,晚上重新生产一次
                int FileListID = model.FileListID;
                BLL.T_FileList_BLL   fileListBLL = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL();
                Model.T_FileList_MDL fileListMDL = fileListBLL.GetModel(FileListID);
                fileListMDL.CONVERT_FLAG = false;
                fileListBLL.Update(fileListMDL);
            }
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BLL.T_FileList_BLL   bll   = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL();
            Model.T_FileList_MDL model = new DigiPower.Onlinecol.Standard.Model.T_FileList_MDL();
            string Action = Request.QueryString["Action"].ToString();

            if (Action == "Modify")
            {
                string FileListID = Request.QueryString["FileListID"].ToString();
                model = bll.GetModel(Common.ConvertEx.ToInt(FileListID));
                model = (Model.T_FileList_MDL)Comm.GetValueToObject(model, this.tbl);

                Model.T_FileList_MDL parentModel = bll.GetModel(Common.ConvertEx.ToInt(tempPID.SelectValue));
                model.PID = parentModel.recID;//换了父类的话

                bll.Update(model);
            }
            else
            {
                //取父类的的呢东西,
                //model = bll.GetModel("recID=" + Common.ConvertEx.ToInt(PID.SelectValue) + " AND SingleProjectID=" + SingleProjectID.Value);
                Model.T_FileList_MDL parentModel = bll.GetModel(Common.ConvertEx.ToInt(tempPID.SelectValue));

                model = parentModel;
                model = (Model.T_FileList_MDL)Comm.GetValueToObject(model, this.tbl);

                model.SingleProjectID    = parentModel.SingleProjectID;
                model.DefaultCompanyType = parentModel.DefaultCompanyType;
                model.PID = parentModel.recID;

                model.recID      = bll.GetMaxRecID(SingleProjectID.Value.ToString());
                model.FileListID = 0;     //新增的,不可以真用老的
                model.IsFolder   = false;
                model.IsSystem   = false; //这是自定议的,可以删除
                bll.Add(model);
            }
            Response.Redirect("Wjdj.aspx?SingleProjectID=" + SingleProjectID.Value + "&WorkFlowID=" + WorkFlowID.Value + "&PageIndex=" + pPageIndex);
        }