Пример #1
0
  /// <summary>
  /// 添加节假日设置信息
  /// </summary>
 /// <param name="EquipUselessModel">添加节假日设置信息</param>
  /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddHolidaySetInfo(HolidayModel HolidayM)
  {
      try
      {
          #region 添加节假日设置信息SQL拼写
          StringBuilder sql = new StringBuilder();
          sql.AppendLine("INSERT INTO officedba.Holiday");
          sql.AppendLine("		(CompanyCD      ");
          sql.AppendLine("		,AttendanceDate        ");
          sql.AppendLine("		,StartDate        ");
          sql.AppendLine("		,EndDate        ");
          sql.AppendLine("		,Remark        ");
          sql.AppendLine("		,ModifiedDate        ");
          sql.AppendLine("		,ModifiedUserID)        ");
          sql.AppendLine("VALUES                  ");
          sql.AppendLine("		(@CompanyCD   ");
          sql.AppendLine("		,@AttendanceDate       ");
          sql.AppendLine("		,@StartDate       ");
          sql.AppendLine("		,@EndDate       ");
          sql.AppendLine("		,@Remark       ");
          sql.AppendLine("		,@ModifiedDate       ");
          sql.AppendLine("		,@ModifiedUserID)       ");
          #endregion
          #region 添加设备报废参数设置
          SqlParameter[] param;
          param = new SqlParameter[7];
          param[0] = SqlHelper.GetParameter("@CompanyCD", HolidayM.CompanyCD);
          param[1] = SqlHelper.GetParameter("@AttendanceDate", HolidayM.AttendanceDate);
          param[2] = SqlHelper.GetParameter("@StartDate", HolidayM.StartDate);
          param[3] = SqlHelper.GetParameter("@EndDate", HolidayM.EndDate);
          param[4] = SqlHelper.GetParameter("@Remark", HolidayM.Remark);
          param[5] = SqlHelper.GetParameter("@ModifiedDate", HolidayM.ModifiedDate);
          param[6] = SqlHelper.GetParameter("@ModifiedUserID", HolidayM.ModifiedUserID);
          #endregion
          SqlHelper.ExecuteTransSql(sql.ToString(), param);
          return SqlHelper.Result.OprateCount > 0 ? true : false;
      }
      catch
      {
          return false;
      }
  }
Пример #2
0
 /// <summary>
 /// 更新节假日设置信息
 /// </summary>
 /// <param name="HolidayM">节假日设置信息</param>
 /// <returns>更新是否成功 false:失败,true:成功</returns>
 public static bool UpdateHolidaySetInfo(HolidayModel HolidayM,string HolidayID)
 {
     return HolidayDBHelper.UpdateHolidaySetInfo(HolidayM,HolidayID);
 }
Пример #3
0
  /// <summary>
  /// 添加节假日设置信息
  /// </summary>
  /// <param name="HolidayM">节假日设置信息</param>
  /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddHolidaySetInfo(HolidayModel HolidayM)
  {
      return HolidayDBHelper.AddHolidaySetInfo(HolidayM);
  }
Пример #4
0
 /// <summary>
 /// 更新节假日设置信息
 /// </summary>
 /// <param name="EquipUselessModel">节假日设置信息</param>
 /// <returns>更新是否成功 false:失败,true:成功</returns>
 public static bool UpdateHolidaySetInfo(HolidayModel HolidayM, string HolidayID)
 {
     try
     {
         #region 添加节假日设置信息SQL拼写
         StringBuilder sql = new StringBuilder();
         sql.AppendLine("UPDATE officedba.Holiday SET ");
         sql.AppendLine("		CompanyCD=@CompanyCD      ");
         sql.AppendLine("		,AttendanceDate=@AttendanceDate        ");
         sql.AppendLine("		,StartDate=@StartDate        ");
         sql.AppendLine("		,EndDate=@EndDate        ");
         sql.AppendLine("		,Remark=@Remark        ");
         sql.AppendLine("		,ModifiedDate=@ModifiedDate        ");
         sql.AppendLine("		,ModifiedUserID=@ModifiedUserID        ");
         sql.AppendLine("		WHERE ID=@HolidayID       ");
         #endregion
         #region 添加设备报废参数设置
         SqlParameter[] param;
         param = new SqlParameter[8];
         param[0] = SqlHelper.GetParameter("@CompanyCD", HolidayM.CompanyCD);
         param[1] = SqlHelper.GetParameter("@AttendanceDate", HolidayM.AttendanceDate);
         param[2] = SqlHelper.GetParameter("@StartDate", HolidayM.StartDate);
         param[3] = SqlHelper.GetParameter("@EndDate", HolidayM.EndDate);
         param[4] = SqlHelper.GetParameter("@Remark", HolidayM.Remark);
         param[5] = SqlHelper.GetParameter("@ModifiedDate", HolidayM.ModifiedDate);
         param[6] = SqlHelper.GetParameter("@ModifiedUserID", HolidayM.ModifiedUserID);
         param[7] = SqlHelper.GetParameter("@HolidayID", HolidayID);
         #endregion
         SqlHelper.ExecuteTransSql(sql.ToString(), param);
         return SqlHelper.Result.OprateCount > 0 ? true : false;
     }
     catch 
     {
         return false;
     }
 }