// 插入会员渠道价格表 public Int32 InsertProductChannelMemberPricesBiz(ProductChannelMemberPriceInfo entity) { //找出当前渠道下的所有记录 IList <ProductChannelMemberPriceInfo> _old = _ProductChannelInfoDA.GetProductChannelMemberPriceByChannelSysNo(entity.ChannelSysNO); if (_old.Select(p => p.ProductSysNo).Contains(entity.ProductSysNo)) { throw new BizException(ResouceManager.GetMessageString("IM.ProductChannelInfo", "TheChannelExistsThePorduct")); } return(_ProductChannelInfoDA.InsertProductChannelMemberPrices(entity)); }
/// <summary> /// 回复邮件操作,并发送邮件 /// </summary> /// <param name="item"></param> public virtual void UpdateProductReviewMailLog(ProductReview item) { //保存邮件日志 if (!string.IsNullOrEmpty(item.ProductReviewMailLog.TopicMailContent.Content) || !string.IsNullOrEmpty(item.ProductReviewMailLog.CSNote.Content)) { if (productReviewMailLogDA.CheckProductCommentMailLog(item.ProductReviewMailLog)) { productReviewMailLogDA.UpdateProductCommentMailLog(item.ProductReviewMailLog); } else { productReviewMailLogDA.CreateProductCommentMailLog(item.ProductReviewMailLog); } } productReviewDA.UpdateProductReview(item); #region 发送邮件 KeyValueVariables replaceVariables = new KeyValueVariables(); ECCentral.BizEntity.IM.ProductInfo product = ExternalDomainBroker.GetProductInfo(item.ProductSysNo.Value); replaceVariables.AddKeyValue(@"ProductID", product.ProductID); replaceVariables.AddKeyValue(@"ProductName", product.ProductName); replaceVariables.AddKeyValue(@"ProductLink", item.ProductID); replaceVariables.AddKeyValue(@"Title", item.Title); replaceVariables.AddKeyValue(@"ProductContent", string.Format(ResouceManager.GetMessageString("MKT.Comment", "Comment_ProductReviewMailMainContent"), item.Prons, item.Cons, item.Service)); //replaceVariables.AddKeyValue(@"#InUser#", ServiceContext.Current.); //replaceVariables.AddKeyValue(@"#InDateAll#", DateTime.Now.ToString()); replaceVariables.AddKeyValue(@"InDateAll-Y", DateTime.Now.Year.ToString()); replaceVariables.AddKeyValue(@"InDateAll-M", DateTime.Now.Month.ToString()); replaceVariables.AddKeyValue(@"InDateAll-D", DateTime.Now.Day.ToString()); replaceVariables.AddKeyValue(@"EmailText", item.ProductReviewMailLog.TopicMailContent.Content); replaceVariables.AddKeyValue(@"All", DateTime.Now.ToString()); replaceVariables.AddKeyValue(@"InDate-Y", DateTime.Now.Year.ToString()); replaceVariables.AddKeyValue(@"InDate-M", DateTime.Now.Month.ToString()); replaceVariables.AddKeyValue(@"InDate-D", DateTime.Now.Day.ToString()); replaceVariables.AddKeyValue(@"Year", DateTime.Now.Year.ToString()); ECCentral.BizEntity.Customer.CustomerInfo customer = ExternalDomainBroker.GetCustomerInfo(item.CustomerSysNo.Value); replaceVariables.AddKeyValue(@"CustomerName", customer.BasicInfo.CustomerID); if (string.IsNullOrEmpty(customer.BasicInfo.Email)) { //throw new BizException("邮件地址为空!"); throw new BizException(ResouceManager.GetMessageString("MKT.ProductReview", "ProductReview_EmailNotNull")); } else { ECCentral.Service.Utility.EmailHelper.SendEmailByTemplate(customer.BasicInfo.Email, "MKT_ProductReviewMailContent", replaceVariables, false); } #endregion }
/// <summary> /// 根据系统编号获取申请单信息(不包括单件信息) /// </summary> /// <param name="sysNo">系统编号</param> /// <returns>单件信息</returns> public virtual RMARequestInfo LoadBySysNo(int sysNo) { var result = ObjectFactory <IRequestDA> .Instance.LoadBySysNo(sysNo); if (result == null) { string msg = ResouceManager.GetMessageString("RMA.Request", "RequestNotExists"); msg = string.Format(msg, sysNo); throw new BizException(msg); } return(result); }
/// <summary> /// UI专用:根据sysNo加载单件信息,包含了单件的一些关联表的相关信息 /// </summary> /// <param name="sysNo"></param> /// <returns></returns> public virtual RMARegisterInfo LoadForEditBySysNo(int sysNo) { var result = registerDA.LoadForEditBySysNo(sysNo); if (result == null) { string msg = ResouceManager.GetMessageString("RMA.Request", "RegisterNotExists"); msg = string.Format(msg, sysNo); throw new BizException(msg); } return(result); }
/// <summary> /// 根据退款单系统编号获取新退款调整单基本信息 /// </summary> /// <param name="OrgRefundSysNo"></param> /// <returns></returns> public virtual RefundBalanceInfo LoadNewRefundBalanceByRefundSysNo(int refundSysNo) { RefundBalanceInfo refundBalanceInfo = refundBalanceDA.LoadNewRefundBalanceByRefundSysNo(refundSysNo); if (refundBalanceInfo == null) { throw new BizException(ResouceManager.GetMessageString("RMA.RefundBalance", "Void_RefundBalanceInfo")); } refundBalanceInfo.IncomeBankInfo = ExternalDomainBroker.GetSOIncomeRefundInfo(refundBalanceInfo.OriginalRefundSysNo.Value, RefundOrderType.RO); refundBalanceInfo.CustomerID = ExternalDomainBroker.GetCustomerBasicInfo(refundBalanceInfo.CustomerSysNo.Value).CustomerID; return(refundBalanceInfo); }
//成批删除渠道会员表 public void DeleteProductChannelMemberPrices(List <ProductChannelMemberPriceInfo> entityList) { StringBuilder result = new StringBuilder(); foreach (var entity in entityList) { try { DeleteProductChannelMemberPrice(int.Parse(entity.SysNo.ToString())); entity.MemberPricePercent = entity.MemberPricePercent != null ? entity.MemberPricePercent / 100 : entity.MemberPricePercent; ProductChannelMemberPriceLogInfo log = new ProductChannelMemberPriceLogInfo() { ProductSysNo = entity.ProductSysNo, ChannelName = entity.ChannelName, MemberPrice = entity.MemberPrice, MemberPricePercent = entity.MemberPricePercent, OperationType = "D", InDate = DateTime.Now, InUser = entity.EditUser, CompanyCode = entity.CompanyCode, StoreCompanyCode = entity.StoreCompanyCode, LanguageCode = entity.LanguageCode }; InsertProductChannelMemberPriceLog(log); successCount++; } catch (BizException ex) { string message = ResouceManager.GetMessageString("IM.ProductChannelInfo", "SystemNo"); message += ":{0},"; message += ResouceManager.GetMessageString("IM.Category", "FailReason"); message += ":{1}"; result.AppendLine(string.Format(message , entity.SysNo, ex.Message)); errorCount++; } } string resMessage = ResouceManager.GetMessageString("IM.ProductChannelInfo", "DeleteSuccess"); resMessage += ":{0},"; resMessage += ResouceManager.GetMessageString("IM.Category", "NumberUnit"); resMessage += ResouceManager.GetMessageString("IM.ProductChannelInfo", "DeleteFail"); resMessage += ":{1}"; resMessage += ResouceManager.GetMessageString("IM.Category", "NumberUnit"); resMessage += "。\r\n"; result.Insert(0, string.Format(resMessage , successCount, errorCount)); _ChannelMemberInfoByChannelNo = null; ClearNum(); throw new BizException(result.ToString()); }
private void PreCheck(GroupBuyingCategoryInfo entity) { if (string.IsNullOrEmpty(entity.Name)) { //throw new BizException("类别名称不能为空!"); throw new BizException(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_CategoryNameIsNotNull")); } if (m_GroupBuyingDA.CheckGroupBuyingCategoryNameExists(entity.Name, entity.SysNo ?? 0, entity.CategoryType.Value)) { //throw new BizException(string.Format("类别[{0}]已经存在!", entity.Name)); throw new BizException(string.Format(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_AlreadyExsitCategory"), entity.Name)); } }
/// <summary> /// Check团购基本信息 /// </summary> /// <param name="entity"></param> public static void CheckGroupBuyingBase(GroupBuyingInfo entity) { if (entity.GroupBuyingAreaSysNo < 1) { //throw new BizException("请先选择城市!"); throw new BizException(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_CityIsNotNull")); } if (entity.GroupBuyingTypeSysNo < 0) { //throw new BizException("请先选择分类!"); throw new BizException(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_CategoryIsNotNull")); } }
protected override void DrawObject() { Renderer_2D.Begin(Camera2D.GetTransform()); Color color = isSelected ? Color.Red : Color.White; Vector2 imgSize = ResouceManager.GetTextureSize(name); Rectangle rect = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y); Renderer_2D.DrawTexture(name, position, color, 1, rect, Vector2.One, 0, imgSize / 2); Renderer_2D.End(); }
public override void Draw() { Renderer_2D.Begin(Camera2D.GetTransform()); Vector2 position = entity.transform.Position + offset; Vector2 imgSize = ResouceManager.GetTextureSize(name); Rectangle rect = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y); Vector2 drawSize = new Vector2(size.X / imgSize.X, size.Y / imgSize.Y) * 2; Renderer_2D.DrawTexture(name, position, color, alpha, rect, drawSize, 0, imgSize / 2); Renderer_2D.End(); }
public virtual void MaintainMaliceUser(int customerSysNo, bool isMalice, CustomerOperateLog entity) { if (isMalice) { entity.EventType = ResouceManager.GetMessageString("Customer.CustomerInfo", "UpdateToBadUser"); } else { entity.EventType = ResouceManager.GetMessageString("Customer.CustomerInfo", "UpdateToGoodUser"); } customerDA.InsertCustomerInfoOperateLog(entity); customerDA.UpdateIsBadCustomer(customerSysNo, isMalice); }
public C_DrawSeasonUI(C_SeasonState seasonState, float depth = 100, float alpha = 1) { this.seasonState = seasonState; this.alpha = alpha; this.depth = depth; graphicsDevice = Renderer_2D.GetGraphicsDevice(); effect = ResouceManager.GetEffect("CircleBar").Clone(); effect.Parameters["WorldViewProjection"].SetValue(Camera2D.GetView() * Camera2D.GetProjection()); effect.CurrentTechnique = effect.Techniques["Technique1"]; vertexPositions = new VertexPositionTexture[4]; }
/// <summary> /// 判断支付方式是否是网上支付 /// </summary> /// <param name="payTypeSysNo"></param> /// <returns></returns> private bool IsNetPayType(int payTypeSysNo, int soSysNo) { var payTypes = ExternalDomainBroker.GetPayTypeList(); foreach (var item in payTypes) { if (item.SysNo == payTypeSysNo) { return(item.IsNet.Value); } } throw new BizException(ResouceManager.GetMessageString(InvoiceConst.ResourceTitle.NetPay, "NetPay_OrderPayTypeInvalid")); }
/// <summary> /// 检查渠道商品价格信息实体 /// </summary> /// <param name="entity"></param> public static void CheckProductChannelPeriodPriceInfo(ProductChannelPeriodPrice entity) { if (entity.Operate != ProductChannelPeriodPriceOperate.Stop) { int result = _ProductChannelInfoDA.CheckProductChannelPeriodPrice(entity); if (result == -1) { //该时段价格已存在 throw new BizException(ResouceManager.GetMessageString("IM.ProductChannelInfo", "ProductChannelPeriodPriceIsExists")); } } }
/// <summary> /// 审核通过 /// </summary> /// <param name="sysNo"></param> public virtual void AuditApprove(int sysNo, string reasonStr) { GroupBuyingInfo infoTemp = Load(sysNo); if (infoTemp.Status == GroupBuyingStatus.WaitingAudit) { CheckGroupBuyAndCountDownConflict(infoTemp); } if (infoTemp.Status.Value != GroupBuyingStatus.WaitingAudit) { //throw new BizException(string.Format("团购[{0}]审核通过失败,只有待审核状态的团购才能审核通过!", sysNo)); throw new BizException(string.Format(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_JustWaitCanAuditPass"), sysNo)); } if (infoTemp.Status.Value == GroupBuyingStatus.Pending || infoTemp.Status.Value == GroupBuyingStatus.WaitHandling) { //throw new BizException(string.Format("团购[{0}]信息状态已变更,请刷新后再试!", sysNo)); throw new BizException(string.Format(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_TryAgainAfterF5"), sysNo)); } if (string.IsNullOrWhiteSpace(reasonStr)) { //throw new BizException(string.Format("审核理由不能为空!", sysNo)); throw new BizException(string.Format(ResouceManager.GetMessageString("MKT.Promotion.GroupBuying", "GroupBuying_AuditPassReasonIsNull"), sysNo)); } //if (infoTemp.RequestSysNo == null || infoTemp.RequestSysNo.Value < 1) //{ infoTemp.Status = GroupBuyingStatus.Pending; //David:不管商家商品或是中商商品,审核通过全部更改为就绪 //} //else //{ // //商家商品 // infoTemp.Status = GroupBuyingStatus.WaitHandling; //} infoTemp.AuditUser = ObjectFactory <ICommonBizInteract> .Instance.GetUserFullName(ServiceContext.Current.UserSysNo.ToString(), true); //if (infoTemp.InUser == infoTemp.AuditUser) //{ // throw new BizException(string.Format("团购[{0}]审核操作时,审核人不能与创建人相同!", sysNo)); //} infoTemp.Reasons = reasonStr; TransactionScopeFactory.TransactionAction(() => { m_GroupBuyingDA.UpdateProductGroupBuyingStatus(infoTemp); //促销引擎-更新活动状态 -审核通过即为运行 //ObjectFactory<GroupBuyingPromotionEngine>.Instance.UpdateGroupBuyingActivityStatus(sysNo, GroupBuyingStatus.Active); ExternalDomainBroker.CreateOperationLog(BizLogType.GroupBuyingAuditApprove.ToEnumDesc(), BizLogType.GroupBuyingAuditApprove, sysNo, infoTemp.CompanyCode); }); }
/// <summary> /// 处理银联返回的信息 /// </summary> /// <param name="rawRefundResult"></param> public ResponseResult(string rawRefundResult) { int startTagPosition = rawRefundResult.IndexOf("<body>"); int endTagPosition = rawRefundResult.IndexOf("</body>"); string result = rawRefundResult.Substring(startTagPosition + 6, endTagPosition - startTagPosition - 6); string[] strArray = result.Split('&'); if (strArray.Length >= 2) { string[] arrayResponseCode = strArray[0].Split('='); //当ResponseCode的值为0时后续的字段需要参与签名验证后才能表示交易处理成功, //失败时ResponseCode为其它错误码 if (arrayResponseCode[1] != "0") { Result = false; string[] arrayMessage = strArray[1].Split('='); if (arrayMessage.Length >= 2) { Message = arrayMessage[1]; } } else { string[] arrayStatus = strArray[7].Split('='); if (arrayStatus[1] == "1") { Result = true; //Message = "退款提交成功"; Message = ResouceManager.GetMessageString("Invoice.NePay", "NetPay_RefundSubmitSuccess"); } else if (arrayStatus[1] == "3") { Result = true; //Message = "退款成功"; Message = ResouceManager.GetMessageString("Invoice.NePay", "NetPay_RefundSuccess"); } else if (arrayStatus[1] == "8") { Result = false; //Message = "退款失败"; Message = ResouceManager.GetMessageString("Invoice.NePay", "NetPay_RefundFailed"); } } } else { Result = false; //Message = "提交退款应答失败!"; Message = ResouceManager.GetMessageString("Invoice.NePay", "NetPay_SubmitRefundReplayFailed"); } }
private void ValidateProductLine(ProductLineInfo entity) { if (entity == null) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult1")); } if (!entity.C2SysNo.HasValue || entity.C2SysNo <= 0) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult2")); } if (entity.PMUserSysNo <= 0) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult3")); } if (entity.MerchandiserSysNo <= 0) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult4")); } var message = new List <string>(); if (!da.C2IsValid(entity.C2SysNo.Value)) { message.Add(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult5")); } if (entity.BrandSysNo.HasValue && !da.BrandIsValid(entity.BrandSysNo.Value)) { message.Add(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult6")); } if (!da.PMIsValid(entity.PMUserSysNo)) { message.Add(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult7")); } if (!da.PMIsValid(entity.MerchandiserSysNo)) { message.Add(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult8")); } if (message.Any()) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult9") + message.Join(",")); } if (!entity.SysNo.HasValue || entity.SysNo <= 0) { var isexists = da.IsExists(entity.C2SysNo.Value, entity.BrandSysNo); //是否会导致新分类重复 if (isexists) { throw new BizException(ResouceManager.GetMessageString("IM.Product", "ValidateProductLineResult10")); } } }
public void BatchCreateProductPayType(ProductPayTypeInfo productPayTypeInfo) { if (string.IsNullOrEmpty(productPayTypeInfo.ProductIds)) { //throw new BizException("商品ID不能为空"); throw new BizException(ResouceManager.GetMessageString("MKT.ProductPayType", "ProductPayType_PIDNotNull")); } if (productPayTypeInfo.PayTypeList == null || productPayTypeInfo.PayTypeList.Count == 0) { //throw new BizException("支付方式ID不能为空"); throw new BizException(ResouceManager.GetMessageString("MKT.ProductPayType", "ProductPayType_PayTypeIDNotNull")); } var productIds = productPayTypeInfo.ProductIds.Split('\r'); var successCount = 0; var message = string.Empty; var idList = new List <string>(); foreach (var productID in productIds) { if (idList.Contains(productID)) { continue; } idList.Add(productID); productPayTypeInfo.ProductID = productID.Trim(); foreach (var payType in productPayTypeInfo.PayTypeList) { productPayTypeInfo.PayTypeSysNo = payType.PayTypeSysNo; try { var result = CreateProductPayType(productPayTypeInfo); if (result == -2) { // message += string.Format("商品ID:{0}不支持支付方式创建失败,失败原因:商品信息不存在\r", productID); message += string.Format(ResouceManager.GetMessageString("MKT.ProductPayType", "ProductPayType_NotExsistProductInfo"), productID); continue; } } catch (Exception ex) { //message += string.Format("商品ID:{0}不支持支付方式创建失败,失败原因:{1}\r", productID, ex.Message); message += string.Format(ResouceManager.GetMessageString("MKT.ProductPayType", "ProductPayType_PayTypeNotSupport"), productID); continue; } successCount++; } } //message = string.Format("成功添加{0}条\r", successCount) + message; message = string.Format(ResouceManager.GetMessageString("MKT.ProductPayType", "ProductPayType_SuccessCount"), successCount) + message; throw new BizException(message); }
/// <summary> /// 加载Combo所有信息 /// </summary> /// <param name="sysNo"></param> /// <returns></returns> public virtual ComboInfo Load(int?sysNo) { ComboInfo info = _da.Load(sysNo.Value); if (info == null) { //throw new BizException("套餐不存在!"); throw new BizException(ResouceManager.GetMessageString("MKT.Promotion.Combo", "Combo_NotExsistComb")); } string userfullname = ObjectFactory <ICommonBizInteract> .Instance.GetUserFullName(ServiceContext.Current.UserSysNo.ToString(), true); info.InUser = userfullname; return(info); }
private void VertexUpdate(Vector3 drawPosition) { float size = 1; float rotateAngle = entity.transform.Angle; Vector2 imgSize = ResouceManager.GetTextureSize(imgName); vertexPositions[0] = new VertexPositionTexture(drawPosition + Method.RotateVector3(new Vector3(-0.5f * imgSize.X, -0.5f * imgSize.Y, 0) * size * Camera2D.GetZoom(), rotateAngle), new Vector2(0, 0)); vertexPositions[1] = new VertexPositionTexture(drawPosition + Method.RotateVector3(new Vector3(-0.5f * imgSize.X, 0.5f * imgSize.Y, 0) * size * Camera2D.GetZoom(), rotateAngle), new Vector2(0, 1)); vertexPositions[2] = new VertexPositionTexture(drawPosition + Method.RotateVector3(new Vector3(0.5f * imgSize.X, -0.5f * imgSize.Y, 0) * size * Camera2D.GetZoom(), rotateAngle), new Vector2(1, 0)); vertexPositions[3] = new VertexPositionTexture(drawPosition + Method.RotateVector3(new Vector3(0.5f * imgSize.X, 0.5f * imgSize.Y, 0) * size * Camera2D.GetZoom(), rotateAngle), new Vector2(1, 1)); vertexBuffer = new VertexBuffer(graphicsDevice, typeof(VertexPositionTexture), vertexPositions.Length, BufferUsage.None); vertexBuffer.SetData <VertexPositionTexture>(vertexPositions); }
/// <summary> /// 作废单件 /// </summary> /// <param name="requestSysNo"></param> /// <param name="sysNo"></param> /// <returns></returns> public virtual RMARegisterInfo SetAbandon(int sysNo) { RMARegisterInfo registerEntity = LoadBySysNo(sysNo); if (registerEntity.BasicInfo.Status != RMARequestStatus.Origin) { string msg = ResouceManager.GetMessageString("RMA.Request", "CannotAbandonRegister"); throw new BizException(msg); } registerDA.SetAbandon(sysNo); return(LoadBySysNo(sysNo)); }
protected virtual void DrawCollition() { Renderer_2D.Begin(Camera2D.GetTransform()); Color color = isMouseIn ? Color.Red : Color.Yellow; Vector2 imgSize = ResouceManager.GetTextureSize("CollisionArea"); Rectangle rect = new Rectangle(0, 0, (int)imgSize.X, (int)imgSize.Y); Vector2 drawSize = new Vector2(radius / imgSize.X, radius / imgSize.Y) * 2; Renderer_2D.DrawTexture("CollisionArea", position, color, 0.5f, rect, drawSize, 0, imgSize / 2); Renderer_2D.End(); }
/// <summary> /// 检查被商品使用的品牌 /// </summary> /// <param name="brandSysNo"></param> /// <returns></returns> private static void CheckBrandInUsing(int?brandSysNo) { if (brandSysNo == null || brandSysNo.Value <= 0) { throw new BizException(ResouceManager.GetMessageString("IM.Brand", "BrandSysNOIsNull")); } var brandDA = ObjectFactory <IBrandDA> .Instance; var result = brandDA.IsBrandInUsing(brandSysNo.Value); if (result) { throw new BizException(ResouceManager.GetMessageString("IM.Brand", "BrandIsInvalid")); } }
/// <summary> /// 检查PM编号是否存在 /// </summary> /// <param name="userSysNo"></param> public static void CheckIsExistPMUserSysNo(int?userSysNo) { if (userSysNo == null || userSysNo.Value <= 0) { throw new BizException(ResouceManager.GetMessageString("IM.ProductManager", "ProductManageruserSysNoIsNull")); } var productManagerDA = ObjectFactory <IProductManagerDA> .Instance; var result = productManagerDA.IsExistUserSysNo(userSysNo.Value); if (!result) { throw new BizException(ResouceManager.GetMessageString("IM.ProductManager", "ExistUserSysNo")); } }
private static void CheckBrandCodeIsExit(string brandCode, int?brandSysNo) { if (string.IsNullOrEmpty(brandCode)) { throw new BizException(ResouceManager.GetMessageString("IM.Brand", "BrandCodeIsNull")); } var brandDA = ObjectFactory <IBrandDA> .Instance; var result = brandDA.CheckBrandCodeIsExit(brandCode, brandSysNo); if (result) { throw new BizException(ResouceManager.GetMessageString("IM.Brand", "BrandCodeIsExit")); } }
public byte[] CreateFile(List <System.Data.DataTable> data, List <List <ColumnData> > columnList, List <TextInfo> textInfoList, out string fileName, string FileTitle) { int index = 0; string path = ConfigurationManager.AppSettings["ExporterTemplateFilePath"]; if (path == null || path.Trim().Length <= 0) // 没有配置,使用默认路径 { path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Configuration/ExporterTemplates"); } else if (path.IndexOf(':') < 0) // 配置的不是绝对路径 { path = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, path.TrimStart('~', '/', '\\')); } string templateFileName = Path.Combine(path, "IM/Inspection." + Thread.CurrentThread.CurrentCulture.Name + ".xls"); FileStream file = new FileStream(templateFileName, FileMode.Open, FileAccess.Read); this.m_Document = new HSSFWorkbook(file); file.Close(); foreach (DataTable table in data) { if (table != null && table.Rows != null && table.Rows.Count > MaxDataTableRowCountLimit && ThrowExceptionWhenDataTableRowCountExceedLimit) { string msg = string.Format(ResouceManager.GetMessageString("IM.Product", "DataExport_DataTableRowCountExceedLimit"), MaxDataTableRowCountLimit); throw BuildBizException(msg, table.Rows.Count); } Sheet worksheet = this.m_Document.GetSheetAt(0); if (table != null) { HSSFPatriarch patriarch = (HSSFPatriarch)(worksheet.CreateDrawingPatriarch()); BuildSheet(worksheet, index, table, patriarch); worksheet.ForceFormulaRecalculation = true; } index++; } fileName = SetFileName(data, textInfoList); MemoryStream mStream = new MemoryStream(); m_Document.Write(mStream); byte[] array = mStream.GetBuffer(); mStream.Close(); return(array); }
/// <summary> /// 是否存在不展示的附件 /// </summary> /// <param name="productSysNo"></param> private void IsExistProductAttachment(int productSysNo) { var product = ObjectFactory <IProductDA> .Instance; var tempProduct = product.GetProductInfoBySysNo(productSysNo); if (tempProduct == null || String.IsNullOrEmpty(tempProduct.ProductID)) { throw new BizException(ResouceManager.GetMessageString("IM.ProductAttachment", "ProductAttachmentIsInvalid")); } if (tempProduct.ProductStatus != ProductStatus.InActive_UnShow) { throw new BizException(ResouceManager.GetMessageString("IM.ProductAttachment", "ProductAttachmentStatusIsInvalid")); } }
private string CheckMargin(decimal checkPrice, ProductInfo productInfo, CategoryInfo categoryInfo, string priceName, ref ProductPriceRequestAuditType auditType) { var message = new StringBuilder(); if (categoryInfo.SysNo.HasValue) { var setting = ObjectFactory <CategorySettingProcessor> .Instance.GetCategorySettingBySysNo(categoryInfo.SysNo.Value, productInfo.SysNo); var priceInfo = productInfo.ProductPriceRequest; if (priceInfo.UnitCost != 0) { var margin = GetMargin(checkPrice, priceInfo.Point.HasValue ? priceInfo.Point.Value : 0, priceInfo.UnitCost); if (margin < setting.PrimaryMargin && margin > setting.SeniorMargin) { message.AppendLine(ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult1") + priceName + ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult2")); } if (margin < setting.SeniorMargin) { message.AppendLine(priceName + ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult3")); auditType = ProductPriceRequestAuditType.SeniorAudit; } var productPromotionDiscountInfoList = ExternalDomainBroker.GetProductPromotionDiscountInfoList(productInfo.SysNo); if (productPromotionDiscountInfoList.Any()) { productPromotionDiscountInfoList.ForEach(promotionDiscountInfo => { var promotionMargin = GetMargin(checkPrice, priceInfo.Point.HasValue ? priceInfo.Point.Value : 0, priceInfo.UnitCost, promotionDiscountInfo.Discount); var enumName = EnumHelper.GetEnumDesc(promotionDiscountInfo.PromotionType); var promotionMarginPercent = (promotionMargin * 100).TruncateDecimal(2) + "%"; if (promotionMargin < setting.PrimaryMargin) { message.AppendLine(ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult4") + priceName + ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult5") + enumName + promotionDiscountInfo.ReferenceSysNo + ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult6") + promotionMarginPercent + ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult7")); } }); } } } else { throw new BizException(ResouceManager.GetMessageString("IM.ProductPrice", "CheckMarginResult8")); } return(message.ToString()); }
/// <summary> /// 检查PMID是否存在 /// </summary> /// <param name="userID"></param> public static void CheckIsExistPMUserID(string userID) { if (string.IsNullOrEmpty(userID)) { throw new BizException(ResouceManager.GetMessageString("IM.ProductManager", "ProductManageruserSysNoIsNull")); } var productManagerDA = ObjectFactory <IProductManagerDA> .Instance; var result = productManagerDA.IsExistUserID(userID); if (!result) { throw new BizException(ResouceManager.GetMessageString("IM.ProductManager", "ExistUserSysNo")); } }
public void SetShaderOn(float liveTime, string baseImg, string maskImg) { isShaderOn = true; baseImgSize = ResouceManager.GetTextureSize(baseImg); shadeTimer.SetTimer(liveTime); effect = ResouceManager.GetEffect("MaskShader").Clone(); effect.Parameters["theTexture"].SetValue(ResouceManager.GetTexture(baseImg)); effect.Parameters["theMask"].SetValue(ResouceManager.GetTexture(maskImg)); effect.CurrentTechnique = effect.Techniques["Technique1"]; effect.Parameters["WorldViewProjection"].SetValue(Camera2D.GetView() * Camera2D.GetProjection()); effect.Parameters["Color"].SetValue(new float[4] { 0.5f, 0, 0, 0.5f }); }