public override void GetItemInfo() { PresentInfo presentById = Present.GetPresentById(this.m_PresentId); if (!presentById.IsNull) { base.ProductName = presentById.PresentName; base.Unit = presentById.Unit; base.Amount = 1; base.PriceMarket = presentById.PriceMarket; base.Price = this.m_PresentProjectInfo.Price; base.ServiceTerm = presentById.ServiceTerm; base.ServiceTermUnit = presentById.ServiceTermUnit; base.Remark = "超值换购"; base.BeginDate = DateTime.Today; base.PresentExp = 0; base.PresentMoney = 0M; base.PresentPoint = 0; base.TotalWeight = presentById.Weight; base.SubTotal = this.m_PresentProjectInfo.Price; base.SaleType = 2; base.Id = presentById.PresentId; base.isPresent = true; base.Weight = presentById.Weight; base.ProductCharacter = presentById.ProductCharacter; } else { base.IsNull = true; } }
public override unsafe void Present() { try { var swapChainCopy = swapChain; var currentBufferIndexCopy = currentBufferIndex; var presentInfo = new PresentInfo { StructureType = StructureType.PresentInfo, SwapchainCount = 1, Swapchains = new IntPtr(&swapChainCopy), ImageIndices = new IntPtr(¤tBufferIndexCopy), }; // Present GraphicsDevice.NativeCommandQueue.Present(ref presentInfo); // Get next image currentBufferIndex = GraphicsDevice.NativeDevice.AcquireNextImage(swapChain, ulong.MaxValue, GraphicsDevice.GetNextPresentSemaphore(), Fence.Null); // Flip render targets backbuffer.SetNativeHandles(swapchainImages[currentBufferIndex].NativeImage, swapchainImages[currentBufferIndex].NativeColorAttachmentView); } catch (SharpVulkanException e) when(e.Result == Result.ErrorOutOfDate) { // TODO VULKAN } }
public IList <PresentInfo> GetPresentList(int startRowIndexId, int maxNumberRows, int searchType, string keyword) { IList <PresentInfo> list = new List <PresentInfo>(); Database database = DatabaseFactory.CreateDatabase(); DbCommand storedProcCommand = database.GetStoredProcCommand("PR_Common_GetList"); database.AddInParameter(storedProcCommand, "@StartRows", DbType.Int32, startRowIndexId); database.AddInParameter(storedProcCommand, "@PageSize", DbType.Int32, maxNumberRows); database.AddInParameter(storedProcCommand, "@SortColumn", DbType.String, "PresentID"); database.AddInParameter(storedProcCommand, "@StrColumn", DbType.String, "*"); database.AddInParameter(storedProcCommand, "@Sorts", DbType.String, "DESC"); database.AddInParameter(storedProcCommand, "@TableName", DbType.String, "PE_Present"); database.AddOutParameter(storedProcCommand, "@Total", DbType.Int32, maxNumberRows); string str = ""; if ((searchType == 1) && !string.IsNullOrEmpty(keyword)) { str = "PresentName LIKE '%" + DBHelper.FilterBadChar(keyword) + "%'"; } database.AddInParameter(storedProcCommand, "@Filter", DbType.String, str); using (NullableDataReader reader = new NullableDataReader(database.ExecuteReader(storedProcCommand))) { while (reader.Read()) { PresentInfo item = PresentFromrdr(reader); list.Add(item); } } this.m_TotalOfPresents = (int)database.GetParameterValue(storedProcCommand, "@Total"); return(list); }
public void GetPresentPic(PresentInfo presentInfo) { presentInfo.PresentPic = this.FileUploadPresentPic.FilePath; string oldValue = base.BasePath + SiteConfig.SiteOption.UploadDir; string originalImagePath = presentInfo.PresentPic.Replace(oldValue, ""); if (this.ChkThumb.Checked) { if (!string.IsNullOrEmpty(presentInfo.PresentPic)) { try { string extension = Path.GetExtension(presentInfo.PresentPic); string str4 = presentInfo.PresentPic.Replace(extension, "_S" + extension); presentInfo.PresentThumb = Thumbs.GetThumbsPath(originalImagePath, str4.Replace(oldValue, "")); } catch (ArgumentException) { BaseUserControl.WriteErrMsg("<li>生成缩略图的路径中具有非法字符!</li>"); } } } else { presentInfo.PresentThumb = this.FileUploadPresentThumb.FilePath; } if (this.ChkPresentPicWatermark.Checked && !string.IsNullOrEmpty(presentInfo.PresentPic)) { WaterMark.AddWaterMark(originalImagePath); } if (((this.ChkPresentPicWatermark.Checked && this.ChkThumb.Checked) || this.ChkPresentThumbWatermark.Checked) && !string.IsNullOrEmpty(presentInfo.PresentThumb)) { WaterMark.AddWaterMark(presentInfo.PresentThumb.Replace(oldValue, "")); } }
public static string GetOutOfStockProduct(int orderId) { IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(orderId); StringBuilder sb = new StringBuilder(); foreach (OrderItemInfo info in infoListByOrderId) { if (string.IsNullOrEmpty(info.TableName)) { PresentInfo presentById = Present.GetPresentById(info.ProductId); if (presentById.Stocks < info.Amount) { StringHelper.AppendString(sb, presentById.PresentName); } } else { ProductInfo productById = Product.GetProductById(info.ProductId, info.TableName); if (string.IsNullOrEmpty(info.Property)) { if (productById.Stocks < info.Amount) { StringHelper.AppendString(sb, productById.ProductName); } continue; } ProductDataInfo info4 = ProductData.GetProductDataByPropertyValue(productById.ProductId, productById.TableName, info.Property); if (!info4.IsNull && (info4.Stocks < info.Amount)) { StringHelper.AppendString(sb, productById.ProductName + "(" + info.Property + ")"); } } } return(sb.ToString()); }
public static void AddStockItemBySendCard(int stockId, OrderItemInfo orderItemInfo) { string productNum = string.Empty; if (!string.IsNullOrEmpty(orderItemInfo.TableName)) { ProductInfo productById = Product.GetProductById(orderItemInfo.ProductId); productById.Stocks -= orderItemInfo.Amount; productById.OrderNum -= orderItemInfo.Amount; ProductCommon.Update(productById, productById.TableName); productNum = productById.ProductNum; } else { PresentInfo presentById = Present.GetPresentById(orderItemInfo.ProductId); presentById.Stocks -= orderItemInfo.Amount; presentById.OrderNum -= orderItemInfo.Amount; Present.UpdatePressent(presentById); productNum = presentById.PresentNum; } StockItemInfo info3 = new StockItemInfo(); info3.Amount = orderItemInfo.Amount; info3.Price = orderItemInfo.TruePrice; info3.ProductId = orderItemInfo.ProductId; info3.TableName = orderItemInfo.TableName; info3.ProductName = orderItemInfo.ProductName; info3.ProductNum = productNum; info3.Property = orderItemInfo.Property; info3.StockId = stockId; info3.Unit = orderItemInfo.Unit; StockItem.Add(info3, stockId); }
private unsafe void PresenterThread() { Swapchain swapChainCopy = swapChain; uint currentBufferIndexCopy = 0; PresentInfo presentInfo = new PresentInfo { StructureType = StructureType.PresentInfo, SwapchainCount = 1, Swapchains = new IntPtr(&swapChainCopy), ImageIndices = new IntPtr(¤tBufferIndexCopy), WaitSemaphoreCount = 0 }; while (runPresenter) { // wait until we have a frame to present presentWaiter.Wait(); currentBufferIndexCopy = presentingIndex; // are we still OK to present? if (runPresenter == false) { return; } using (GraphicsDevice.QueueLock.WriteLock()) { GraphicsDevice.NativeCommandQueue.Present(ref presentInfo); } presentWaiter.Reset(); } }
public bool AddPresent(PresentInfo info) { info.PresentId = GetMaxId() + 1; string strSql = "INSERT INTO PE_Present(PresentID, PresentName, PresentNum, Unit, PresentPic, PresentThumb, ServiceTermUnit, ServiceTerm, Price, Price_Market, Weight, Stocks, AlarmNum, ProductCharacter, DownloadUrl, Remark, PresentIntro, PresentExplain) VALUES (@PresentID, @PresentName, @PresentNum, @Unit, @PresentPic, @PresentThumb, @ServiceTermUnit, @ServiceTerm, @Price, @Price_Market, @Weight, @Stocks, @AlarmNum, @ProductCharacter, @DownloadUrl, @Remark, @PresentIntro, @PresentExplain)"; return(DBHelper.ExecuteSql(strSql, GetPresentParameters(info))); }
public static bool AddPresent(PresentInfo info) { if (dal.AddPresent(info)) { AddStockInfo(info); return(true); } return(false); }
private static void AddStocks(CardInfo info, int qty) { if (info.ProductId > 0) { StockInfo stockInfo = new StockInfo(); stockInfo.StockId = StockManage.GetMaxId() + 1; stockInfo.Inputer = PEContext.Current.Admin.AdminName; stockInfo.InputTime = DateTime.Now; stockInfo.Remark = (qty > 1) ? "批量生成点卡" : "生成点卡"; stockInfo.StockNum = StockItem.GetInStockNum(); stockInfo.StockType = StockType.InStock; if (StockManage.Add(stockInfo)) { decimal price = 0M; string productNum = string.Empty; string unit = string.Empty; string productName = string.Empty; if (!string.IsNullOrEmpty(info.TableName)) { Product.AddStocks(info.ProductId, qty); ProductInfo productById = Product.GetProductById(info.ProductId); price = productById.PriceInfo.Price; productNum = productById.ProductNum; unit = productById.Unit; productName = productById.ProductName; } else { Present.AddStocks(info.ProductId, qty); PresentInfo presentById = Present.GetPresentById(info.ProductId); price = presentById.Price; productNum = presentById.PresentNum; unit = presentById.Unit; productName = presentById.PresentName; } if (!string.IsNullOrEmpty(productName)) { StockItemInfo info5 = new StockItemInfo(); info5.Amount = qty; info5.ItemId = StockItem.GetMaxId() + 1; info5.ProductId = info.ProductId; info5.TableName = info.TableName; info5.Price = price; info5.ProductNum = productNum; info5.Unit = unit; info5.ProductName = productName; StockItem.Add(info5, stockInfo.StockId); } } } }
public IList <PresentInfo> GetPresentByCharacter(ProductCharacter productCharacter) { IList <PresentInfo> list = new List <PresentInfo>(); using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT * FROM PE_Present WHERE (ProductCharacter&@ProductCharacter) > 0", new Parameters("@ProductCharacter", DbType.Int32, (int)productCharacter))) { while (reader.Read()) { PresentInfo item = PresentFromrdr(reader); list.Add(item); } } return(list); }
// Limited support! // You can only reference methods or fields defined in the class (not in ancestors classes) // Fields and methods stubs are needed for compilation purposes only. // Reflexil will automaticaly map current type, fields or methods to original references. // Happy_BuYu.Lobby.BY_LbMainCommand private void HandleReceiveGiftRes(byte[] pMsg) { Debug.Log("HandleReceiveGiftRes"); GameUtil gutil = new GameUtil(); if (gutil.EnterGame) { BY_LbMainMediator.Instance.m_pLbChooseScenePanel.ClickStartBtn(); } ReceiveGiftResDef receiveGiftResDef = XConvert.ToObject <ReceiveGiftResDef>(pMsg); if (receiveGiftResDef.iResult == 0) { int num = 0; int objectSize = XConvert.GetObjectSize <ReceiveGiftResDef>(); int objectSize2 = XConvert.GetObjectSize <PresentInfo>(); int num2 = objectSize; num = num2; BY_LbPlayerNode bY_LbPlayerNode = GDUtil.myPlay as BY_LbPlayerNode; bY_LbPlayerNode.m_listPresentInfo.Clear(); Debug.Log("msg.iGiftNum" + receiveGiftResDef.iGiftNum); int num3 = PlayerPrefs.GetInt("RECEIVE_GIFT_RECORD_ID" + Happy_BuYu.GlobalVO.BY_GlobalData.m_iUserId); for (int i = 0; i < receiveGiftResDef.iGiftNum; i++) { num = num2; PresentInfo presentInfo = XConvert.ToObject <PresentInfo>(pMsg, ref num); bY_LbPlayerNode.m_listPresentInfo.Add(presentInfo); num2 += objectSize2; int iRecordID = presentInfo.iRecordID; if (iRecordID > num3) { num3 = iRecordID; } } PlayerPrefs.SetInt("RECEIVE_GIFT_RECORD_ID" + Happy_BuYu.GlobalVO.BY_GlobalData.m_iUserId, num3); PlayerPrefs.Save(); if (!Happy_BuYu.GlobalVO.BY_GlobalData.g_bReturnFromGame) { BY_LBGlobalParam.m_iUserInfoStep++; if (BY_LBGlobalParam.m_iUserInfoStep == BY_LBGlobalParam.USER_INFO_STEPS) { BY_LbMainMediator.Instance.CallAuthenRes(); } } this.ShowPresent(); } }
public static UserOrderCommonInfo GetDownloadInfo(string userName, int orderItemId) { UserOrderCommonInfo downloadInfo = dal.GetDownloadInfo(userName, orderItemId); if (string.IsNullOrEmpty(downloadInfo.TableName)) { PresentInfo presentById = Present.GetPresentById(downloadInfo.ProductId); downloadInfo.DownloadUrl = presentById.DownloadUrl; downloadInfo.Remark = presentById.Remark; return(downloadInfo); } ProductInfo productById = Product.GetProductById(downloadInfo.ProductId); downloadInfo.DownloadUrl = productById.DownloadUrl; downloadInfo.Remark = productById.Remark; return(downloadInfo); }
public bool UpdatePressent(PresentInfo info) { StringBuilder builder = new StringBuilder(0x80); builder.Append("UPDATE "); builder.Append("PE_Present"); builder.Append(" SET "); string[] strArray = "PresentID, PresentName, PresentNum, Unit, PresentPic, PresentThumb, ServiceTermUnit, ServiceTerm, Price, Price_Market, Weight, Stocks, AlarmNum, ProductCharacter, DownloadUrl, Remark, PresentIntro, PresentExplain".Split(new char[] { ',' }); string[] strArray2 = "@PresentID, @PresentName, @PresentNum, @Unit, @PresentPic, @PresentThumb, @ServiceTermUnit, @ServiceTerm, @Price, @Price_Market, @Weight, @Stocks, @AlarmNum, @ProductCharacter, @DownloadUrl, @Remark, @PresentIntro, @PresentExplain".Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { builder.Append(strArray[i]); builder.Append("="); builder.Append(strArray2[i]); builder.Append(","); } builder.Remove(builder.Length - 1, 1); builder.Append(" WHERE PresentID = @PresentID"); return(DBHelper.ExecuteSql(builder.ToString(), GetPresentParameters(info))); }
// Limited support! // You can only reference methods or fields defined in the class (not in ancestors classes) // Fields and methods stubs are needed for compilation purposes only. // Reflexil will automaticaly map current type, fields or methods to original references. // Happy_BuYu.Lobby.BY_LbMainCommand private void HandleReceiveGiftRes(byte[] pMsg, ref int offset) { CheckHaveNext checkHaveNext = XConvert.ToObject <CheckHaveNext>(pMsg, ref offset); BY_LbPlayerNode bY_LbPlayerNode = GDUtil.myPlay as BY_LbPlayerNode; bY_LbPlayerNode.m_listPresentInfo.Clear(); Debug.Log("msg.iGiftNum" + checkHaveNext.size); int num = PlayerPrefs.GetInt("RECEIVE_GIFT_RECORD_ID" + Happy_BuYu.GlobalVO.BY_GlobalData.m_iUserId); for (int i = 0; i < checkHaveNext.size; i++) { PresentInfo presentInfo = XConvert.ToObject <PresentInfo>(pMsg, ref offset); bY_LbPlayerNode.m_listPresentInfo.Add(presentInfo); int iRecordID = presentInfo.iRecordID; if (iRecordID > num) { num = iRecordID; } } PlayerPrefs.SetInt("RECEIVE_GIFT_RECORD_ID" + Happy_BuYu.GlobalVO.BY_GlobalData.m_iUserId, num); PlayerPrefs.Save(); this.ShowPresent(); var list = Happy_BuYu.GlobalVO.BY_AquariumExchangeProfiles.m_listAquariumExchangeInfos; foreach (var item in list) { BBBDebug.DebugAttri(item); } var list2 = BY_FishPetProfiles.m_listFishPetAttri; foreach (var item in list2) { BBBDebug.DebugAttri(item); } }
private static void AddStockInfo(PresentInfo presentInfo) { StockInfo stockInfo = new StockInfo(); stockInfo.StockId = StockManage.GetMaxId() + 1; stockInfo.StockNum = StockItem.GetInStockNum(); stockInfo.InputTime = DateTime.Now; stockInfo.StockType = StockType.InStock; stockInfo.Inputer = PEContext.Current.Admin.AdminName; stockInfo.Remark = "商品库存初始"; if (StockManage.Add(stockInfo)) { StockItemInfo info = new StockItemInfo(); info.Amount = presentInfo.Stocks; info.Price = presentInfo.Price; info.ProductId = presentInfo.PresentId; info.TableName = string.Empty; info.Property = string.Empty; info.ProductNum = presentInfo.PresentNum; info.Unit = presentInfo.Unit; info.ProductName = presentInfo.PresentName; StockItem.Add(info, stockInfo.StockId); } }
private static Parameters GetPresentParameters(PresentInfo PresentInfo) { Parameters parameters = new Parameters(); parameters.AddInParameter("@PresentID", DbType.Int32, PresentInfo.PresentId); parameters.AddInParameter("@PresentName", DbType.String, PresentInfo.PresentName); parameters.AddInParameter("@PresentPic", DbType.String, PresentInfo.PresentPic); parameters.AddInParameter("PresentThumb", DbType.String, PresentInfo.PresentThumb); parameters.AddInParameter("@Unit", DbType.String, PresentInfo.Unit); parameters.AddInParameter("@PresentNum", DbType.String, PresentInfo.PresentNum); parameters.AddInParameter("@ServiceTermUnit", DbType.Int32, PresentInfo.ServiceTermUnit); parameters.AddInParameter("@ServiceTerm", DbType.Int32, PresentInfo.ServiceTerm); parameters.AddInParameter("@Price", DbType.Currency, PresentInfo.Price); parameters.AddInParameter("@Price_Market", DbType.Currency, PresentInfo.PriceMarket); parameters.AddInParameter("@Weight", DbType.Double, PresentInfo.Weight); parameters.AddInParameter("@Stocks", DbType.Int32, PresentInfo.Stocks); parameters.AddInParameter("@AlarmNum", DbType.Int32, PresentInfo.AlarmNum); parameters.AddInParameter("@ProductCharacter", DbType.Int32, PresentInfo.ProductCharacter); parameters.AddInParameter("@DownloadUrl", DbType.String, PresentInfo.DownloadUrl); parameters.AddInParameter("@Remark", DbType.String, PresentInfo.Remark); parameters.AddInParameter("@PresentIntro", DbType.String, PresentInfo.PresentIntro); parameters.AddInParameter("@PresentExplain", DbType.String, PresentInfo.PresentExplain); return(parameters); }
private static PresentInfo PresentFromrdr(NullableDataReader rdr) { PresentInfo info = new PresentInfo(); info.PresentId = rdr.GetInt32("PresentID"); info.PresentName = rdr.GetString("PresentName"); info.PresentPic = rdr.GetString("PresentPic"); info.PresentThumb = rdr.GetString("PresentThumb"); info.Unit = rdr.GetString("Unit"); info.PresentNum = rdr.GetString("PresentNum"); info.ServiceTermUnit = (ServiceTermUnit)rdr.GetInt32("ServiceTermUnit"); info.ServiceTerm = rdr.GetInt32("ServiceTerm"); info.Price = rdr.GetDecimal("Price"); info.PriceMarket = rdr.GetDecimal("Price_Market"); info.Weight = rdr.GetDouble("Weight"); info.ProductCharacter = (ProductCharacter)rdr.GetInt32("ProductCharacter"); info.Stocks = rdr.GetInt32("Stocks"); info.DownloadUrl = rdr.GetString("DownloadUrl"); info.Remark = rdr.GetString("Remark"); info.AlarmNum = rdr.GetInt32("AlarmNum"); info.PresentIntro = rdr.GetString("PresentIntro"); info.PresentExplain = rdr.GetString("PresentExplain"); return(info); }
public unsafe void Present(ref PresentInfo presentInfo) { fixed (PresentInfo* __presentInfo__ = &presentInfo) { vkQueuePresentKHR(this, __presentInfo__).CheckError(); } }
internal static unsafe extern Result vkQueuePresentKHR(Queue queue, PresentInfo* presentInfo);
private static decimal GetMargin(OrderInfo orderInfo, UserInfo userInfo) { IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(orderInfo.OrderId); decimal num = 0M; decimal totalMoney = 0M; double goodsWeight = 0.0; decimal num4 = 0M; UserPurviewInfo userPurview = userInfo.UserPurview; bool haveWholesalePurview = false; if (userPurview != null) { haveWholesalePurview = userPurview.Enablepm; } foreach (OrderItemInfo info2 in infoListByOrderId) { if (string.IsNullOrEmpty(info2.TableName)) { PresentInfo presentById = Present.GetPresentById(info2.ProductId); goodsWeight += presentById.Weight * info2.Amount; totalMoney += info2.SubTotal; } else { ProductInfo productById = Product.GetProductById(info2.ProductId, info2.TableName); if (!productById.IsNull) { AbstractItemInfo info5 = new ConcreteProductInfo(info2.Amount, info2.Property, productById, userInfo, orderInfo.NeedInvoice, true, haveWholesalePurview); info5.GetItemInfo(); totalMoney += info5.SubTotal; goodsWeight += info5.TotalWeight; } } } PackageInfo packageByGoodsWeight = Package.GetPackageByGoodsWeight(goodsWeight); if (!packageByGoodsWeight.IsNull) { goodsWeight += packageByGoodsWeight.PackageWeight; } num4 = DeliverCharge.GetDeliverCharge(orderInfo.DeliverType, goodsWeight, orderInfo.ZipCode, totalMoney, orderInfo.NeedInvoice); int couponId = orderInfo.CouponId; if (couponId > 0) { CouponInfo couponInfoById = Coupon.GetCouponInfoById(couponId); if (!couponInfoById.IsNull) { totalMoney -= couponInfoById.Money; if (totalMoney < 0M) { totalMoney = 0M; } } } totalMoney += num4; num = orderInfo.MoneyTotal - totalMoney; if (num < 0M) { num = 0M; } return(num); }
protected unsafe virtual void Draw() { var semaphoreCreateInfo = new SemaphoreCreateInfo { StructureType = StructureType.SemaphoreCreateInfo }; var presentCompleteSemaphore = device.CreateSemaphore(ref semaphoreCreateInfo); try { // Get the index of the next available swapchain image currentBackBufferIndex = device.AcquireNextImage(this.swapchain, ulong.MaxValue, presentCompleteSemaphore, Fence.Null); } catch (SharpVulkanException e) when (e.Result == Result.ErrorOutOfDate) { // TODO: Handle resize and retry draw throw new NotImplementedException(); } // Record drawing command buffer var beginInfo = new CommandBufferBeginInfo { StructureType = StructureType.CommandBufferBeginInfo }; commandBuffer.Begin(ref beginInfo); DrawInternal(); commandBuffer.End(); // Submit var drawCommandBuffer = commandBuffer; var pipelineStageFlags = PipelineStageFlags.BottomOfPipe; var submitInfo = new SubmitInfo { StructureType = StructureType.SubmitInfo, WaitSemaphoreCount = 1, WaitSemaphores = new IntPtr(&presentCompleteSemaphore), WaitDstStageMask = new IntPtr(&pipelineStageFlags), CommandBufferCount = 1, CommandBuffers = new IntPtr(&drawCommandBuffer), }; queue.Submit(1, &submitInfo, Fence.Null); // Present var swapchain = this.swapchain; var currentBackBufferIndexCopy = currentBackBufferIndex; var presentInfo = new PresentInfo { StructureType = StructureType.PresentInfo, SwapchainCount = 1, Swapchains = new IntPtr(&swapchain), ImageIndices = new IntPtr(¤tBackBufferIndexCopy) }; queue.Present(ref presentInfo); // Wait queue.WaitIdle(); device.ResetDescriptorPool(descriptorPool, DescriptorPoolResetFlags.None); // Cleanup device.DestroySemaphore(presentCompleteSemaphore); }
public override void GetItemInfo() { int presentNumber; switch (this.m_ProductInfo.SalePromotionType) { case 1: case 3: if ((this.m_ShoppingCartPresentInfoList != null) && !AbstractItemInfo.FoundInCart(this.m_ShoppingCartPresentInfoList, this.m_ProductInfo.ProductId)) { base.IsNull = true; return; } base.ProductName = this.m_ProductInfo.ProductName; base.Unit = this.m_ProductInfo.Unit; if ((this.m_ProductInfo.SalePromotionType == 1) && (this.m_ProductInfo.MinNumber != 0)) { presentNumber = DataConverter.CLng(this.m_Quantity / this.m_ProductInfo.MinNumber) * this.m_ProductInfo.PresentNumber; } else { presentNumber = this.m_ProductInfo.PresentNumber; } base.Amount = presentNumber; base.PriceMarket = this.m_ProductInfo.PriceMarket; base.Price = 0M; base.ServiceTerm = this.m_ProductInfo.ServiceTerm; base.ServiceTermUnit = this.m_ProductInfo.ServiceTermUnit; base.Remark = GetSalePromotionTypeRemark(this.m_ProductInfo); base.SaleType = 3; base.BeginDate = DateTime.Today; base.PresentExp = 0; base.PresentMoney = 0M; base.PresentPoint = 0; base.ProductKind = this.m_ProductInfo.ProductKind; base.TotalWeight = this.m_ProductInfo.Weight * base.Amount; base.SubTotal = 0M; base.Id = this.m_ProductInfo.ProductId; base.isPresent = true; base.Weight = this.m_ProductInfo.Weight; base.ProductCharacter = this.m_ProductInfo.ProductCharacter; base.TableName = this.m_ProductInfo.TableName; return; case 2: case 4: { PresentInfo presentById = Present.GetPresentById(DataConverter.CLng(this.m_ProductInfo.PresentId)); if (presentById.IsNull) { base.IsNull = true; return; } if ((this.m_ShoppingCartPresentInfoList != null) && !AbstractItemInfo.FoundInCart(this.m_ShoppingCartPresentInfoList, presentById.PresentId)) { base.IsNull = true; return; } base.ProductName = presentById.PresentName; base.Unit = presentById.Unit; if ((this.m_ProductInfo.SalePromotionType == 2) && (this.m_ProductInfo.MinNumber != 0)) { presentNumber = DataConverter.CLng(this.m_Quantity / this.m_ProductInfo.MinNumber) * this.m_ProductInfo.PresentNumber; } else { presentNumber = this.m_ProductInfo.PresentNumber; } base.Amount = presentNumber; base.PriceMarket = presentById.PriceMarket; base.Price = presentById.Price; if (presentById.Price > 0M) { base.SaleType = 2; } else { base.SaleType = 3; } base.ServiceTerm = presentById.ServiceTerm; base.ServiceTermUnit = presentById.ServiceTermUnit; base.Remark = GetSalePromotionTypeRemark(this.m_ProductInfo); base.BeginDate = DateTime.Today; base.PresentExp = 0; base.PresentMoney = 0M; base.PresentPoint = 0; base.TotalWeight = this.m_ProductInfo.Weight * base.Amount; base.SubTotal = presentById.Price * presentNumber; base.Id = presentById.PresentId; base.isPresent = true; base.Weight = presentById.Weight; base.ProductCharacter = presentById.ProductCharacter; return; } } }
protected virtual unsafe void Draw() { var semaphoreCreateInfo = new SemaphoreCreateInfo { StructureType = StructureType.SemaphoreCreateInfo }; var presentCompleteSemaphore = device.CreateSemaphore(ref semaphoreCreateInfo); try { // Get the index of the next available swapchain image currentBackBufferIndex = device.AcquireNextImage(this.swapchain, ulong.MaxValue, presentCompleteSemaphore, Fence.Null); } catch (SharpVulkanException e) when(e.Result == Result.ErrorOutOfDate) { // TODO: Handle resize and retry draw throw new NotImplementedException(); } // Record drawing command buffer var beginInfo = new CommandBufferBeginInfo { StructureType = StructureType.CommandBufferBeginInfo }; commandBuffer.Begin(ref beginInfo); DrawInternal(); commandBuffer.End(); // Submit var drawCommandBuffer = commandBuffer; var pipelineStageFlags = PipelineStageFlags.BottomOfPipe; var submitInfo = new SubmitInfo { StructureType = StructureType.SubmitInfo, WaitSemaphoreCount = 1, WaitSemaphores = new IntPtr(&presentCompleteSemaphore), WaitDstStageMask = new IntPtr(&pipelineStageFlags), CommandBufferCount = 1, CommandBuffers = new IntPtr(&drawCommandBuffer), }; queue.Submit(1, &submitInfo, Fence.Null); // Present var swapchain = this.swapchain; var currentBackBufferIndexCopy = currentBackBufferIndex; var presentInfo = new PresentInfo { StructureType = StructureType.PresentInfo, SwapchainCount = 1, Swapchains = new IntPtr(&swapchain), ImageIndices = new IntPtr(¤tBackBufferIndexCopy) }; queue.Present(ref presentInfo); // Wait queue.WaitIdle(); device.ResetDescriptorPool(descriptorPool, DescriptorPoolResetFlags.None); // Cleanup device.DestroySemaphore(presentCompleteSemaphore); }
public void SetPresentPic(PresentInfo present) { this.FileUploadPresentThumb.FilePath = present.PresentThumb; this.FileUploadPresentPic.FilePath = present.PresentPic; }
public static bool UpdatePressent(PresentInfo info) { return(dal.UpdatePressent(info)); }
protected void RptPresentList_ItemDataBound(object sender, RepeaterItemEventArgs e) { ShopConfig shopConfig = SiteConfig.ShopConfig; bool isPaymentShowProducdtThumb = true; int paymentThumbsWidth = 0; int paymentThumbsHeight = 0; bool isShowPaymentProductType = true; bool isShowPaymentSaleType = true; bool isShowPaymentMarkPrice = true; if (this.IsPreview == 0) { isPaymentShowProducdtThumb = shopConfig.IsPaymentShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPaymentProductType; isShowPaymentSaleType = shopConfig.IsShowPaymentSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPaymentMarkPrice; paymentThumbsWidth = shopConfig.PaymentThumbsWidth; paymentThumbsHeight = shopConfig.PaymentThumbsHeight; } else if (this.IsPreview == 1) { isPaymentShowProducdtThumb = shopConfig.IsPreviewShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPreviewProductType; isShowPaymentSaleType = shopConfig.IsShowPreviewSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPreviewMarkPrice; paymentThumbsWidth = shopConfig.PreviewThumbsWidth; paymentThumbsHeight = shopConfig.PreviewThumbsHeight; } if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item)) { PresentInfo dataItem = (PresentInfo)e.Item.DataItem; ((Literal)e.Item.FindControl("LitChangePresentPriceMarket")).Text = dataItem.PriceMarket.ToString("0.00"); ((Literal)e.Item.FindControl("LitChangePresentTruePrice")).Text = this.LblPrice.Text; ((Literal)e.Item.FindControl("LitChangePresentSubTotal")).Text = this.LblPrice.Text; Control control = e.Item.FindControl("changePresentImage"); Control control2 = e.Item.FindControl("changePresentType"); Control control3 = e.Item.FindControl("changeSaleType"); Control control4 = e.Item.FindControl("changeMarkPrice"); if (!isPaymentShowProducdtThumb) { control.Visible = false; } else { ExtendedImage image = (ExtendedImage)e.Item.FindControl("changePresentListImage"); if (!string.IsNullOrEmpty(dataItem.PresentThumb)) { image.Src = dataItem.PresentThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image.Width = paymentThumbsWidth; image.Height = paymentThumbsHeight; } if (!isShowPaymentProductType) { control2.Visible = false; } if (!isShowPaymentSaleType) { control3.Visible = false; } if (!isShowPaymentMarkPrice) { control4.Visible = false; } } if (e.Item.ItemType == ListItemType.Header) { Control control5 = e.Item.FindControl("changePresentHeaderImage"); Control control6 = e.Item.FindControl("changePresentHeaderProductType"); Control control7 = e.Item.FindControl("changePresentHeaderSaleType"); Control control8 = e.Item.FindControl("changePresentHeaderMarkPrice"); if (!isPaymentShowProducdtThumb) { control5.Visible = false; } if (!isShowPaymentProductType) { control6.Visible = false; } if (!isShowPaymentSaleType) { control7.Visible = false; } if (!isShowPaymentMarkPrice) { control8.Visible = false; } } }
protected void RptShoppingCart_ItemDataBound(object sender, RepeaterItemEventArgs e) { ShopConfig shopConfig = SiteConfig.ShopConfig; bool isPaymentShowProducdtThumb = true; int paymentThumbsWidth = 0; int paymentThumbsHeight = 0; bool isShowPaymentProductType = true; bool isShowPaymentSaleType = true; bool isShowPaymentMarkPrice = true; if (this.IsPreview == 0) { isPaymentShowProducdtThumb = shopConfig.IsPaymentShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPaymentProductType; isShowPaymentSaleType = shopConfig.IsShowPaymentSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPaymentMarkPrice; paymentThumbsWidth = shopConfig.PaymentThumbsWidth; paymentThumbsHeight = shopConfig.PaymentThumbsHeight; } else if (this.IsPreview == 1) { isPaymentShowProducdtThumb = shopConfig.IsPreviewShowProducdtThumb; isShowPaymentProductType = shopConfig.IsShowPreviewProductType; isShowPaymentSaleType = shopConfig.IsShowPreviewSaleType; isShowPaymentMarkPrice = shopConfig.IsShowPreviewMarkPrice; paymentThumbsWidth = shopConfig.PreviewThumbsWidth; paymentThumbsHeight = shopConfig.PreviewThumbsHeight; } if ((e.Item.ItemType != ListItemType.Item) && (e.Item.ItemType != ListItemType.AlternatingItem)) { if (e.Item.ItemType == ListItemType.Footer) { PresentProjectInfo presentProInfo = new PresentProjectInfo(true); if (this.m_IsPreview != 3) { presentProInfo = PresentProject.GetPresentProjectByTotalMoney(this.total); this.presentExpInfomation = this.ShowPresentExp(presentProInfo).ToString(); } if (this.m_IsPreview == 1) { int presentId = DataConverter.CLng(this.PresentId); PlaceHolder holder = (PlaceHolder)e.Item.FindControl("PlhPresentInfo"); holder.Visible = false; if (((presentId > 0) && !presentProInfo.IsNull) && (presentProInfo.PresentContent.Contains("1") && (presentId > 0))) { holder.Visible = true; AbstractItemInfo info7 = new ConcretePresentProject(presentId, presentProInfo); info7.GetItemInfo(); Label label2 = (Label)e.Item.FindControl("LblProductName"); Label label3 = (Label)e.Item.FindControl("LblUnit"); Label label4 = (Label)e.Item.FindControl("LblPresentPriceMarket"); Label label5 = (Label)e.Item.FindControl("LblPresentPrice"); Label label6 = (Label)e.Item.FindControl("LblPresentPrice1"); label2.Text = info7.ProductName; label3.Text = info7.Unit; label4.Text = info7.PriceMarket.ToString("0.00"); label5.Text = info7.Price.ToString("0.00"); label6.Text = info7.Price.ToString("0.00"); this.weight += info7.TotalWeight; this.total += info7.Price; } ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = true; Label label7 = (Label)e.Item.FindControl("LblDeliverCharge"); Label label8 = (Label)e.Item.FindControl("LblTaxRate"); Label label9 = (Label)e.Item.FindControl("LblIncludeTax"); Label label10 = (Label)e.Item.FindControl("LblCoupon"); Label label11 = (Label)e.Item.FindControl("LblTotalMoney"); Label label12 = (Label)e.Item.FindControl("LblTrueTotalMoney"); PackageInfo packageByGoodsWeight = Package.GetPackageByGoodsWeight(this.weight); if (!packageByGoodsWeight.IsNull) { this.weight += packageByGoodsWeight.PackageWeight; } decimal num7 = DeliverCharge.GetDeliverCharge(this.m_DeliverType, this.weight, this.m_ZipCode, this.total, this.m_NeedInvoice); DeliverTypeInfo deliverTypeById = EasyOne.Shop.DeliverType.GetDeliverTypeById(this.m_DeliverType); label7.Text = num7.ToString("0.00"); label8.Text = deliverTypeById.TaxRate.ToString(); if ((deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceFavourable) || (deliverTypeById.IncludeTax == TaxRateType.IncludeTaxNoInvoiceNoFavourable)) { label9.Text = "是"; } else { label9.Text = "否"; } decimal num8 = this.total + num7; if (this.m_CouponMoney > 0M) { label10.Visible = true; decimal num9 = this.total - this.m_CouponMoney; if (num9 < 0M) { num9 = 0M; } num8 = num9 + num7; label10.Text = "使用优惠券,面值为:" + this.m_CouponMoney.ToString("0.00") + "元,商品实际价格为:" + num9.ToString("0.00") + "元 <br>"; label11.Text = num9.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元"; label12.Text = num8.ToString("0.00"); } else { label10.Visible = false; label11.Text = this.total.ToString("0.00") + "+" + num7.ToString("0.00") + "=" + num8.ToString("0.00") + "元"; label12.Text = num8.ToString("0.00"); } this.ViewState["TrueTotalMoney"] = num8; } else { ((PlaceHolder)e.Item.FindControl("PlhMoneyInfo")).Visible = false; } ExtendedImage image3 = (ExtendedImage)e.Item.FindControl("presentImage"); Control control9 = e.Item.FindControl("footerPresentImage"); Control control10 = e.Item.FindControl("footerTdThemeImage"); Control control11 = e.Item.FindControl("footerTdProductType"); Control control12 = e.Item.FindControl("footerTdSaleType"); Control control13 = e.Item.FindControl("footerTdMarkPrice"); Control control14 = e.Item.FindControl("footerTdThemeImage"); Control control15 = e.Item.FindControl("footerTdMoneyInfoSaleType"); Control control16 = e.Item.FindControl("footerTdMoneyInfoMarkPrice"); Control control17 = e.Item.FindControl("footerPresentType"); Control control18 = e.Item.FindControl("footerPresentSaleType"); Control control19 = e.Item.FindControl("footerPresentMarkPrice"); if (!isPaymentShowProducdtThumb) { control10.Visible = false; control9.Visible = false; } else { PresentInfo presentById = Present.GetPresentById(DataConverter.CLng(this.PresentId)); if (!string.IsNullOrEmpty(presentById.PresentThumb)) { image3.Src = presentById.PresentThumb; } else { image3.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image3.Width = paymentThumbsWidth; image3.Height = paymentThumbsHeight; } if (!isShowPaymentProductType) { control11.Visible = false; control14.Visible = false; control17.Visible = false; } if (!isShowPaymentSaleType) { control12.Visible = false; control15.Visible = false; control18.Visible = false; } if (!isShowPaymentMarkPrice) { control13.Visible = false; control16.Visible = false; control19.Visible = false; return; } } else if (e.Item.ItemType == ListItemType.Header) { Control control20 = e.Item.FindControl("ProductImageTitle"); Control control21 = e.Item.FindControl("tdProductTypeTitle"); Control control22 = e.Item.FindControl("tdSaleTypeTitle"); Control control23 = e.Item.FindControl("tdMarkPriceTitle"); if (!isPaymentShowProducdtThumb) { control20.Visible = false; } if (!isShowPaymentProductType) { control21.Visible = false; } if (!isShowPaymentSaleType) { control22.Visible = false; } if (!isShowPaymentMarkPrice) { control23.Visible = false; } } return; } int productNum = 0; string str = ""; string str2 = ""; decimal subTotal = 0M; ShoppingCartInfo dataItem = (ShoppingCartInfo)e.Item.DataItem; if (dataItem == null) { return; } productNum = dataItem.Quantity; bool haveWholesalePurview = Convert.ToBoolean(this.ViewState["HaveWholesalePurview"]); str2 = ShoppingCart.GetSaleType(dataItem.ProductInfomation, productNum, haveWholesalePurview); str = ShoppingCart.GetProductType(dataItem.ProductInfomation, productNum, haveWholesalePurview); AbstractItemInfo info2 = new ConcreteProductInfo(productNum, dataItem.Property, dataItem.ProductInfomation, this.m_UserInfo, false, false, haveWholesalePurview); info2.GetItemInfo(); subTotal = info2.SubTotal; this.total += subTotal; this.totalExp += dataItem.ProductInfomation.PresentExp * productNum; this.totalMoney += dataItem.ProductInfomation.PresentMoney * productNum; this.totalPoint += dataItem.ProductInfomation.PresentPoint * productNum; this.weight += info2.TotalWeight; if (!string.IsNullOrEmpty(dataItem.Property)) { ((Literal)e.Item.FindControl("LitProperty")).Text = "(" + info2.Property + ")"; } InsideStaticLabel label = new InsideStaticLabel(); string str3 = "<a href='"; str3 = (str3 + label.GetInfoPath(info2.ProductId.ToString())) + "' Target='_blank'>" + info2.ProductName + "</a>"; ((Literal)e.Item.FindControl("LitProductName")).Text = str3; ((Literal)e.Item.FindControl("LitProductUnit")).Text = info2.Unit; ((Literal)e.Item.FindControl("LitTruePrice")).Text = info2.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitSubTotal")).Text = subTotal.ToString("0.00"); ExtendedImage image = (ExtendedImage)e.Item.FindControl("extendedImage"); ExtendedImage image2 = (ExtendedImage)e.Item.FindControl("extendedPresentImage"); Control control = e.Item.FindControl("ProductImage"); Control control2 = e.Item.FindControl("presentImage"); if (!isPaymentShowProducdtThumb) { image.Visible = false; control.Visible = false; control2.Visible = false; } else { if (!string.IsNullOrEmpty(dataItem.ProductInfomation.ProductThumb)) { image.Src = dataItem.ProductInfomation.ProductThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image.ImageHeight = paymentThumbsHeight; image.ImageWidth = paymentThumbsWidth; if (dataItem.ProductInfomation.PresentId > 0) { PresentInfo info3 = Present.GetPresentById(dataItem.ProductInfomation.PresentId); if (!string.IsNullOrEmpty(info3.PresentThumb)) { image2.Src = info3.PresentThumb; } else { image2.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image2.ImageHeight = paymentThumbsHeight; image2.ImageWidth = paymentThumbsWidth; } } if (!isShowPaymentProductType) { e.Item.FindControl("tdProductType").Visible = false; } else { ((Literal)e.Item.FindControl("LitProductType")).Text = str; } if (!isShowPaymentSaleType) { e.Item.FindControl("tdSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitSaleType")).Text = str2; } if (!isShowPaymentMarkPrice) { e.Item.FindControl("tdMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPriceMarket")).Text = info2.PriceMarket.ToString("0.00"); } int num5 = Order.CountBuyNum(PEContext.Current.User.UserName, dataItem.ProductId); ProductInfo productById = Product.GetProductById(dataItem.ProductId); if ((productById.LimitNum > 0) && ((dataItem.Quantity + num5) > productById.LimitNum)) { BaseUserControl.WriteErrMsg(string.Concat(new object[] { "您订购了", num5, productById.Unit, productById.ProductName, ",曾经购买了", num5, productById.Unit, ",而此商品每人限购数量为", productById.LimitNum, productById.Unit, ",请重新调整您的购物车!" }), "ShoppingCart.aspx"); } if ((dataItem.ProductInfomation.SalePromotionType <= 0) || (productNum < dataItem.ProductInfomation.MinNumber)) { return; } e.Item.FindControl("PresentInfomation").Visible = true; string str4 = ""; string str5 = ""; string str6 = ""; AbstractItemInfo info5 = new ConcreteSalePromotionType(productNum, dataItem.ProductInfomation, false, null); info5.GetItemInfo(); switch (dataItem.ProductInfomation.SalePromotionType) { case 1: case 3: str5 = "<font color=red>(赠品)</font>"; str4 = "赠送礼品"; str6 = "赠送"; goto Label_06A1; case 2: case 4: if (info5.Price <= 0M) { str5 = "<font color=red>(赠送赠品)</font>"; str6 = "赠送"; break; } str5 = "<font color=red>(换购赠品)</font>"; str6 = "换购"; break; default: goto Label_06A1; } str4 = "促销礼品"; Label_06A1: if (this.PresentExist(this.m_CartId, info5.Id)) { ((HiddenField)e.Item.FindControl("HdnPresentId")).Value = info5.Id.ToString(); ExtendedLiteral literal = (ExtendedLiteral)e.Item.FindControl("LitPresentName"); literal.Text = info5.ProductName; literal.EndTag = str5; ((Literal)e.Item.FindControl("LitPresentUnit")).Text = info5.Unit; ((Literal)e.Item.FindControl("LitPresentNum")).Text = info5.Amount.ToString(); ((Literal)e.Item.FindControl("LitPresentTruePrice")).Text = info5.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitPresentSubtotal")).Text = info5.SubTotal.ToString("0.00"); this.total += info5.SubTotal; this.weight += info5.TotalWeight; } if (!isShowPaymentProductType) { e.Item.FindControl("tdPresentType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentType")).Text = str4; } if (!isShowPaymentSaleType) { e.Item.FindControl("tdPresentSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentSaleType")).Text = str6; } if (!isShowPaymentMarkPrice) { e.Item.FindControl("tdPresentMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentPriceOriginal")).Text = info5.PriceMarket.ToString("0.00"); } }
protected void RptShoppingCart_ItemDataBound(object sender, RepeaterItemEventArgs e) { ShopConfig shopConfig = SiteConfig.ShopConfig; if ((e.Item.ItemType != ListItemType.Item) && (e.Item.ItemType != ListItemType.AlternatingItem)) { goto Label_07BA; } int productNum = 0; string str = ""; string str2 = ""; decimal subTotal = 0M; ((CheckBox)e.Item.FindControl("ChkProductId")).Checked = true; ShoppingCartInfo dataItem = e.Item.DataItem as ShoppingCartInfo; if (dataItem == null) { goto Label_07BA; } productNum = dataItem.Quantity; ((TextBox)e.Item.FindControl("TxtProductAmount")).Text = productNum.ToString(); bool haveWholesalePurview = false; if (PEContext.Current.User.PurviewInfo != null) { haveWholesalePurview = PEContext.Current.User.PurviewInfo.Enablepm; } str2 = ShoppingCart.GetSaleType(dataItem.ProductInfomation, productNum, haveWholesalePurview); str = ShoppingCart.GetProductType(dataItem.ProductInfomation, productNum, haveWholesalePurview); AbstractItemInfo info2 = new ConcreteProductInfo(productNum, dataItem.Property, dataItem.ProductInfomation, PEContext.Current.User.UserInfo, false, false, haveWholesalePurview); info2.GetItemInfo(); subTotal = info2.SubTotal; this.total += subTotal; if (!string.IsNullOrEmpty(dataItem.Property)) { ((Literal)e.Item.FindControl("LitProperty")).Text = "(" + info2.Property + ")"; } ProductInfo productById = Product.GetProductById(dataItem.ProductId); if (productById.Minimum > 0) { ((Literal)e.Item.FindControl("LblMark")).Text = "(<font color=\"red\">最低购买量" + productById.Minimum.ToString() + "</font>)"; } InsideStaticLabel label = new InsideStaticLabel(); string str3 = "<a href='"; str3 = (str3 + label.GetInfoPath(info2.ProductId.ToString())) + "' Target='_blank'>" + info2.ProductName + "</a>"; ((Literal)e.Item.FindControl("LitProductName")).Text = str3; ((Literal)e.Item.FindControl("LitProductUnit")).Text = info2.Unit; ((Literal)e.Item.FindControl("LitTruePrice")).Text = info2.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitSubTotal")).Text = subTotal.ToString("0.00"); ExtendedImage image = (ExtendedImage)e.Item.FindControl("extendedImage"); ExtendedImage image2 = (ExtendedImage)e.Item.FindControl("extendedPresentImage"); Control control = e.Item.FindControl("ProductImage"); Control control2 = e.Item.FindControl("presentImage"); if (!shopConfig.IsGwcShowProducdtThumb) { image.Visible = false; control.Visible = false; control2.Visible = false; } else { if (!string.IsNullOrEmpty(dataItem.ProductInfomation.ProductThumb)) { image.Src = dataItem.ProductInfomation.ProductThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image.ImageHeight = shopConfig.GwcThumbsHeight; image.ImageWidth = shopConfig.GwcThumbsWidth; if (dataItem.ProductInfomation.PresentId > 0) { PresentInfo presentById = Present.GetPresentById(dataItem.ProductInfomation.PresentId); if (!string.IsNullOrEmpty(presentById.PresentThumb)) { image2.Src = presentById.PresentThumb; } else { image2.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } image2.ImageHeight = shopConfig.GwcThumbsHeight; image2.ImageWidth = shopConfig.GwcThumbsWidth; } } if (!shopConfig.IsShowGwcProductType) { e.Item.FindControl("tdProductType").Visible = false; } else { ((Literal)e.Item.FindControl("LitProductType")).Text = str; } if (!shopConfig.IsShowGwcSaleType) { e.Item.FindControl("tdSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitSaleType")).Text = str2; } if (!shopConfig.IsShowGwcMarkPrice) { e.Item.FindControl("tdMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPriceMarket")).Text = info2.PriceMarket.ToString("0.00"); } if (((dataItem.ProductInfomation.SalePromotionType <= 0) || (productNum < dataItem.ProductInfomation.MinNumber)) || dataItem.IsPresent) { goto Label_07BA; } e.Item.FindControl("PresentInfomation").Visible = true; string str4 = ""; string str5 = ""; string str6 = ""; int productId = 0; AbstractItemInfo info5 = new ConcreteSalePromotionType(productNum, dataItem.ProductInfomation, false, null); info5.GetItemInfo(); switch (dataItem.ProductInfomation.SalePromotionType) { case 1: case 3: str5 = "<font color=red>(赠品)</font>"; str4 = "赠送礼品"; str6 = "赠送"; productId = info5.Id; goto Label_05B2; case 2: case 4: if (info5.Price <= 0M) { str5 = "<font color=red>(赠送赠品)</font>"; str6 = "赠送"; break; } str5 = "<font color=red>(换购赠品)</font>"; str6 = "换购"; break; default: goto Label_05B2; } str4 = "促销礼品"; productId = info5.Id; Label_05B2: ((HiddenField)e.Item.FindControl("HdnPresentId")).Value = productId.ToString(); ((Literal)e.Item.FindControl("LitPresentName")).Text = info5.ProductName + str5; ((Literal)e.Item.FindControl("LitPresentUnit")).Text = info5.Unit; ((Literal)e.Item.FindControl("LitPresentNum")).Text = info5.Amount.ToString(); ((Literal)e.Item.FindControl("LitPresentTruePrice")).Text = info5.Price.ToString("0.00"); ((Literal)e.Item.FindControl("LitPresentSubtotal")).Text = info5.SubTotal.ToString("0.00"); if (this.PresentExist(this.cartId, productId)) { ((CheckBox)e.Item.FindControl("ChkPresentId")).Checked = true; this.total += info5.SubTotal; } if (!shopConfig.IsShowGwcProductType) { e.Item.FindControl("tdPresentType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentType")).Text = str4; } if (!shopConfig.IsShowGwcSaleType) { e.Item.FindControl("tdPresentSaleType").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentSaleType")).Text = str6; } if (!shopConfig.IsShowGwcMarkPrice) { e.Item.FindControl("tdPresentMarkPrice").Visible = false; } else { ((Literal)e.Item.FindControl("LitPresentPriceMarket")).Text = info5.PriceMarket.ToString("0.00"); } Label_07BA: if (e.Item.ItemType == ListItemType.Header) { Control control9 = e.Item.FindControl("ProductImageTitle"); Control control10 = e.Item.FindControl("tdProductTypeTitle"); Control control11 = e.Item.FindControl("tdSaleTypeTitle"); Control control12 = e.Item.FindControl("tdMarkPriceTitle"); if (!shopConfig.IsGwcShowProducdtThumb) { control9.Visible = false; } if (!shopConfig.IsShowGwcProductType) { control10.Visible = false; } if (!shopConfig.IsShowGwcSaleType) { control11.Visible = false; } if (!shopConfig.IsShowGwcMarkPrice) { control12.Visible = false; } } if (e.Item.ItemType == ListItemType.Footer) { Control control13 = e.Item.FindControl("footerTdThemeImage"); Control control14 = e.Item.FindControl("footerTdProductType"); Control control15 = e.Item.FindControl("footerTdSaleType"); Control control16 = e.Item.FindControl("footerTdMarkPrice"); if (!shopConfig.IsGwcShowProducdtThumb) { control13.Visible = false; } if (!shopConfig.IsShowGwcProductType) { control14.Visible = false; } if (!shopConfig.IsShowGwcSaleType) { control15.Visible = false; } if (!shopConfig.IsShowGwcMarkPrice) { control16.Visible = false; } } }
public override unsafe void Present() { try { var swapChainCopy = swapChain; var currentBufferIndexCopy = currentBufferIndex; var presentInfo = new PresentInfo { StructureType = StructureType.PresentInfo, SwapchainCount = 1, Swapchains = new IntPtr(&swapChainCopy), ImageIndices = new IntPtr(¤tBufferIndexCopy), }; // Present GraphicsDevice.NativeCommandQueue.Present(ref presentInfo); // Get next image currentBufferIndex = GraphicsDevice.NativeDevice.AcquireNextImage(swapChain, ulong.MaxValue, GraphicsDevice.GetNextPresentSemaphore(), Fence.Null); // Flip render targets backbuffer.SetNativeHandles(swapchainImages[currentBufferIndex].NativeImage, swapchainImages[currentBufferIndex].NativeColorAttachmentView); } catch (SharpVulkanException e) when (e.Result == Result.ErrorOutOfDate) { // TODO VULKAN } }
protected void RptOrderItem_ItemDataBound(object sender, RepeaterItemEventArgs e) { ShopConfig shopConfig = SiteConfig.ShopConfig; if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { OrderItemInfo dataItem = (OrderItemInfo)e.Item.DataItem; Literal literal = e.Item.FindControl("LtrServiceTerm") as Literal; HyperLink link = e.Item.FindControl("LnkProduct") as HyperLink; if (this.IsAdminPage) { if (!string.IsNullOrEmpty(dataItem.TableName)) { link.NavigateUrl = string.Concat(new object[] { "../", SiteConfig.SiteOption.ManageDir, "/Shop/ProductView.aspx?GeneralID=", dataItem.ProductId }); } else { link.NavigateUrl = string.Concat(new object[] { "../", SiteConfig.SiteOption.ManageDir, "/Shop/PresentView.aspx?presentId=", dataItem.ProductId }); } } else { link.NavigateUrl = new InsideStaticLabel().GetInfoPath(dataItem.ProductId.ToString()); link.Target = "_Blank"; } if (dataItem.ServiceTerm != 0) { DateTime time; if (dataItem.ServiceTermUnit == ServiceTermUnit.Year) { time = dataItem.BeginDate.AddYears(dataItem.ServiceTerm); } else if (dataItem.ServiceTermUnit == ServiceTermUnit.Month) { time = dataItem.BeginDate.AddMonths(dataItem.ServiceTerm); } else { time = dataItem.BeginDate.AddDays((double)dataItem.ServiceTerm); } if (DateTime.Compare(time, DateTime.Now) > 0) { literal.Text = dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit); } else { literal.Text = "<font color='red'>" + dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit) + "</font>"; } } else { literal.Text = dataItem.ServiceTerm.ToString() + BaseUserControl.EnumToHtml <ServiceTermUnit>(dataItem.ServiceTermUnit); } if (!string.IsNullOrEmpty(dataItem.Remark)) { ((Label)e.Item.FindControl("LblItemRemark")).Text = "查看"; ((Label)e.Item.FindControl("LblItemRemark")).ToolTip = dataItem.Remark; } if ((!this.m_HaveCard && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Card)) && Cards.GetCardByOrderItemId(dataItem.ProductId, dataItem.TableName, dataItem.ItemId).IsNull) { this.m_HaveCard = true; } if (!this.m_HaveSoft && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Download)) { this.m_HaveSoft = true; } if (!this.m_HavePracticality && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Practicality)) { this.m_HavePracticality = true; } if (!this.m_HaveService && Product.CharacterIsExists(dataItem.ProductCharacter, ProductCharacter.Service)) { this.m_HaveService = true; } ExtendedImage image = (ExtendedImage)e.Item.FindControl("extendedImage"); Control control = e.Item.FindControl("ProductImage"); if (!shopConfig.IsOrderProductListShowThumb) { image.Visible = false; control.Visible = false; } else { if (!string.IsNullOrEmpty(dataItem.TableName)) { ProductInfo productById = Product.GetProductById(dataItem.ProductId); if (!string.IsNullOrEmpty(productById.ProductThumb)) { image.Src = productById.ProductThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } } else { PresentInfo presentById = Present.GetPresentById(dataItem.ProductId); if (!string.IsNullOrEmpty(presentById.PresentThumb)) { image.Src = presentById.PresentThumb; } else { image.Src = SiteConfig.SiteInfo.VirtualPath + "Images/nopic.gif"; } } if (shopConfig.OrderProductListThumbsHeight != 0) { image.ImageHeight = shopConfig.OrderProductListThumbsHeight; } else if (shopConfig.OrderProductListThumbsWidth != 0) { image.ImageWidth = shopConfig.OrderProductListThumbsWidth; } } this.m_SubTotal += dataItem.Amount * dataItem.TruePrice; this.m_TotalPresentExp += dataItem.Amount * dataItem.PresentExp; this.m_TotalPresentMoney += dataItem.Amount * dataItem.PresentMoney; this.m_TotalPresentPoint += dataItem.Amount * dataItem.PresentPoint; } if (e.Item.ItemType == ListItemType.Header) { Control control2 = e.Item.FindControl("ProductImageTitle"); if (!shopConfig.IsOrderProductListShowThumb) { control2.Visible = false; } } }