Example #1
0
        /// <summary>
        /// 根据工作日历主键索引,删除与工作日历关联的列外日期记录
        /// </summary>
        /// <param name="strVacationId">工作日历主键索引</param>
        /// <returns></returns>
        public string DeleteByVacationID(string strVacationId)
        {
            string strMsg = string.Empty;

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

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

                strFilter.Append(" T_HR_VACATIONSET.VACATIONID == @0");

                objArgs.Add(strVacationId);

                OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
                flag = dalOutPlanDays.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                string strOrderBy = " OUTPLANDAYID ";
                var    q          = dalOutPlanDays.GetOutPlanDaysRdListByMultSearch(strOrderBy, strFilter.ToString(), objArgs.ToArray());

                if (q == null)
                {
                    return(strMsg);
                }

                if (q.Count() == 0)
                {
                    return(strMsg);
                }

                foreach (T_HR_OUTPLANDAYS item in q)
                {
                    dalOutPlanDays.Delete(item);
                }

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

            return(strMsg);
        }
Example #2
0
        /// <summary>
        /// 新增列外日期信息
        /// </summary>
        /// <param name="entLTRd"></param>
        /// <returns></returns>
        public string AddOutPlanDays(T_HR_OUTPLANDAYS entTemp)
        {
            string strMsg = string.Empty;

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

                T_HR_VACATIONSET entVacSet = entTemp.T_HR_VACATIONSET;
                if (entVacSet == null)
                {
                    return("{REQUIREDFIELDS}");
                }

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

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

                objArgs.Add(entTemp.OUTPLANDAYID);

                OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
                flag = dalOutPlanDays.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_OUTPLANDAYS ent = new T_HR_OUTPLANDAYS();
                Utility.CloneEntity <T_HR_OUTPLANDAYS>(entTemp, ent);
                ent.T_HR_VACATIONSETReference.EntityKey =
                    new System.Data.EntityKey("TM_SaaS_OA_EFModelContext.T_HR_VACATIONSET", "VACATIONID", entTemp.T_HR_VACATIONSET.VACATIONID);

                Utility.RefreshEntity(ent);

                dalOutPlanDays.Add(ent);

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

            return(strMsg);
        }
Example #3
0
        /// <summary>
        /// 修改列外日期信息
        /// </summary>
        /// <param name="entLTRd"></param>
        /// <returns></returns>
        public string ModifyOutPlanDays(T_HR_OUTPLANDAYS entTemp)
        {
            string strMsg = string.Empty;

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

                T_HR_VACATIONSET entVacSet = entTemp.T_HR_VACATIONSET;
                if (entVacSet == null)
                {
                    return("{REQUIREDFIELDS}");
                }

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

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

                objArgs.Add(entTemp.OUTPLANDAYID);

                OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
                flag = dalOutPlanDays.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_OUTPLANDAYS entUpdate = dalOutPlanDays.GetOutPlanDaysRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                Utility.CloneEntity(entTemp, entUpdate);

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

            return(strMsg);
        }
Example #4
0
        /// <summary>
        /// 获取列外日期信息
        /// </summary>
        /// <param name="strOutPlanDaysId">主键索引</param>
        /// <returns></returns>
        public T_HR_OUTPLANDAYS GetOutPlanDaysByID(string strOutPlanDaysId)
        {
            if (string.IsNullOrEmpty(strOutPlanDaysId))
            {
                return(null);
            }

            OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
            StringBuilder  strfilter      = new StringBuilder();
            List <string>  objArgs        = new List <string>();

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

            T_HR_OUTPLANDAYS entRd = dalOutPlanDays.GetOutPlanDaysRdByMultSearch(strfilter.ToString(), objArgs.ToArray());

            return(entRd);
        }
