Esempio n. 1
0
        /// <summary>
        /// 新增员工考勤年度结算信息
        /// </summary>
        /// <param name="entTemp"></param>
        /// <returns></returns>
        public string AddYearlyBalance(T_HR_ATTENDYEARLYBALANCE entTemp)
        {
            string strMsg = string.Empty;

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

                bool flag = false;

                AttendYearlyBalanceDAL dalAttendYearlyBalance = new AttendYearlyBalanceDAL();
                flag = dalAttendYearlyBalance.IsExistsRd(entTemp.EMPLOYEEID, entTemp.BALANCEYEAR.Value);

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

                dalAttendYearlyBalance.Add(entTemp);

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

            return(strMsg);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据主键索引,删除员工考勤年度结算信息(注:暂定为物理删除)
        /// </summary>
        /// <param name="strYearlyBalanceId">主键索引</param>
        /// <returns></returns>
        public string DeleteYearlyBalance(string strYearlyBalanceId)
        {
            string strMsg = string.Empty;

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

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

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

                objArgs.Add(strYearlyBalanceId);

                AttendYearlyBalanceDAL dalAttendYearlyBalance = new AttendYearlyBalanceDAL();
                flag = dalAttendYearlyBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_ATTENDYEARLYBALANCE entDel = dalAttendYearlyBalance.GetAttendYearlyBalanceRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                dalAttendYearlyBalance.Delete(entDel);

                strMsg = "{DELETESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.Message.ToString();
                if (ex.InnerException == null)
                {
                    Utility.SaveLog(ex.Message);
                }
                else
                {
                    Utility.SaveLog(ex.InnerException.Message);
                }
            }

            return(strMsg);
        }
Esempio n. 3
0
        /// <summary>
        /// 修改员工考勤年度结算信息
        /// </summary>
        /// <param name="entTemp"></param>
        /// <returns></returns>
        public string ModifyYearlyBalance(T_HR_ATTENDYEARLYBALANCE 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(" YEARLYBALANCEID == @0");

                objArgs.Add(entTemp.YEARLYBALANCEID);

                AttendYearlyBalanceDAL dalAttendYearlyBalance = new AttendYearlyBalanceDAL();
                flag = dalAttendYearlyBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_ATTENDYEARLYBALANCE entUpdate = dalAttendYearlyBalance.GetAttendYearlyBalanceRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                Utility.CloneEntity(entTemp, entUpdate);

                dalAttendYearlyBalance.Update(entUpdate);
                strMsg = "{SAVESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.ToString();
                Utility.SaveLog(strMsg);
            }

            return(strMsg);
        }