Esempio n. 1
0
        /// <summary>
        /// 修改离职信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateGovFilePersonnel(EyouSoft.Model.GovStructure.MGovFilePersonnel model)
        {
            bool      IsTrue = false;
            DbCommand dc     = this._db.GetStoredProcCommand("proc_GovFilePersonnel_Update");

            this._db.AddInParameter(dc, "Id", DbType.AnsiStringFixedLength, model.Id);
            this._db.AddInParameter(dc, "FileId", DbType.AnsiStringFixedLength, model.FileId);
            this._db.AddInParameter(dc, "Reason", DbType.String, model.Reason);
            this._db.AddInParameter(dc, "ApplicationTime", DbType.DateTime, model.ApplicationTime);
            this._db.AddInParameter(dc, "TransitionContent", DbType.String, model.TransitionContent);
            this._db.AddInParameter(dc, "TransitionState", DbType.Byte, (int)model.TransitionState);
            this._db.AddInParameter(dc, "OperatorId", DbType.AnsiStringFixedLength, model.OperatorID);
            this._db.AddInParameter(dc, "IssueTime", DbType.DateTime, model.IssueTime);
            this._db.AddInParameter(dc, "IsLeft", DbType.Byte, (int)model.StaffStatus);
            this._db.AddInParameter(dc, "ApproveState", DbType.Byte, (int)model.ApproveState);
            this._db.AddInParameter(dc, "DepartureTime", DbType.DateTime, model.DepartureTime);
            this._db.AddInParameter(dc, "GovPersonnelApproveXML", DbType.Xml, CreateGovPersonnelApproveListXML(model.GovPersonnelApproveList));//审批人业务实体集合
            this._db.AddOutParameter(dc, "Result", DbType.Int32, 4);
            EyouSoft.Toolkit.DAL.DbHelper.RunProcedure(dc, this._db);
            object Result = this._db.GetParameterValue(dc, "Result");

            if (!Result.Equals(null))
            {
                IsTrue = int.Parse(Result.ToString()) > 0 ? true : false;
            }
            return(IsTrue);
        }