Example #5
0
        /// <summary>
        /// 根据主键索引,删除列外日期信息(注:暂定为物理删除)
        /// </summary>
        /// <param name="strVacationId">主键索引</param>
        /// <returns></returns>
        public string DeleteOutPlanDays(string strOutPlanDaysId)
        {
            string strMsg = string.Empty;

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

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

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

                objArgs.Add(strOutPlanDaysId);

                OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
                flag = dalOutPlanDays.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_OUTPLANDAYS entDel = dalOutPlanDays.GetOutPlanDaysRdByMultSearch(strFilter.ToString(), objArgs.ToArray());

                dalOutPlanDays.Delete(entDel);

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

            return(strMsg);
        }
Example #6
0
        /// <summary>
        /// 根据条件,获取列外日期信息
        /// </summary>
        /// <param name="strOwnerID"></param>
        /// <param name="strVacationId"></param>
        /// <param name="strCountyType"></param>
        /// <param name="strDayType"></param>
        /// <param name="strSortKey"></param>
        /// <returns></returns>
        public IQueryable <T_HR_OUTPLANDAYS> GetAllOutPlanDaysRdListByMultSearch(string strOwnerID, string strVacationId, string strCountyType, string strDayType, string strSortKey)
        {
            OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();

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

            if (!string.IsNullOrEmpty(strVacationId))
            {
                strfilter.Append(" T_HR_VACATIONSET.VACATIONID == @0");
                objArgs.Add(strVacationId);
            }

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

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

                strfilter.Append(" T_HR_VACATIONSET.COUNTYTYPE == @" + iIndex.ToString());
                objArgs.Add(strCountyType);
            }

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

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

                strfilter.Append(" DAYTYPE == @" + iIndex.ToString());
                objArgs.Add(strDayType);
            }

            string filterString = strfilter.ToString();

            SetOrganizationFilterWithPrefix(ref filterString, ref objArgs, strOwnerID, "T_HR_VACATIONSET", "T_HR_VACATIONSET.");

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

            var q = dalOutPlanDays.GetOutPlanDaysRdListByMultSearch(strOrderBy, filterString, objArgs.ToArray());

            return(q);
        }
Example #7
0
        /// <summary>
        /// 获取公共假期设置信息
        /// </summary>
        /// <param name="strAsignObjectType">分配对象类型</param>
        /// <param name="strAsignObjectID">分配对象ID</param>
        /// <param name="strCountyType">国家/地区</param>
        /// <param name="strDaysType">列外日期类别(公共假期/工作日)</param>
        /// <returns></returns>
        public IQueryable <T_HR_OUTPLANDAYS> GetOutPlanDaysRdListByAsignObjectAndCountyType(string strAsignObjectType, string strAsignObjectID, string strCountyType, string strDaysType)
        {
            if (string.IsNullOrEmpty(strCountyType))
            {
                return(null);
            }

            OutPlanDaysDAL dalOutPlanDays = new OutPlanDaysDAL();
            StringBuilder  strfilter      = new StringBuilder();
            List <string>  objArgs        = new List <string>();
            string         strOrderBy     = " STARTDATE ";
            int            iIndex         = 0;

            if (!string.IsNullOrEmpty(strAsignObjectType.Trim()))
            {
                strfilter.Append(" T_HR_VACATIONSET.ASSIGNEDOBJECTTYPE == @0");
                objArgs.Add(strAsignObjectType);
            }

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

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

                strfilter.Append(" T_HR_VACATIONSET.ASSIGNEDOBJECTID == @" + iIndex.ToString());
                objArgs.Add(strAsignObjectID);
            }

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

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

                strfilter.Append(" T_HR_VACATIONSET.COUNTYTYPE == @" + iIndex.ToString());
                objArgs.Add(strCountyType);
            }

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

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

                strfilter.Append(" DAYTYPE == @" + iIndex.ToString());
                objArgs.Add(strDaysType);
            }

            var q = dalOutPlanDays.GetOutPlanDaysRdListByMultSearch(strOrderBy, strfilter.ToString(), objArgs.ToArray());

            return(q);
        }