Beispiel #1
0
        /// <summary>
        /// 修改
        /// </summary>
        private void Save()
        {
            bool res = false;

            tid = Utils.GetInt(Utils.GetFormValue("domId"));
            if (tid > 0)
            {
                pdModel = pdBll.GetModel(tid);
                pdModel.DocumentName = Utils.GetFormValue("domname");
                if (Request.Files.Count > 0)
                {
                    string filepath    = string.Empty;
                    string oldfilename = string.Empty;
                    bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["upfile"], "UserCenterFile", out filepath, out oldfilename);
                    if (result)
                    {
                        pdModel.FilePath = filepath;
                    }
                }
                res = pdBll.Update(pdModel);
            }

            if (res)
            {
                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();window.parent.location.reload();", "修改成功", Utils.GetQueryStringValue("iframeId")));
            }
            else
            {
                MessageBox.ShowAndClose(this, "修改失败!");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 分页获取列表
        /// </summary>
        /// <param name="pageSize">每页现实条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="RecordCount">总记录数</param>
        /// <param name="CompanyId">公司编号 =0返回所有</param>
        /// <param name="OperatorId">上传人编号 =0返回所有</param>
        /// <returns>文档管理列表</returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.PersonDocument> GetList(int pageSize, int pageIndex, ref int RecordCount, int CompanyId, int OperatorId)
        {
            IList <EyouSoft.Model.PersonalCenterStructure.PersonDocument> list = new List <EyouSoft.Model.PersonalCenterStructure.PersonDocument>();
            string        tableName  = "tbl_Document";
            string        fields     = "DocumentId,DocumentName,FilePath,OperatorId,OperatorName,CreateTime";
            string        primaryKey = "DocumentId";
            string        orderbyStr = " CreateTime Desc ";
            StringBuilder strWhere   = new StringBuilder(" IsDelete='0' ");

            if (CompanyId > 0)
            {
                strWhere.AppendFormat(" and CompanyId={0} ", CompanyId);
            }
            //TODO:根据OperatorId获取相关权限
            if (OperatorId > 0)
            {
                strWhere.AppendFormat("");
            }
            using (IDataReader dr = DbHelper.ExecuteReader(this._db, pageSize, pageIndex, ref RecordCount, tableName, primaryKey, fields, strWhere.ToString(), orderbyStr))
            {
                while (dr.Read())
                {
                    EyouSoft.Model.PersonalCenterStructure.PersonDocument model = new EyouSoft.Model.PersonalCenterStructure.PersonDocument();
                    if (!dr.IsDBNull(dr.GetOrdinal("DocumentId")))
                    {
                        model.DocumentId = dr.GetInt32(dr.GetOrdinal("DocumentId"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("DocumentName")))
                    {
                        model.DocumentName = dr[dr.GetOrdinal("DocumentName")].ToString();
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("FilePath")))
                    {
                        model.FilePath = dr[dr.GetOrdinal("FilePath")].ToString();
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("OperatorId")))
                    {
                        model.OperatorId = dr.GetInt32(dr.GetOrdinal("OperatorId"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("OperatorName")))
                    {
                        model.OperatorName = dr[dr.GetOrdinal("OperatorName")].ToString();
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("CreateTime")))
                    {
                        model.CreateTime = dr.GetDateTime(dr.GetOrdinal("CreateTime"));
                    }
                    list.Add(model);
                    model = null;
                }
            }
            return(list);
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!CheckGrant(global::Common.Enum.TravelPermission.个人中心_文档管理_下载文档))
     {
         Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.个人中心_文档管理_下载文档, false);
     }
     pdModel = new EyouSoft.Model.PersonalCenterStructure.PersonDocument();
     pdBll   = new EyouSoft.BLL.PersonalCenterStructure.PersonDocument(SiteUserInfo);
     if (!IsPostBack)
     {
         DomBind();
     }
 }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     pdModel = new EyouSoft.Model.PersonalCenterStructure.PersonDocument();
     pdBll   = new EyouSoft.BLL.PersonalCenterStructure.PersonDocument(SiteUserInfo);
     type    = Utils.GetQueryStringValue("type");
     if (IsPostBack)
     {
         Save();
     }
     else
     {
         DomBind();
     }
 }
