コード例 #1
0
        /// <summary>
        /// 新增考勤方案带薪假信息
        /// </summary>
        /// <param name="entTemp"></param>
        /// <returns></returns>
        public string AddAttendFreeLeave(T_HR_ATTENDFREELEAVE entTemp)
        {
            string strMsg = string.Empty;

            try
            {
                if (entTemp == null)
                {
                    return("{REQUIREDFIELDS}");
                }

                bool          flag      = false;
                StringBuilder strFilter = new StringBuilder();
                List <string> objArgs   = new List <string>();

                strFilter.Append(" T_HR_ATTENDANCESOLUTION.ATTENDANCESOLUTIONID == @0");
                strFilter.Append(" && T_HR_LEAVETYPESET.LEAVETYPESETID == @1");

                objArgs.Add(entTemp.T_HR_ATTENDANCESOLUTION.ATTENDANCESOLUTIONID);
                objArgs.Add(entTemp.T_HR_LEAVETYPESET.LEAVETYPESETID);

                AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();
                flag = dalAttendFreeLeave.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

                if (flag)
                {
                    return("{ALREADYEXISTSRECORD}");
                }

                T_HR_ATTENDFREELEAVE ent = new T_HR_ATTENDFREELEAVE();
                Utility.CloneEntity <T_HR_ATTENDFREELEAVE>(entTemp, ent);

                ent.T_HR_ATTENDANCESOLUTIONReference.EntityKey =
                    new System.Data.EntityKey("SMT_HRM_EFModelContext.T_HR_ATTENDANCESOLUTION", "ATTENDANCESOLUTIONID", entTemp.T_HR_ATTENDANCESOLUTION.ATTENDANCESOLUTIONID);

                ent.T_HR_LEAVETYPESETReference.EntityKey =
                    new System.Data.EntityKey("SMT_HRM_EFModelContext.T_HR_LEAVETYPESET", "LEAVETYPESETID", entTemp.T_HR_LEAVETYPESET.LEAVETYPESETID);

                dalAttendFreeLeave.Add(ent);

                strMsg = "{SAVESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.Message.ToString();
            }

            return(strMsg);
        }
コード例 #2
0
        /// <summary>
        /// 修改考勤方案带薪假信息
        /// </summary>
        /// <param name="entTemp"></param>
        /// <returns></returns>
        public string ModifyAttendFreeLeave(T_HR_ATTENDFREELEAVE entTemp)
        {
            string strMsg = string.Empty;

            try
            {
                if (entTemp == null)
                {
                    return("{REQUIREDFIELDS}");
                }


                bool          flag      = false;
                StringBuilder strFilter = new StringBuilder();
                List <string> objArgs   = new List <string>();

                strFilter.Append(" ATTENDFREELEAVEID == @0");

                objArgs.Add(entTemp.ATTENDFREELEAVEID);

                AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();
                flag = dalAttendFreeLeave.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

                if (!flag)
                {
                    return("{NOTFOUND}");
                }

                T_HR_ATTENDFREELEAVE entUpdate = dalAttendFreeLeave.GetAttendFreeLeaveRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                entUpdate.T_HR_ATTENDANCESOLUTION = entTemp.T_HR_ATTENDANCESOLUTION;
                entUpdate.T_HR_LEAVETYPESET       = entTemp.T_HR_LEAVETYPESET;
                entUpdate.REMARK       = entTemp.REMARK;
                entUpdate.CREATEUSERID = entTemp.CREATEUSERID;
                entUpdate.CREATEDATE   = entTemp.CREATEDATE;
                entUpdate.UPDATEUSERID = entTemp.UPDATEUSERID;
                entUpdate.UPDATEDATE   = entTemp.UPDATEDATE;

                dalAttendFreeLeave.Update(entUpdate);
                strMsg = "{SAVESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.Message.ToString();
            }

            return(strMsg);
        }