Esempio n. 2
0
 /// <summary>
 /// 根据 档案ID 获取离职申请实体信息
 /// </summary>
 /// <param name="ID">档案ID</param>
 /// <returns></returns>
 public EyouSoft.Model.GovStructure.MGovFilePersonnel GetGovFilePersonnelModelByFileId(string ID)
 {
     EyouSoft.Model.GovStructure.MGovFilePersonnel model = null;
     if (!string.IsNullOrEmpty(ID))
     {
         model = new EyouSoft.Model.GovStructure.MGovFilePersonnel();
         model = dal.GetGovFilePersonnelModelByFileId(ID);
     }
     return(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 修改离职申请信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateGovFilePersonnel(EyouSoft.Model.GovStructure.MGovFilePersonnel model)
 {
     if (model != null && !string.IsNullOrEmpty(model.Id) && !string.IsNullOrEmpty(model.FileId) && !string.IsNullOrEmpty(model.OperatorID))
     {
         if (model.GovPersonnelApproveList != null && model.GovPersonnelApproveList.Count > 0)
         {
             for (int i = 0; i < model.GovPersonnelApproveList.Count; i++)
             {
                 model.GovPersonnelApproveList[i].Id = model.Id;
             }
         }
         bool result = dal.UpdateGovFilePersonnel(model);
         if (result)
         {
             SysStructure.BSysLogHandle.Insert("更新一条离职申请信息:编号为:" + model.Id);
         }
         return(result);
     }
     return(false);
 }
Esempio n. 4
0
        /// <summary>
        /// 根据 档案ID 获取离职申请实体信息
        /// </summary>
        /// <param name="ID">档案ID</param>
        /// <returns></returns>
        public EyouSoft.Model.GovStructure.MGovFilePersonnel GetGovFilePersonnelModelByFileId(string ID)
        {
            EyouSoft.Model.GovStructure.MGovFilePersonnel model = null;
            StringBuilder StrSql = new StringBuilder();

            StrSql.Append("SELECT Id,FileId,Reason,ApplicationTime,OperatorID,IssueTime,DepartureTime,IsLeft,ApproveState, ");
            StrSql.Append(" (SELECT TOP 1 Name FROM tbl_GovFile WHERE ID=a.FileId )AS FileName, ");
            StrSql.Append(" (SELECT Id,ApproveID,ApproveName,ApproveTime,ApprovalViews,ApproveState FROM tbl_GovPersonnelApprove WHERE Id=a.Id FOR XML RAW,ROOT('ROOT'))AS GovPersonnelApproveXML ");
            StrSql.AppendFormat(" FROM tbl_GovFilePersonnel a WHERE a.FileId='{0}' ", ID);
            DbCommand dc = this._db.GetSqlStringCommand(StrSql.ToString());

            using (IDataReader dr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(dc, this._db))
            {
                if (dr.Read())
                {
                    model          = new EyouSoft.Model.GovStructure.MGovFilePersonnel();
                    model.Id       = dr.GetString(dr.GetOrdinal("Id"));
                    model.FileId   = dr.GetString(dr.GetOrdinal("FileId"));
                    model.FileName = dr.IsDBNull(dr.GetOrdinal("FileName")) ? "" : dr.GetString(dr.GetOrdinal("FileName"));
                    model.Reason   = dr.IsDBNull(dr.GetOrdinal("Reason")) ? "" : dr.GetString(dr.GetOrdinal("Reason"));
                    if (!dr.IsDBNull(dr.GetOrdinal("ApplicationTime")))
                    {
                        model.ApplicationTime = dr.GetDateTime(dr.GetOrdinal("ApplicationTime"));
                    }
                    model.OperatorID = dr.IsDBNull(dr.GetOrdinal("OperatorID")) ? "" : dr.GetString(dr.GetOrdinal("OperatorID"));
                    if (!dr.IsDBNull(dr.GetOrdinal("IssueTime")))
                    {
                        model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    }
                    if (!dr.IsDBNull(dr.GetOrdinal("DepartureTime")))
                    {
                        model.DepartureTime = dr.GetDateTime(dr.GetOrdinal("DepartureTime"));
                    }
                    model.ApproveState            = (EyouSoft.Model.EnumType.GovStructure.ApprovalStatus)dr.GetByte(dr.GetOrdinal("ApproveState"));
                    model.StaffStatus             = (EyouSoft.Model.EnumType.GovStructure.StaffStatus)Enum.Parse(typeof(EyouSoft.Model.EnumType.GovStructure.StaffStatus), dr.GetByte(dr.GetOrdinal("IsLeft")).ToString());
                    model.GovPersonnelApproveList = this.GetPersonnelApproveList(dr["GovPersonnelApproveXML"].ToString());
                }
            };
            return(model);
        }
Esempio n. 5
0
        /// <summary>
        /// 获取离职信息列表
        /// </summary>
        /// <param name="CompanyId">公司编号</param>
        /// <param name="Name">员工姓名</param>
        /// <param name="PageSize">页面数据总记录数</param>
        /// <param name="PageIndex">当前页数</param>
        /// <param name="RecordCount">每页显示的记录数</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.GovStructure.MGovFilePersonnel> GetGovFilePersonnelList(string CompanyId, string Name, int PageSize, int PageIndex, ref int RecordCount)
        {
            IList <EyouSoft.Model.GovStructure.MGovFilePersonnel> ResultList = null;
            string tableName          = "view_GovFilePersonnel";
            string identityColumnName = "Id";
            string fields             = "Id,FileId,IssueTime,ApproveState,OperatorID,FileName,IsLeft,GovPersonnelApproveXML  ";
            string query = string.Format(" FileId IN(select ID from tbl_GovFile where CompanyId='{0}')", CompanyId);

            if (!string.IsNullOrEmpty(Name))
            {
                query = query + string.Format(" AND FileName LIKE '%{0}%'", Name);
            }
            string orderByString = " IssueTime DESC";

            using (IDataReader dr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(_db, PageSize, PageIndex, ref RecordCount, tableName, identityColumnName, fields, query, orderByString))
            {
                ResultList = new List <EyouSoft.Model.GovStructure.MGovFilePersonnel>();
                EyouSoft.Model.GovStructure.MGovFilePersonnel model = null;
                while (dr.Read())
                {
                    model            = new EyouSoft.Model.GovStructure.MGovFilePersonnel();
                    model.Id         = dr.GetString(dr.GetOrdinal("Id"));
                    model.FileId     = dr.GetString(dr.GetOrdinal("FileId"));
                    model.FileName   = dr.IsDBNull(dr.GetOrdinal("FileName")) ? "" : dr.GetString(dr.GetOrdinal("FileName"));
                    model.OperatorID = dr.GetString(dr.GetOrdinal("OperatorID"));
                    if (!dr.IsDBNull(dr.GetOrdinal("IssueTime")))
                    {
                        model.IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"));
                    }
                    model.ApproveState            = (EyouSoft.Model.EnumType.GovStructure.ApprovalStatus)dr.GetByte(dr.GetOrdinal("ApproveState"));
                    model.StaffStatus             = (EyouSoft.Model.EnumType.GovStructure.StaffStatus)dr.GetByte(dr.GetOrdinal("IsLeft"));
                    model.GovPersonnelApproveList = this.GetPersonnelApproveList(dr["GovPersonnelApproveXML"].ToString());
                    ResultList.Add(model);
                    model = null;
                }
            };
            return(ResultList);
        }