Beispiel #5
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="model">文档管理实体</param>
 /// <returns>true:成功 false:失败</returns>
 public bool Update(EyouSoft.Model.PersonalCenterStructure.PersonDocument model)
 {
     EyouSoft.Data.Document DocumentModel = dcDal.Document.FirstOrDefault(item => item.CompanyId == model.CompanyId &&
                                                                          item.DocumentId == model.DocumentId);
     if (DocumentModel != null)
     {
         DocumentModel.CompanyId    = model.CompanyId;
         DocumentModel.CreateTime   = DateTime.Now;
         DocumentModel.DocumentId   = model.DocumentId;
         DocumentModel.DocumentName = model.DocumentName;
         DocumentModel.FilePath     = model.FilePath;
         DocumentModel.IsDelete     = model.IsDelete ? "1" : "0";
         DocumentModel.OperatorId   = model.OperatorId;
         DocumentModel.OperatorName = model.OperatorName;
         dcDal.SubmitChanges();
     }
     return(dcDal.ChangeConflicts.Count == 0 ? true : false);
 }
Beispiel #6
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="model">文档管理实体</param>
 /// <returns>true:成功 false:失败</returns>
 public bool Add(EyouSoft.Model.PersonalCenterStructure.PersonDocument model)
 {
     EyouSoft.Data.Document DocumentModel = new EyouSoft.Data.Document()
     {
         CompanyId    = model.CompanyId,
         CreateTime   = DateTime.Now,
         DocumentId   = model.DocumentId,
         DocumentName = model.DocumentName,
         FilePath     = model.FilePath,
         IsDelete     = model.IsDelete ? "1" : "0",
         OperatorId   = model.OperatorId,
         OperatorName = model.OperatorName
     };
     dcDal.Document.InsertOnSubmit(DocumentModel);
     DocumentModel = null;
     dcDal.SubmitChanges();
     return(dcDal.ChangeConflicts.Count == 0 ? true : false);
 }
Beispiel #7
0
        /// <summary>
        /// 保存
        /// </summary>
        private void Save()
        {
            EyouSoft.Model.PersonalCenterStructure.PersonDocument pdModel = new EyouSoft.Model.PersonalCenterStructure.PersonDocument();
            pdModel.DocumentName = Utils.GetFormValue("domname");
            pdModel.CreateTime   = DateTime.Now;
            pdModel.OperatorName = SiteUserInfo.ContactInfo.ContactName;
            pdModel.CompanyId    = CurrentUserCompanyID;
            pdModel.OperatorId   = SiteUserInfo.ID;
            if (Request.Files.Count > 0)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["upfile"], "UserCenterFile", out filepath, out oldfilename);
                if (result)
                {
                    pdModel.FilePath = filepath;
                }
            }
            EyouSoft.BLL.PersonalCenterStructure.PersonDocument pdBll = new EyouSoft.BLL.PersonalCenterStructure.PersonDocument(SiteUserInfo);
            bool res = false;

            res = pdBll.Add(pdModel);

            string conti = Utils.GetFormValue("continue");

            if (res)
            {
                if (conti == "continue")
                {
                    MessageBox.ShowAndCloseReload(this, "保存成功!");
                }
                else
                {
                    MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();window.parent.location.reload();", "保存成功", Utils.GetQueryStringValue("iframeId")));
                }
            }
            else
            {
                MessageBox.ShowAndReturnBack(this, "保存失败!", 1);
            }
        }
Beispiel #8
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model">文档管理实体</param>
        /// <returns>true:成功 false:失败</returns>
        public bool Update(EyouSoft.Model.PersonalCenterStructure.PersonDocument model)
        {
            if (model == null)
            {
                return(false);
            }
            bool Result = idal.Update(model);

            if (Result)
            {
                HandleLogsBll.Add(
                    new EyouSoft.Model.CompanyStructure.SysHandleLogs()
                {
                    ModuleId     = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_文档管理,
                    EventCode    = Model.CompanyStructure.SysHandleLogsNO.EventCode,
                    EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_文档管理.ToString() + "修改了个人文档!编号为:" + model.DocumentId,
                    EventTitle   = "修改" + Model.EnumType.CompanyStructure.SysPermissionClass.个人中心_文档管理.ToString() + "数据"
                });
            }
            return(Result);
        }
Beispiel #9
0
 /// <summary>
 /// 修改文档数据绑定
 /// </summary>
 private void DomBind()
 {
     tid     = Utils.GetInt(Utils.GetQueryStringValue("tid"));
     pdModel = pdBll.GetModel(tid);
     //pdModel = new EyouSoft.Model.PersonalCenterStructure.PersonDocument();
 }