/// <summary>
 /// 插入员工日常考勤签到信息
 /// </summary>
 /// <param name="DailyAttendanceM">签到信息</param>
 /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddDailyAttendanceSignIn(DailyAttendanceModel DailyAttendanceM)
  {
      try
      {
          #region 日常考勤签到信息SQL拼写
          StringBuilder sql = new StringBuilder();
          sql.AppendLine("INSERT INTO officedba.DailyAttendance");
          sql.AppendLine("		(CompanyCD      ");
          sql.AppendLine("		,EmployeeID        ");
          sql.AppendLine("		,Date        ");
          sql.AppendLine("		,StartTime        ");
          sql.AppendLine("		,WorkShiftTimeID        ");
          sql.AppendLine("		,DelayTimeLong        ");
          sql.AppendLine("		,IsDelay        ");
          sql.AppendLine("		,EmployeeAttendanceSetID        ");
          sql.AppendLine("		,SignInRemark)        ");
          sql.AppendLine("VALUES                  ");
          sql.AppendLine("		(@CompanyCD   ");
          sql.AppendLine("		,@EmployeeID       ");
          sql.AppendLine("		,@Date       ");
          sql.AppendLine("		,@StartTime       ");
          sql.AppendLine("		,@WorkShiftTimeID       ");
          sql.AppendLine("		,@DelayTimeLong       ");
          sql.AppendLine("		,@IsDelay       ");
          sql.AppendLine("		,@EmployeeAttendanceSetID       ");
          sql.AppendLine("		,@Remark)       ");
          #endregion
          #region 日常考勤签到信息参数设置
          SqlParameter[] param;
          param = new SqlParameter[9];
          param[0] = SqlHelper.GetParameter("@CompanyCD", DailyAttendanceM.CompanyCD);
          param[1] = SqlHelper.GetParameter("@EmployeeID", DailyAttendanceM.EmployeeID);
          param[2] = SqlHelper.GetParameter("@Date", DailyAttendanceM.Date);
          param[3] = SqlHelper.GetParameter("@StartTime", DailyAttendanceM.StartTime);
          param[4] = SqlHelper.GetParameter("@WorkShiftTimeID", DailyAttendanceM.WorkShiftTimeID);
          param[5] = SqlHelper.GetParameter("@DelayTimeLong", DailyAttendanceM.DelayTimeLong);
          param[6] = SqlHelper.GetParameter("@IsDelay", DailyAttendanceM.IsDelay);
          param[7] = SqlHelper.GetParameter("@EmployeeAttendanceSetID", DailyAttendanceM.EmployeeAttendanceSetID);
          param[8] = SqlHelper.GetParameter("@Remark", DailyAttendanceM.SignInRemark);
          #endregion
          SqlHelper.ExecuteTransSql(sql.ToString(), param);
          return SqlHelper.Result.OprateCount > 0 ? true : false;
      }
      catch
      {
          return false;
      }
  }
       /// <summary>
       /// 更新用户补签到签退信息
       /// </summary>
       /// <param name="DailyAttendanceM">签退信息</param>
       /// <returns>更新是否成功 false:失败,true:成功</returns>
       public static bool UpdateExtraDailyAttendanceSignIn_Out(DailyAttendanceModel DailyAttendanceM)
       {
           try
           {

               #region 日常考勤签到信息SQL拼写
               StringBuilder sql = new StringBuilder();
               sql.AppendLine("UPDATE officedba.DailyAttendance");
               sql.AppendLine("		SET StartTime=@StartTime        ");
               sql.AppendLine("		,EndTime=@EndTime        ");
               sql.AppendLine("		,DelayTimeLong=@DelayTimeLong        ");
               sql.AppendLine("		,ForWardOffTimeLong=@ForWardOffTimeLong        ");
               sql.AppendLine("		,IsDelay=@IsDelay        ");
               sql.AppendLine("		,IsForwarOff=@IsForwarOff        ");
               sql.AppendLine("		,EmployeeAttendanceSetID=@EmployeeAttendanceSetID        ");
               sql.AppendLine("		,IsExtraSignIn='1'        ");
               sql.AppendLine("		,IsExtraSignOut='1'        ");
               sql.AppendLine("		,ProcessSignInReason=@ProcessSignInReason        ");
               sql.AppendLine("		,ProcessSignOutReason=@ProcessSignOutReason        ");
               sql.AppendLine("		,ProcessUserID=@ProcessUserID        ");
               sql.AppendLine("		,ProcessDateTime=@ProcessDateTime         ");
               sql.AppendLine("		WHERE CompanyCD=@CompanyCD      ");
               sql.AppendLine("		AND EmployeeID=@EmployeeID        ");
               sql.AppendLine("		AND Date=@Date        ");
               sql.AppendLine("		AND WorkShiftTimeID=@WorkShiftTimeID        ");
               #endregion
               #region 日常考勤签到信息参数设置
               SqlParameter[] param;
               param = new SqlParameter[15];
               param[0] = SqlHelper.GetParameter("@CompanyCD", DailyAttendanceM.CompanyCD);
               param[1] = SqlHelper.GetParameter("@EmployeeID", DailyAttendanceM.EmployeeID);
               param[2] = SqlHelper.GetParameter("@Date", DailyAttendanceM.Date);
               param[3] = SqlHelper.GetParameter("@StartTime", DailyAttendanceM.StartTime);
               param[4] = SqlHelper.GetParameter("@EndTime", DailyAttendanceM.EndTime);
               param[5] = SqlHelper.GetParameter("@WorkShiftTimeID", DailyAttendanceM.WorkShiftTimeID);
               param[6] = SqlHelper.GetParameter("@DelayTimeLong", DailyAttendanceM.DelayTimeLong);
               param[7] = SqlHelper.GetParameter("@ForWardOffTimeLong", DailyAttendanceM.ForWardOffTimeLong);
               param[8] = SqlHelper.GetParameter("@IsDelay", DailyAttendanceM.IsDelay);
               param[9] = SqlHelper.GetParameter("@IsForwarOff", DailyAttendanceM.IsForwarOff);
               param[10] = SqlHelper.GetParameter("@EmployeeAttendanceSetID", DailyAttendanceM.EmployeeAttendanceSetID);
               param[11] = SqlHelper.GetParameter("@ProcessSignInReason", DailyAttendanceM.ProcessSignInReason);
               param[12] = SqlHelper.GetParameter("@ProcessSignOutReason", DailyAttendanceM.ProcessSignInReason);
               param[13] = SqlHelper.GetParameter("@ProcessUserID", DailyAttendanceM.ProcessUserID);
               param[14] = SqlHelper.GetParameter("@ProcessDateTime", DailyAttendanceM.ProcessDateTime);
               #endregion
               SqlHelper.ExecuteTransSql(sql.ToString(), param);
               return SqlHelper.Result.OprateCount > 0 ? true : false;
           }
           catch
           {
               return false;
           }
       }
 /// <summary>
 /// 补签到前的判断
 /// </summary>
 /// <returns>DataTable</returns>
 public static DataTable GetDailyInfoBeforeExtraSign(DailyAttendanceModel DailyAttendanceM)
 {
     string sql = "select * from officedba.DailyAttendance "
     + "WHERE  CompanyCD='" + DailyAttendanceM.CompanyCD + "' AND EmployeeID=" + DailyAttendanceM.EmployeeID + " AND "
     + "Date='" + DailyAttendanceM.Date + "' AND WorkShiftTimeID=" + DailyAttendanceM.WorkShiftTimeID + "";
     return SqlHelper.ExecuteSql(sql);
 }
 /// <summary>
 /// 更新用户签退信息
 /// </summary>
 /// <param name="DailyAttendanceM">签退信息</param>
 /// <returns>更新是否成功 false:失败,true:成功</returns>
 public static bool UpdateailyAttendanceSignOut(DailyAttendanceModel DailyAttendanceM)
 {
     try
     {
         #region 日常考勤签退信息SQL拼写
         string sql = "update officedba.DailyAttendance SET EndTime='" + DailyAttendanceM.EndTime + "',"
                       +"SignOutRemark='" + DailyAttendanceM .SignOutRemark+ "',"
                       + "ForWardOffTimeLong='" + DailyAttendanceM.ForWardOffTimeLong + "',"
                       + "IsForwarOff='" + DailyAttendanceM.IsForwarOff + "', "
                       + "EmployeeAttendanceSetID='" + DailyAttendanceM.EmployeeAttendanceSetID + "' "
                       +" where id=" 
                       +"(select isnull(max(id),0) as IsExist from officedba.DailyAttendance "
                       + "where CompanyCD='" + DailyAttendanceM.CompanyCD + "' and EmployeeID=" + DailyAttendanceM .EmployeeID+ " "
                       +"and Date=convert(varchar(10),convert(datetime,getdate()),120)  "
                       +"and StartTime is not null and EndTime is null)";
         #endregion
         SqlHelper.ExecuteTransSql(sql.ToString());
         return SqlHelper.Result.OprateCount > 0 ? true : false;
     }
     catch
     {
         return false;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 更新用户签退信息
 /// </summary>
 /// <param name="DailyAttendanceM">签退信息</param>
 /// <returns>更新是否成功 false:失败,true:成功</returns>
 public static bool UpdateailyAttendanceSignOut(DailyAttendanceModel DailyAttendanceM)
 {
     return DailyAttendanceDBHelper.UpdateailyAttendanceSignOut(DailyAttendanceM);
 }
Exemplo n.º 6
0
  /// <summary>
  /// 插入员工日常考勤签到信息
  /// </summary>
  /// <param name="DailyAttendanceM">签到信息</param>
  /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddDailyAttendanceSignIn(DailyAttendanceModel DailyAttendanceM)
  {
      return DailyAttendanceDBHelper.AddDailyAttendanceSignIn(DailyAttendanceM);
  }