Пример #1
0
        /// <summary>
        /// 修改考勤月度批量结算信息
        /// </summary>
        /// <param name="entLTRd"></param>
        /// <returns></returns>
        public string ModifyMonthlyBatchBalance(T_HR_ATTENDMONTHLYBATCHBALANCE 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(" MONTHLYBATCHID == @0");

                objArgs.Add(entTemp.MONTHLYBATCHID);

                AttendMonthlyBatchBalanceDAL dalAttendMonthlyBatchBalance = new AttendMonthlyBatchBalanceDAL();
                flag = dalAttendMonthlyBatchBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_ATTENDMONTHLYBATCHBALANCE entUpdate = dalAttendMonthlyBatchBalance.GetAttendMonthlyBatchBalanceRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                Utility.CloneEntity(entTemp, entUpdate);

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

            return(strMsg);
        }
Пример #2
0
        /// <summary>
        /// 根据主键索引,删除考勤月度批量结算信息(注:暂定为物理删除)
        /// </summary>
        /// <param name="strVacationId">主键索引</param>
        /// <returns></returns>
        public string DeleteMonthlyBatchBalance(string strAttendMonthlyBatchBalanceId)
        {
            string strMsg = string.Empty;

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

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

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

                objArgs.Add(strAttendMonthlyBatchBalanceId);

                AttendMonthlyBatchBalanceDAL dalAttendMonthlyBatchBalance = new AttendMonthlyBatchBalanceDAL();
                flag = dalAttendMonthlyBatchBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                T_HR_ATTENDMONTHLYBATCHBALANCE entDel = dalAttendMonthlyBatchBalance.GetAttendMonthlyBatchBalanceRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                dalAttendMonthlyBatchBalance.Delete(entDel);
                DeleteMyRecord(entDel);
                strMsg = "{DELETESUCCESSED}";
            }
            catch (Exception ex)
            {
                strMsg = ex.Message.ToString();
                if (ex.InnerException == null)
                {
                    Utility.SaveLog(strMsg);
                }
                else
                {
                    Utility.SaveLog(ex.InnerException.Message);
                }
            }

            return(strMsg);
        }
Пример #3
0
        /// <summary>
        /// 新增考勤月度批量结算信息
        /// </summary>
        /// <param name="entLTRd"></param>
        /// <returns></returns>
        public string AddMonthlyBatchBalance(T_HR_ATTENDMONTHLYBATCHBALANCE 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(" MONTHLYBATCHID == @0");

                objArgs.Add(entTemp.MONTHLYBATCHID);

                AttendMonthlyBatchBalanceDAL dalAttendMonthlyBatchBalance = new AttendMonthlyBatchBalanceDAL();
                flag = dalAttendMonthlyBatchBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

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

                dal.AddToContext(entTemp);
                dal.SaveContextChanges();
                SaveMyRecord(entTemp);

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

            return(strMsg);
        }
Пример #4
0
        /// <summary>
        /// 月度结算批量审批
        /// </summary>
        /// <param name="entTemp"></param>
        /// <param name="entBalanceList"></param>
        /// <returns></returns>
        public string AuditMonthlyBatchBalance(T_HR_ATTENDMONTHLYBATCHBALANCE 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(" MONTHLYBATCHID == @0");
                objArgs.Add(entTemp.MONTHLYBATCHID);

                AttendMonthlyBatchBalanceDAL dalAttendMonthlyBatchBalance = new AttendMonthlyBatchBalanceDAL();
                flag = dalAttendMonthlyBatchBalance.IsExistsRd(strFilter.ToString(), objArgs.ToArray());

                if (!flag)
                {
                    AddMonthlyBatchBalance(entTemp);
                }

                T_HR_ATTENDMONTHLYBATCHBALANCE entAudit = dalAttendMonthlyBatchBalance.GetAttendMonthlyBatchBalanceRdByMultSearch(strFilter.ToString(), objArgs.ToArray());
                if (entAudit == null)
                {
                    return("{REQUIREDFIELDS}");
                }

                if (flag)
                {
                    Utility.CloneEntity(entTemp, entAudit);
                    Update(entAudit);
                }
                string strTempCheckState = Convert.ToInt32(Common.CheckStates.All).ToString();

                AttendMonthlyBalanceBLL bllBalance = new AttendMonthlyBalanceBLL();
                IQueryable <T_HR_ATTENDMONTHLYBALANCE> entBalanceList = bllBalance.GetAllAttendMonthlyBalanceRdListForAudit(entTemp.BALANCEOBJECTTYPE,
                                                                                                                            entTemp.BALANCEOBJECTID, entTemp.OWNERID, strTempCheckState, entTemp.BALANCEYEAR.Value, entTemp.BALANCEMONTH.Value, "BALANCEYEAR, BALANCEMONTH");
                int cout = 0;
                foreach (T_HR_ATTENDMONTHLYBALANCE item in entBalanceList)
                {
                    //item.T_HR_ATTENDMONTHLYBATCHBALANCEReference.EntityKey = new EntityKey("SMT_HRM_EFModelContext.T_HR_ATTENDMONTHLYBATCHBALANCE", "MONTHLYBATCHID", entAudit.MONTHLYBATCHID);
                    item.T_HR_ATTENDMONTHLYBATCHBALANCE = entAudit;
                    item.CHECKSTATE = entTemp.CHECKSTATE;
                    item.EDITSTATE  = entTemp.EDITSTATE;
                    bllBalance.ModifyMonthlyBalance(item);
                    cout++;
                }
                strMsg = "{SAVESUCCESSED}";
                //添加日志
                if (entAudit != null)
                {
                    string str = entAudit.MONTHLYBATCHID + entAudit.BALANCEOBJECTNAME + entAudit.BALANCEYEAR + "年" + entAudit.BALANCEMONTH + "月" + "的人数为" + cout;
                    Utility.SaveLog(str);
                }
            }
            catch (Exception ex)
            {
                strMsg = ex.ToString();
                Utility.SaveLog(strMsg);
            }

            return(strMsg);
        }