/// <summary>
        /// 添加入库库存信息
        /// </summary>
        /// <param name="OfficeThingsBuyM">入库单主信息</param>
        /// <param name="OfficeThingsInStorageInfos">入库详细信息</param>
        /// <returns>添加是否成功 false:失败,true:成功</returns>
        public static bool ConfirmInstorageInfo(OfficeThingsBuyModel OfficeThingsBuyM, string OfficeThingsInStorageInfos)
        {
            try
            {
                #region 添加入库库存信息sql语句
                StringBuilder OfficeThingsBuySql = new StringBuilder();
                OfficeThingsBuySql.AppendLine("Update officedba.OfficeThingsBuy");
                OfficeThingsBuySql.AppendLine("SET BillStatus=@BillStatus");
                OfficeThingsBuySql.AppendLine(",Confirmor=@Confirmor     ");
                OfficeThingsBuySql.AppendLine(",ConfirmDate=@ConfirmDate     ");
                OfficeThingsBuySql.AppendLine(",ModifiedDate=@ModifiedDate");
                OfficeThingsBuySql.AppendLine(",ModifiedUserID=@ModifiedUserID");
                OfficeThingsBuySql.AppendLine("  WHERE  BuyRecordNo=@BuyRecordNo AND CompanyCD=@CompanyCD");
                #endregion

                #region 设置参数
                SqlParameter[] paramgas = new SqlParameter[7];
                paramgas[0] = SqlHelper.GetParameter("@BillStatus", OfficeThingsBuyM.BillStatus);
                paramgas[1] = SqlHelper.GetParameter("@Confirmor", OfficeThingsBuyM.Confirmor);
                paramgas[2] = SqlHelper.GetParameter("@ConfirmDate", OfficeThingsBuyM.ConfirmDate);
                paramgas[3] = SqlHelper.GetParameter("@ModifiedDate", OfficeThingsBuyM.ModifiedDate);
                paramgas[4] = SqlHelper.GetParameter("@ModifiedUserID", OfficeThingsBuyM.ModifiedUserID);
                paramgas[5] = SqlHelper.GetParameter("@BuyRecordNo", OfficeThingsBuyM.BuyRecordNo);
                paramgas[6] = SqlHelper.GetParameter("@CompanyCD", OfficeThingsBuyM.CompanyCD);
                #endregion
                return ConfirmAll(OfficeThingsBuySql.ToString(), OfficeThingsInStorageInfos, OfficeThingsBuyM.BuyRecordNo, OfficeThingsBuyM.CompanyCD, OfficeThingsBuyM.ModifiedUserID, paramgas);
            }
            catch 
            {
                return false;
            }
        }
        /// <summary>
        /// 修改入库库存信息
        /// </summary>
        /// <param name="OfficeThingsBuyM">入库单主信息</param>
        /// <param name="OfficeThingsInStorageInfos">入库详细信息</param>
        /// <returns>更新是否成功 false:失败,true:成功</returns>
        public static bool UpdateInstorageInfo(OfficeThingsBuyModel OfficeThingsBuyM, string OfficeThingsInStorageInfos)
        {
            try
            {
                #region 添加入库库存信息sql语句
                StringBuilder OfficeThingsBuySql = new StringBuilder();
                OfficeThingsBuySql.AppendLine("UPDATE officedba.OfficeThingsBuy");
                OfficeThingsBuySql.AppendLine("SET Title=@Title");
                OfficeThingsBuySql.AppendLine(",FromType=@FromType   ");
                
                OfficeThingsBuySql.AppendLine(",BuyerID=@BuyerID   ");
                OfficeThingsBuySql.AppendLine(",BuyDeptID=@BuyDeptID  ");
                OfficeThingsBuySql.AppendLine(",BuyDate=@BuyDate    ");
                OfficeThingsBuySql.AppendLine(",ToWarehouseDate=@ToWarehouseDate    ");
                OfficeThingsBuySql.AppendLine(",TotalCount=@TotalCount    ");
                OfficeThingsBuySql.AppendLine(",TotalPrice=@TotalPrice    ");
                OfficeThingsBuySql.AppendLine(",BillStatus=@BillStatus");
                //OfficeThingsBuySql.AppendLine(",Creator=@Creator");
                //OfficeThingsBuySql.AppendLine(",CreateDate=@CreateDate");
                OfficeThingsBuySql.AppendLine(",Remark=@Remark");
                OfficeThingsBuySql.AppendLine(",ModifiedDate=@ModifiedDate");
                OfficeThingsBuySql.AppendLine(",ModifiedUserID=@ModifiedUserID");
                OfficeThingsBuySql.AppendLine(" WHERE  CompanyCD=@CompanyCD AND BuyRecordNo=@BuyRecordNo");
                #endregion

                #region 设置参数
                SqlParameter[] paramgas = new SqlParameter[14];
                paramgas[0] = SqlHelper.GetParameter("@Title", OfficeThingsBuyM.Title);
                paramgas[1] = SqlHelper.GetParameter("@BuyerID", OfficeThingsBuyM.BuyerID);
                paramgas[2] = SqlHelper.GetParameter("@BuyDeptID", OfficeThingsBuyM.BuyDeptID);
                paramgas[3] = SqlHelper.GetParameter("@BuyDate", OfficeThingsBuyM.BuyDate);
                paramgas[4] = SqlHelper.GetParameter("@ToWarehouseDate", OfficeThingsBuyM.ToWarehouseDate);
                paramgas[5] = SqlHelper.GetParameter("@TotalCount", OfficeThingsBuyM.TotalCount);
                paramgas[6] = SqlHelper.GetParameter("@TotalPrice", OfficeThingsBuyM.TotalPrice);
                paramgas[7] = SqlHelper.GetParameter("@BillStatus", OfficeThingsBuyM.BillStatus);
                //paramgas[8] = SqlHelper.GetParameter("@Creator", OfficeThingsBuyM.Creator);
               // paramgas[9] = SqlHelper.GetParameter("@CreateDate", OfficeThingsBuyM.CreateDate);
                paramgas[8] = SqlHelper.GetParameter("@Remark", OfficeThingsBuyM.Remark);
                paramgas[9] = SqlHelper.GetParameter("@ModifiedDate", OfficeThingsBuyM.ModifiedDate);
                paramgas[10] = SqlHelper.GetParameter("@ModifiedUserID", OfficeThingsBuyM.ModifiedUserID);
                paramgas[11] = SqlHelper.GetParameter("@CompanyCD", OfficeThingsBuyM.CompanyCD);
                paramgas[12] = SqlHelper.GetParameter("@BuyRecordNo", OfficeThingsBuyM.BuyRecordNo);
                paramgas[13] = SqlHelper.GetParameter("@FromType", OfficeThingsBuyM.FromType);
                #endregion
                return UpdateAll(OfficeThingsBuySql.ToString(), OfficeThingsInStorageInfos, OfficeThingsBuyM.BuyRecordNo, OfficeThingsBuyM.CompanyCD, OfficeThingsBuyM.ModifiedUserID, paramgas);
            }
            catch 
            {
                return false;
            }
        }
        /// <summary>
        /// 添加入库库存信息
        /// </summary>
        /// <param name="OfficeThingsBuyM">入库单主信息</param>
        /// <param name="OfficeThingsInStorageInfos">入库详细信息</param>
        /// <returns>添加是否成功 false:失败,true:成功</returns>
        public static bool InserInstorageInfo(OfficeThingsBuyModel OfficeThingsBuyM, string OfficeThingsInStorageInfos)
        {
            try
            {
                #region 添加入库库存信息sql语句
                StringBuilder OfficeThingsBuySql = new StringBuilder();
                OfficeThingsBuySql.AppendLine("INSERT INTO officedba.OfficeThingsBuy");
                OfficeThingsBuySql.AppendLine("(CompanyCD");
                OfficeThingsBuySql.AppendLine(",BuyRecordNo     ");
                OfficeThingsBuySql.AppendLine(",FromType     ");
                
                OfficeThingsBuySql.AppendLine(",Title");
                OfficeThingsBuySql.AppendLine(",BuyerID   ");
                OfficeThingsBuySql.AppendLine(",BuyDeptID  ");
                OfficeThingsBuySql.AppendLine(",BuyDate    ");
                OfficeThingsBuySql.AppendLine(",ToWarehouseDate    ");
                OfficeThingsBuySql.AppendLine(",TotalCount    ");
                OfficeThingsBuySql.AppendLine(",TotalPrice    ");
                OfficeThingsBuySql.AppendLine(",BillStatus");
                OfficeThingsBuySql.AppendLine(",Creator");
                OfficeThingsBuySql.AppendLine(",CreateDate");
                OfficeThingsBuySql.AppendLine(",Remark");
                OfficeThingsBuySql.AppendLine(",ModifiedDate");
                OfficeThingsBuySql.AppendLine(",ModifiedUserID)");
                OfficeThingsBuySql.AppendLine(" values ");
                OfficeThingsBuySql.AppendLine("(@CompanyCD");
                OfficeThingsBuySql.AppendLine(",@BuyRecordNo     ");
                OfficeThingsBuySql.AppendLine(",@FromType     ");
                OfficeThingsBuySql.AppendLine(",@Title");
                OfficeThingsBuySql.AppendLine(",@BuyerID   ");
                OfficeThingsBuySql.AppendLine(",@BuyDeptID  ");
                OfficeThingsBuySql.AppendLine(",@BuyDate    ");
                OfficeThingsBuySql.AppendLine(",@ToWarehouseDate    ");
                OfficeThingsBuySql.AppendLine(",@TotalCount    ");
                OfficeThingsBuySql.AppendLine(",@TotalPrice    ");
                OfficeThingsBuySql.AppendLine(",@BillStatus");
                OfficeThingsBuySql.AppendLine(",@Creator");
                OfficeThingsBuySql.AppendLine(",@CreateDate");
                OfficeThingsBuySql.AppendLine(",@Remark");
                OfficeThingsBuySql.AppendLine(",@ModifiedDate");
                OfficeThingsBuySql.AppendLine(",@ModifiedUserID)");
                #endregion

                #region 设置参数
                SqlParameter[] paramgas = new SqlParameter[16];
                paramgas[0] = SqlHelper.GetParameter("@CompanyCD", OfficeThingsBuyM.CompanyCD);
                paramgas[1] = SqlHelper.GetParameter("@BuyRecordNo", OfficeThingsBuyM.BuyRecordNo);
                paramgas[2] = SqlHelper.GetParameter("@Title", OfficeThingsBuyM.Title);
                paramgas[3] = SqlHelper.GetParameter("@BuyerID", OfficeThingsBuyM.BuyerID);
                paramgas[4] = SqlHelper.GetParameter("@BuyDeptID", OfficeThingsBuyM.BuyDeptID);
                paramgas[5] = SqlHelper.GetParameter("@BuyDate", OfficeThingsBuyM.BuyDate);
                paramgas[6] = SqlHelper.GetParameter("@ToWarehouseDate", OfficeThingsBuyM.ToWarehouseDate);
                paramgas[7] = SqlHelper.GetParameter("@TotalCount", OfficeThingsBuyM.TotalCount);
                paramgas[8] = SqlHelper.GetParameter("@TotalPrice", OfficeThingsBuyM.TotalPrice);
                paramgas[9] = SqlHelper.GetParameter("@BillStatus", OfficeThingsBuyM.BillStatus);
                paramgas[10] = SqlHelper.GetParameter("@Creator", OfficeThingsBuyM.Creator);
                paramgas[11] = SqlHelper.GetParameter("@CreateDate", OfficeThingsBuyM.CreateDate);
                paramgas[12] = SqlHelper.GetParameter("@Remark", OfficeThingsBuyM.Remark);
                paramgas[13] = SqlHelper.GetParameter("@ModifiedDate", OfficeThingsBuyM.ModifiedDate);
                paramgas[14] = SqlHelper.GetParameter("@ModifiedUserID", OfficeThingsBuyM.ModifiedUserID);
                paramgas[15] = SqlHelper.GetParameter("@FromType", OfficeThingsBuyM.FromType);
           
                #endregion
                return InsertAll(OfficeThingsBuySql.ToString(), OfficeThingsInStorageInfos, OfficeThingsBuyM.BuyRecordNo, OfficeThingsBuyM.CompanyCD, OfficeThingsBuyM.ModifiedUserID, paramgas);
            }
            catch 
            {
                return false;
            }
        }
 /// <summary>
 /// 入库确认
 /// </summary>
 /// <param name="OfficeThingsBuyM">入库单主信息</param>
 /// <param name="OfficeThingsInStorageInfos">入库详细信息</param>
 /// <returns>添加是否成功 false:失败,true:成功</returns>
 public static bool ConfirmInstorageInfo(OfficeThingsBuyModel OfficeThingsBuyM, string OfficeThingsInStorageInfos)
 {
     return OfficeThingsStorageDBHelper.ConfirmInstorageInfo(OfficeThingsBuyM, OfficeThingsInStorageInfos);
 }