コード例 #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);
            }
        }
コード例 #2
0
        /// <summary>
        /// 绑定工程下的归档目录
        /// </summary>
        /// <param name="SingleProjectID">工程ID</param>
        /// <param name="PID">PID=0</param>
        /// <param name="DataValueField">绑定主键</param>
        public void DataBindEx(int SingleProjectID, string PID, string DataValueField, string bh = null)
        {
            BLL.T_FileList_BLL bll      = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL();
            DataSet            ds       = new DataSet();
            string             strWhere = "SingleProjectID=" + SingleProjectID;

            if (!string.IsNullOrWhiteSpace(PID))
            {
                strWhere += " AND PID=" + PID;;
            }

            if (bh != null)
            {
                strWhere += " AND IsFolder=1 and BH like '" + bh + "%'";
            }
            ds = bll.GetList(strWhere);
            if (ds.Tables.Count > 0)
            {
                DropDownList1.DataTextField  = "title";
                DropDownList1.DataValueField = DataValueField;
                DropDownList1.DataSource     = ds;
                DropDownList1.DataBind();
            }

            DropDownList1.Items.Insert(0, new ListItem("无", "0"));
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        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();//父类
                }
            }
        }
コード例 #5
0
        public void DataBindEx(int SingleProjectID, bool IsFolder)
        {
            BLL.T_FileList_BLL bll       = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL();
            DataSet            ds        = new DataSet();
            string             strWhere2 = "SingleProjectID=" + SingleProjectID;

            if (IsFolder == true)
            {
                strWhere2 += " AND IsFolder='True'";
            }
            ds = bll.GetList(strWhere2);

            if (ds.Tables.Count > 0)
            {
                DataTable outDT = ds.Tables[0].Copy();
                outDT.Clear();
                Recursion(ds.Tables[0], 0, 0, ref outDT);
                ds.Tables.Clear();
                ds.Tables.Add(outDT);

                BLL.T_SingleProject_BLL   spBLL = new T_SingleProject_BLL();
                Model.T_SingleProject_MDL spMDL = spBLL.GetModel(SingleProjectID);
                string strWhere = "1=1";
                if (Common.Session.GetSession("SuperAdmin").ToLower() == "true")
                {//Leo 超级管理员看全部
                }
                else if (spMDL != null && spMDL.CompanyUserID == Common.ConvertEx.ToInt(Common.Session.GetSession("UserID")))
                {//Leo 工程管理员也看全部
                }
                else
                {
                    strWhere += " and OperateUserID=" + Common.Session.GetSession("UserID");
                }

                if (strWhere != "1=1")
                {
                    if (ds.Tables.Count > 0)
                    {
                        DataView dv = ds.Tables[0].Copy().DefaultView;
                        dv.RowFilter = strWhere;
                        if (dv.Count != ds.Tables[0].Rows.Count)
                        {
                            ds.Tables[0].Clear();
                            ds.Tables.RemoveAt(0);
                            ds.Tables.Add(dv.ToTable());
                        }
                    }
                }
            }

            DropDownList1.DataTextField  = "TitleNew";
            DropDownList1.DataValueField = "FileListID";
            DropDownList1.DataSource     = ds;
            DropDownList1.DataBind();
            //DropDownList1.Items.Insert(0, new ListItem("无", "0"));
        }
コード例 #6
0
        public void UpdatedhNew(string ArchiveID)
        {
            int           wzCount_P = 0;
            int           tzCount_P = 0;
            int           zpCount_P = 0;
            T_Archive_MDL mdl       = dal.GetModel(int.Parse(ArchiveID));
            DataSet       ds        = dal.GetList("ShortDH='' AND SingleProjectID=" + mdl.SingleProjectID);

            if (ds != null && ds.Tables.Count > 0)
            {
                DataRow[] drList     = ds.Tables[0].Select("", "xh");
                int       maxShortDH = dal.GetMaxShortDH();
                maxShortDH++;
                BLL.T_FileList_BLL fileBLL = new T_FileList_BLL();

                foreach (DataRow dr in drList)
                {
                    mdl         = dal.GetModel(int.Parse(dr["archiveid"].ToString()));
                    mdl.ShortDH = maxShortDH.ToString();

                    //Leo 案卷sl统计 2012-09-26
                    int ManualCount = fileBLL.GetManualCountByArchiveID(mdl.ArchiveID);
                    if (mdl.ajlx == "183")
                    {
                        mdl.wzCount = ManualCount;
                        wzCount_P  += ManualCount;
                    }
                    if (mdl.ajlx == "184")
                    {
                        mdl.tzCount = ManualCount;
                        tzCount_P  += ManualCount;
                    }
                    if (mdl.ajlx == "185")
                    {
                        mdl.zpCount = ManualCount;
                        zpCount_P  += ManualCount;
                    }

                    dal.Update(mdl);
                    maxShortDH++;
                }
            }

            //Leo 2012-09-26
            if (mdl.SingleProjectID != null)
            {
                BLL.T_SingleProject_BLL   projBLL = new T_SingleProject_BLL();
                Model.T_SingleProject_MDL projMDL = projBLL.GetModel(int.Parse(mdl.SingleProjectID.ToString()));
                projMDL.wzCount = wzCount_P;
                projMDL.tzCount = tzCount_P;
                projMDL.zpCount = zpCount_P;
                projBLL.Update(projMDL);
            }
        }
コード例 #7
0
        /// <summary>
        /// 绑定工程下的归档目录
        /// </summary>
        /// <param name="SingleProjectID">工程ID</param>
        /// <param name="PID">PID=0</param>
        public void DataBindEx(int SingleProjectID, string PID)
        {
            BLL.T_FileList_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_FileList_BLL();
            DataSet            ds  = new DataSet();

            ds = bll.GetList("SingleProjectID=" + SingleProjectID + " AND PID=" + PID);

            if (ds.Tables.Count > 0)
            {
                DropDownList1.DataTextField  = "title";
                DropDownList1.DataValueField = "recID";
                DropDownList1.DataSource     = ds;
                DropDownList1.DataBind();
            }

            DropDownList1.Items.Insert(0, new ListItem("无", "0"));
        }
コード例 #8
0
        /// <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);
        }