コード例 #1
0
        /// <summary>
        /// 修改排班模板明细信息
        /// </summary>
        /// <param name="entTemp"></param>
        /// <returns></returns>
        public string ModifyTemplateDetail(T_HR_SCHEDULINGTEMPLATEDETAIL 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(" TEMPLATEDETAILID == @0");

                objArgs.Add(entTemp.TEMPLATEDETAILID);

                SchedulingTemplateDetailDAL dalSchedulingTemplateDetail = new SchedulingTemplateDetailDAL();
                flag = dalSchedulingTemplateDetail.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_SCHEDULINGTEMPLATEDETAIL entUpdate = dalSchedulingTemplateDetail.GetSchedulingTemplateDetailRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                Utility.RefreshEntity(entTemp);
                entUpdate.SCHEDULINGDATE = entTemp.SCHEDULINGDATE;
                entUpdate.REMARK         = entTemp.REMARK;
                entUpdate.UPDATEDATE     = entTemp.UPDATEDATE;
                entUpdate.UPDATEUSERID   = entTemp.UPDATEUSERID;
                entUpdate.CREATEDATE     = entTemp.CREATEDATE;
                entUpdate.CREATEUSERID   = entTemp.CREATEUSERID;

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

            return(strMsg);
        }
コード例 #2
0
        /// <summary>
        /// 获取排班模板明细信息
        /// </summary>
        /// <param name="strSchedulingTemplateDetailId">主键索引</param>
        /// <returns></returns>
        public T_HR_SCHEDULINGTEMPLATEDETAIL GetSchedulingTemplateDetailByID(string strTemplateDetailId)
        {
            if (string.IsNullOrEmpty(strTemplateDetailId))
            {
                return(null);
            }

            SchedulingTemplateDetailDAL dalSchedulingTemplateDetail = new SchedulingTemplateDetailDAL();
            StringBuilder strfilter = new StringBuilder();
            List <string> objArgs   = new List <string>();

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

            T_HR_SCHEDULINGTEMPLATEDETAIL entRd = dalSchedulingTemplateDetail.GetSchedulingTemplateDetailRdByMultSearch(strfilter.ToString(), objArgs.ToArray());

            return(entRd);
        }
コード例 #3
0
        /// <summary>
        /// 根据主键索引,删除T_HR_SCHEDULINGTEMPLATEDETAIL信息(注:暂定为物理删除)
        /// </summary>
        /// <param name="strTemplateDetailId">主键索引</param>
        /// <returns></returns>
        public string DeleteTemplateDetail(string strTemplateDetailId)
        {
            string strMsg = string.Empty;

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

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

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

                objArgs.Add(strTemplateDetailId);

                SchedulingTemplateDetailDAL dalSchedulingTemplateDetail = new SchedulingTemplateDetailDAL();
                flag = dalSchedulingTemplateDetail.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_SCHEDULINGTEMPLATEDETAIL entDel = dalSchedulingTemplateDetail.GetSchedulingTemplateDetailRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                dalSchedulingTemplateDetail.Delete(entDel);

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

            return(strMsg);
        }