Exemplo n.º 1
0
 /// <summary>
 /// 添加办公用品信息
 /// </summary>
 /// <param name="OfficeThingsInfoM">办公用品信息</param>
 /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddOfficeThingsInfo(OfficeThingsInfoModel OfficeThingsInfoM)
 {
     try
     {
         #region 添加设备报废SQL拼写
         StringBuilder sql = new StringBuilder();
         sql.AppendLine("INSERT INTO officedba.OfficeThingsInfo");
         sql.AppendLine("		(CompanyCD      ");
         sql.AppendLine("		,ThingNo        ");
         sql.AppendLine("		,ThingName        ");
         sql.AppendLine("		,TypeID        ");
         sql.AppendLine("		,ThingType        ");
         sql.AppendLine("		,UnitID        ");
         sql.AppendLine("		,MinCount        ");
         sql.AppendLine("		,Creator        ");
         sql.AppendLine("		,CreateDate        ");
         sql.AppendLine("		,Remark        ");
         sql.AppendLine("		,ModifiedDate        ");
         sql.AppendLine("		,ModifiedUserID)        ");
         sql.AppendLine("VALUES                  ");
         sql.AppendLine("		(@CompanyCD      ");
         sql.AppendLine("		,@ThingNo        ");
         sql.AppendLine("		,@ThingName        ");
         sql.AppendLine("		,@TypeID        ");
         sql.AppendLine("		,@ThingType        ");
         sql.AppendLine("		,@UnitID        ");
         sql.AppendLine("		,@MinCount        ");
         sql.AppendLine("		,@Creator        ");
         sql.AppendLine("		,@CreateDate        ");
         sql.AppendLine("		,@Remark        ");
         sql.AppendLine("		,@ModifiedDate        ");
         sql.AppendLine("		,@ModifiedUserID)        ");
         #endregion
         #region 添加设备报废参数设置
         SqlParameter[] param;
         param     = new SqlParameter[12];
         param[0]  = SqlHelper.GetParameter("@CompanyCD", OfficeThingsInfoM.CompanyCD);
         param[1]  = SqlHelper.GetParameter("@ThingNo", OfficeThingsInfoM.ThingNo);
         param[2]  = SqlHelper.GetParameter("@ThingName", OfficeThingsInfoM.ThingName);
         param[3]  = SqlHelper.GetParameter("@TypeID", OfficeThingsInfoM.TypeID);
         param[4]  = SqlHelper.GetParameter("@ThingType", OfficeThingsInfoM.ThingType);
         param[5]  = SqlHelper.GetParameter("@UnitID", OfficeThingsInfoM.UnitID);
         param[6]  = SqlHelper.GetParameter("@MinCount", OfficeThingsInfoM.MinCount);
         param[7]  = SqlHelper.GetParameter("@Creator", OfficeThingsInfoM.Creator);
         param[8]  = SqlHelper.GetParameter("@CreateDate", OfficeThingsInfoM.CreateDate);
         param[9]  = SqlHelper.GetParameter("@Remark", OfficeThingsInfoM.Remark);
         param[10] = SqlHelper.GetParameter("@ModifiedDate", OfficeThingsInfoM.ModifiedDate);
         param[11] = SqlHelper.GetParameter("@ModifiedUserID", OfficeThingsInfoM.ModifiedUserID);
         #endregion
         SqlHelper.ExecuteTransSql(sql.ToString(), param);
         return(SqlHelper.Result.OprateCount > 0 ? true : false);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 修改用品档案信息
        /// </summary>
        /// <param name="OfficeThingsInfoM">用品档案信息</param>
        /// <returns>更新是否成功 false:失败,true:成功</returns>
        public static bool UpdateOfficeThingsInfo(OfficeThingsInfoModel OfficeThingsInfoM)
        {
            try
            {
                #region 添加设备报废SQL拼写
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.OfficeThingsInfo");
                sql.AppendLine("		SET ThingName=@ThingName        ");
                sql.AppendLine("		,TypeID=@TypeID        ");
                sql.AppendLine("		,ThingType=@ThingType        ");
                sql.AppendLine("		,UnitID=@UnitID        ");
                sql.AppendLine("		,MinCount=@MinCount        ");
                sql.AppendLine("		,Remark=@Remark        ");
                sql.AppendLine("		,ModifiedDate=@ModifiedDate        ");
                sql.AppendLine("		,ModifiedUserID=@ModifiedUserID        ");
                sql.AppendLine("WHERE CompanyCD=@CompanyCD AND ThingNo=@ThingNo         ");
                #endregion
                #region 添加设备报废参数设置
                SqlParameter[] param;
                param    = new SqlParameter[10];
                param[0] = SqlHelper.GetParameter("@ThingName", OfficeThingsInfoM.ThingName);
                param[1] = SqlHelper.GetParameter("@TypeID", OfficeThingsInfoM.TypeID);
                param[2] = SqlHelper.GetParameter("@ThingType", OfficeThingsInfoM.ThingType);
                param[3] = SqlHelper.GetParameter("@UnitID", OfficeThingsInfoM.UnitID);
                param[4] = SqlHelper.GetParameter("@MinCount", OfficeThingsInfoM.MinCount);
                param[5] = SqlHelper.GetParameter("@Remark", OfficeThingsInfoM.Remark);
                param[6] = SqlHelper.GetParameter("@ModifiedDate", OfficeThingsInfoM.ModifiedDate);
                param[7] = SqlHelper.GetParameter("@ModifiedUserID", OfficeThingsInfoM.ModifiedUserID);
                param[8] = SqlHelper.GetParameter("@CompanyCD", OfficeThingsInfoM.CompanyCD);
                param[9] = SqlHelper.GetParameter("@ThingNo", OfficeThingsInfoM.ThingNo);

                #endregion
                SqlHelper.ExecuteTransSql(sql.ToString(), param);
                return(SqlHelper.Result.OprateCount > 0 ? true : false);
            }
            catch
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 添加办公用品信息
 /// </summary>
 /// <param name="OfficeThingsInfoM">办公用品信息</param>
 /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool AddOfficeThingsInfo(OfficeThingsInfoModel OfficeThingsInfoM)
 {
     return(OfficeThingsInfoDBHelper.AddOfficeThingsInfo(OfficeThingsInfoM));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 修改用品档案信息
 /// </summary>
 /// <param name="OfficeThingsInfoM">用品档案信息</param>
 /// <returns>更新是否成功 false:失败,true:成功</returns>
 public static bool UpdateOfficeThingsInfo(OfficeThingsInfoModel OfficeThingsInfoM)
 {
     return(OfficeThingsInfoDBHelper.UpdateOfficeThingsInfo(OfficeThingsInfoM));
 }