protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(UserArchiveAdd)); MyAddInit(); if (!IsPostBack) { tempPID.Attributes("onchange", "OnchangeBH()"); tempPID.AutoPostBack = false; if (Request.QueryString["WorkFlowID"] != null) { WorkFlowID.Value = Request.QueryString["WorkFlowID"].ToString(); } if (!String.IsNullOrEmpty(ID)) { SingleProjectID.Value = ID; tempPID.DataBindEx(Common.ConvertEx.ToInt(ID), true); } string Action = Request.QueryString["Action"].ToString(); if (Action == "Modify") { string FileListID = Request.QueryString["FileListID"].ToString(); BLL.T_FileList_BLL archiveListBLL = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL(); Model.T_FileList_MDL archiveListMDL = archiveListBLL.GetModel(Common.ConvertEx.ToInt(FileListID)); Model.T_FileList_MDL parentMDL = archiveListBLL.GetModel("SingleProjectID=" + SingleProjectID.Value + " AND recID=" + archiveListMDL.PID); DigiPower.Onlinecol.Standard.Web.Comm.SetValueToPage(archiveListMDL, this.tbl); tempPID.SelectValue = parentMDL.FileListID.ToString();//父类 } } }
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="type"></param> /// <returns></returns> public string GetBH(string SingleProjectId, string filelistId) { string bh = string.Empty; T_FileList_BLL fileBLL = new T_FileList_BLL(); T_FileList_MDL fileMDL = fileBLL.GetModel(Convert.ToInt32(filelistId)); if (fileMDL != null) { if (fileMDL.IsFolder) { bh = dal.GetBH(fileMDL.BH, SingleProjectId, fileMDL.recID.ToString()); } else { string Maxbh = dal.GetSingle("select MAX(bh) from t_filelist where singleprojectid=" + SingleProjectId + " and bh like '" + fileMDL.BH + "%' "); //最大编号 if (Maxbh == fileMDL.BH) { bh = string.Concat(Maxbh, "-", (1).ToString("D3")); } else { int LastIndex = Common.ConvertEx.ToInt(Maxbh.Substring(Maxbh.LastIndexOf("-") + 1)); string MaxIndex = Common.ConvertEx.ToInt(LastIndex + 1).ToString("D3"); bh = string.Concat(Maxbh.Substring(0, Maxbh.LastIndexOf("-") + 1), MaxIndex); } } } return(bh); }
/// <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); }