/// <summary> /// 根据排班模板主表主键索引,删除关联的排班模板明细记录 /// </summary> /// <param name="strTemplateMasterID">排班模板主表主键索引</param> /// <returns>返回处理后的消息</returns> public string DeleteByTemplateMasterID(string strTemplateMasterID) { string strMsg = string.Empty; try { if (string.IsNullOrEmpty(strTemplateMasterID)) { return("{REQUIREDFIELDS}"); } bool flag = false; StringBuilder strFilter = new StringBuilder(); List <string> objArgs = new List <string>(); strFilter.Append(" T_HR_SCHEDULINGTEMPLATEMASTER.TEMPLATEMASTERID == @0"); objArgs.Add(strTemplateMasterID); SchedulingTemplateDetailDAL dalSchedulingTemplateDetail = new SchedulingTemplateDetailDAL(); flag = dalSchedulingTemplateDetail.IsExistsRd(strFilter.ToString(), objArgs.ToArray()); if (!flag) { return("{NOTFOUND}"); } string strOrderBy = " TEMPLATEDETAILID "; var q = dalSchedulingTemplateDetail.GetSchedulingTemplateDetailRdListByMultSearch(strOrderBy, strFilter.ToString(), objArgs.ToArray()); if (q == null) { return(strMsg); } if (q.Count() == 0) { return(strMsg); } foreach (T_HR_SCHEDULINGTEMPLATEDETAIL item in q) { dalSchedulingTemplateDetail.Delete(item); } strMsg = "{DELETESUCCESSED}"; } catch (Exception ex) { strMsg = ex.Message.ToString(); } return(strMsg); }
/// <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); }