コード例 #3
0
        /// <summary>
        /// 根据条件,获取考勤方案带薪假信息
        /// </summary>
        /// <param name="strAttendanceSolutionID"></param>
        /// <param name="strFreeLeaveDaySetID"></param>
        /// <param name="strSortKey"></param>
        /// <returns></returns>
        public IQueryable <T_HR_ATTENDFREELEAVE> GetAllAttendFreeLeaveRdListByMultSearch(string strAttendanceSolutionID, string strFreeLeaveDaySetID, string strSortKey)
        {
            AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();

            StringBuilder strfilter  = new StringBuilder();
            List <string> objArgs    = new List <string>();
            string        strOrderBy = string.Empty;
            int           iIndex     = 0;

            if (!string.IsNullOrEmpty(strAttendanceSolutionID))
            {
                strfilter.Append(" T_HR_ATTENDANCESOLUTION.ATTENDANCESOLUTIONID = @0");
                objArgs.Add(strAttendanceSolutionID);
            }

            if (!string.IsNullOrEmpty(strFreeLeaveDaySetID))
            {
                if (!string.IsNullOrEmpty(strfilter.ToString()))
                {
                    strfilter.Append(" &&");
                }

                if (objArgs.Count() > 0)
                {
                    iIndex = objArgs.Count();
                }

                strfilter.Append(" T_HR_ATTENDANCESOLUTION.FREELEAVEDAYSETID == @" + iIndex.ToString());
                objArgs.Add(strFreeLeaveDaySetID);
            }

            if (!string.IsNullOrEmpty(strSortKey))
            {
                strOrderBy = strSortKey;
            }
            else
            {
                strOrderBy = " ATTENDFREELEAVEID ";
            }

            var q = dalAttendFreeLeave.GetAttendFreeLeaveRdListByMultSearch(strOrderBy, strfilter.ToString(), objArgs.ToArray());

            return(q);
        }
コード例 #4
0
        /// <summary>
        /// 获取考勤方案带薪假信息
        /// </summary>
        /// <param name="strAttendFreeLeaveId">主键索引</param>
        /// <returns></returns>
        public T_HR_ATTENDFREELEAVE GetAttendFreeLeaveByID(string strAttendFreeLeaveId)
        {
            if (string.IsNullOrEmpty(strAttendFreeLeaveId))
            {
                return(null);
            }

            AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();
            StringBuilder      strfilter          = new StringBuilder();
            List <string>      objArgs            = new List <string>();

            if (!string.IsNullOrEmpty(strAttendFreeLeaveId))
            {
                strfilter.Append(" ATTENDFREELEAVEID == @0");
                objArgs.Add(strAttendFreeLeaveId);
            }

            T_HR_ATTENDFREELEAVE entRd = dalAttendFreeLeave.GetAttendFreeLeaveRdByMultSearch(strfilter.ToString(), objArgs.ToArray());

            return(entRd);
        }
コード例 #5
0
        /// <summary>
        /// 根据主键索引,删除考勤方案带薪假信息(注:暂定为物理删除)
        /// </summary>
        /// <param name="strAttendFreeLeaveId">主键索引</param>
        /// <returns></returns>
        public string DeleteAttendFreeLeave(string strAttendFreeLeaveId)
        {
            string strMsg = string.Empty;

            try
            {
                if (string.IsNullOrEmpty(strAttendFreeLeaveId))
                {
                    return("{REQUIREDFIELDS}");
                }

                bool          flag      = false;
                StringBuilder strFilter = new StringBuilder();
                List <string> objArgs   = new List <string>();

                strFilter.Append(" ATTENDFREELEAVEID == @0");

                objArgs.Add(strAttendFreeLeaveId);

                AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();
                flag = dalAttendFreeLeave.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

                if (!flag)
                {
                    return("{NOTFOUND}");
                }

                T_HR_ATTENDFREELEAVE entDel = dalAttendFreeLeave.GetAttendFreeLeaveRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                dalAttendFreeLeave.Delete(entDel);

                strMsg = "{DELETESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.Message.ToString();
            }

            return(strMsg);
        }
コード例 #6
0
        /// <summary>
        /// 根据条件,获取考勤方案带薪假信息
        /// </summary>
        /// <param name="strAttendSolID"></param>
        /// <returns></returns>
        public IQueryable <T_HR_ATTENDFREELEAVE> GetAttendFreeLeaveByAttendSolID(string strAttendSolID)
        {
            if (string.IsNullOrEmpty(strAttendSolID))
            {
                return(null);
            }

            AttendFreeLeaveDAL dalAttendFreeLeave = new AttendFreeLeaveDAL();
            StringBuilder      strfilter          = new StringBuilder();
            List <string>      objArgs            = new List <string>();

            if (!string.IsNullOrEmpty(strAttendSolID))
            {
                strfilter.Append(" T_HR_ATTENDANCESOLUTION.ATTENDANCESOLUTIONID == @0");
                objArgs.Add(strAttendSolID);
            }

            string strOrderBy = " ATTENDFREELEAVEID ";

            var q = dalAttendFreeLeave.GetAttendFreeLeaveRdListByMultSearch(strOrderBy, strfilter.ToString(), objArgs.ToArray());

            return(q);
        }