public override bool ReplaceWaresReceiptPromotion(IEnumerable <WaresReceiptPromotion> parData) { var Sql = @" update WARES_RECEIPT set price = ifnull( (select max( (0.000+wrp.sum)/wrp.QUANTITY) from WARES_RECEIPT_PROMOTION wrp where wrp.id_workplace=@IdWorkplace and wrp.code_period =@CodePeriod and wrp.code_receipt=@CodeReceipt and wrp.code_wares=WARES_RECEIPT.code_wares and Type_Discount=@TypeDiscount) ,price) , sum =quantity* ifnull( (select max( (0.000+wrp.sum)/wrp.QUANTITY) from WARES_RECEIPT_PROMOTION wrp where wrp.id_workplace=@IdWorkplace and wrp.code_period =@CodePeriod and wrp.code_receipt=@CodeReceipt and wrp.code_wares=WARES_RECEIPT.code_wares and Type_Discount=@TypeDiscount) ,price) ,Type_Price=9 ,par_price_1=999999 , PRIORITY=1 , PRICE_DEALER= ifnull((select max( (0.000+wrp.sum)/wrp.QUANTITY) from WARES_RECEIPT_PROMOTION wrp where wrp.id_workplace=@IdWorkplace and wrp.code_period =@CodePeriod and wrp.code_receipt=@CodeReceipt and wrp.code_wares=WARES_RECEIPT.code_wares and Type_Discount=@TypeDiscount) ,PRICE_DEALER) where WARES_RECEIPT.id_workplace=@IdWorkplace and WARES_RECEIPT.code_period =@CodePeriod and WARES_RECEIPT.code_receipt=@CodeReceipt and WARES_RECEIPT.code_wares=@CodeWares and @TypeDiscount=11; "; using (var DB = new SQLite(ReceiptFile)) { DB.BulkExecuteNonQuery <WaresReceiptPromotion>(SqlReplaceWaresReceiptPromotion, parData); DB.BulkExecuteNonQuery <WaresReceiptPromotion>(Sql, parData); } return(true); }
public override bool ReplaceSalesBan(IEnumerable <SalesBan> pSB) { using (var DB = new SQLite(MidFile)) { return(DB.BulkExecuteNonQuery <SalesBan>(SqlReplaceSalesBan, pSB) > 0); } }
public override bool ReplaceUser(IEnumerable <User> pUser) { using (var DB = new SQLite(MidFile)) { return(DB.BulkExecuteNonQuery <User>(SqlReplaceUser, pUser) > 0); } }
public override bool UpdateExciseStamp(IEnumerable <ReceiptWares> pRW) { using (var DB = new SQLite(ReceiptFile)) { return(DB.BulkExecuteNonQuery <ReceiptWares>(SqlUpdateExciseStamp, pRW) > 0); } }
public override bool InsertReceiptEvent(IEnumerable <ReceiptEvent> parRE) { using (var DB = new SQLite(ReceiptFile)) { return(DB.BulkExecuteNonQuery <ReceiptEvent>(SqlInsertReceiptEvent, parRE) > 0); } }
public override bool ReplacePromotionSale2Category(IEnumerable <PromotionSale2Category> parData) { using (var DB = new SQLite(MidFile)) { DB.BulkExecuteNonQuery <PromotionSale2Category>(SqlReplacePromotionSale2Category, parData); } return(true); }
public override bool ReplaceFastWares(IEnumerable <FastWares> parData) { using (var DB = new SQLite(MidFile)) { DB.BulkExecuteNonQuery <FastWares>(SqlReplaceFastWares, parData); } return(true); }
public override bool ReplaceClient(IEnumerable <Client> parData) { using (var DB = new SQLite(MidFile)) { DB.BulkExecuteNonQuery <Client>(SqlReplaceClient, parData); } return(true); }
public override bool ReplacePrice(IEnumerable <Price> parData) { using (var DB = new SQLite(MidFile)) { DB.BulkExecuteNonQuery <Price>(SqlReplacePrice, parData); } return(true); }
public override bool ReplaceUnitDimension(IEnumerable <UnitDimension> parData) { using (var DB = new SQLite(MidFile)) { DB.BulkExecuteNonQuery <UnitDimension>(SqlReplaceUnitDimension, parData); } return(true); }
public override bool ReplaceWorkPlace(IEnumerable <WorkPlace> parData) { using (var DB = new SQLite(ConfigFile)) { DB.BulkExecuteNonQuery <WorkPlace>(SqlReplaceWorkPlace, parData); } return(true); }
public override bool ReplacePayment(IEnumerable <Payment> parData) { using (var DB = new SQLite(ReceiptFile)) { if (parData != null && parData.Count() > 0) { if (parData.Count() == 1)//Костиль через проблеми з мультипоточністю BD { DB.ExecuteNonQuery <Payment>(SqlReplacePayment, parData.First()); } else { DB.BulkExecuteNonQuery <Payment>(SqlReplacePayment, parData); } } } return(true); }