public string DeleteDeductDetailByMasterID(string strAttendanceDeductMasterId) { string strMsg = string.Empty; try { if (string.IsNullOrEmpty(strAttendanceDeductMasterId)) { return("{REQUIREDFIELDS}"); } bool flag = false; StringBuilder strFilter = new StringBuilder(); List <string> objArgs = new List <string>(); strFilter.Append(" T_HR_ATTENDANCEDEDUCTMASTER.DEDUCTMASTERID == @0"); objArgs.Add(strAttendanceDeductMasterId); AttendanceDeductDetailDAL dalDeductDetail = new AttendanceDeductDetailDAL(); flag = dalDeductDetail.IsExistsRd(strFilter.ToString(), objArgs.ToArray()); if (!flag) { return("{NOTFOUND}"); } string strOrderBy = " DEDUCTMASTERID "; var q = dalDeductDetail.GetAttendanceDeductDetailRdListByMultSearch(strOrderBy, strFilter.ToString(), objArgs.ToArray()); if (q == null) { return(strMsg); } if (q.Count() == 0) { return(strMsg); } foreach (T_HR_ATTENDANCEDEDUCTDETAIL item in q) { dalDeductDetail.Delete(item); } strMsg = "{DELETESUCCESSED}"; } catch (Exception ex) { strMsg = ex.Message.ToString(); } return(strMsg); }
/// <summary> /// 根据主键索引,删除考勤异常扣款明细信息(注:暂定为物理删除) /// </summary> /// <param name="strVacationId">主键索引</param> /// <returns></returns> public string DeleteDeductDetail(string strAttendanceDeductDetailId) { string strMsg = string.Empty; try { if (string.IsNullOrEmpty(strAttendanceDeductDetailId)) { return("{REQUIREDFIELDS}"); } bool flag = false; StringBuilder strFilter = new StringBuilder(); List <string> objArgs = new List <string>(); strFilter.Append(" DEDUCTDETAILID == @0"); objArgs.Add(strAttendanceDeductDetailId); AttendanceDeductDetailDAL dalAttendanceDeductDetail = new AttendanceDeductDetailDAL(); flag = dalAttendanceDeductDetail.IsExistsRd(strFilter.ToString(), objArgs.ToArray()); if (!flag) { return("{NOTFOUND}"); } T_HR_ATTENDANCEDEDUCTDETAIL entDel = dalAttendanceDeductDetail.GetAttendanceDeductDetailRdByMultSearch(strFilter.ToString(), objArgs.ToArray()); dalAttendanceDeductDetail.Delete(entDel); strMsg = "{DELETESUCCESSED}"; } catch (Exception ex) { strMsg = ex.Message.ToString(); } return(strMsg); }