public override object Do(object obj)
        {
            GetOrderOrgByCustomerBP bpObj = (GetOrderOrgByCustomerBP)obj;

            if (bpObj == null)
            {
                return(null);
            }

            CommonDTO dto = new CommonDTO();

            UFIDA.U9.CBO.SCM.Customer.Customer cust = UFIDA.U9.CBO.SCM.Customer.Customer.Finder.Find("Code=@Code and Org=@Org", new OqlParam("Code", bpObj.Cust_Code), new OqlParam("Org", Context.LoginOrg.ID));
            if (cust != null)
            {
                UFIDA.U9.Base.Organization.Organization org = UFIDA.U9.Base.Organization.Organization.Finder.Find("Code=@Code", new OqlParam("Code", cust.DescFlexField.PrivateDescSeg2));
                if (org != null)
                {
                    dto.ID   = org.ID;
                    dto.Code = org.Code;
                    dto.Name = org.Name;
                }
            }

            return(dto);
        }
Exemplo n.º 2
0
        public void Notify(params object[] args)
        {
            if (args == null || args.Length == 0 || !(args[0] is UFSoft.UBF.Business.EntityEvent))
            {
                return;
            }
            BusinessEntity.EntityKey key = ((UFSoft.UBF.Business.EntityEvent)args[0]).EntityKey;

            if (key == null)
            {
                return;
            }
            SO so = key.GetEntity() as UFIDA.U9.SM.SO.SO;//销售订单实体

            if (so == null)
            {
                return;
            }
            //if (UFIDA.U9.Base.Context.LoginOrg.Code != "J002") return;//组织必须等于贸易中心
            if (!PubHelperExtend.IsTradeCenterOrg())
            {
                return;                                     //组织必须等于贸易中心
            }
            if (string.IsNullOrEmpty(so.DescFlexField.PrivateDescSeg14))
            {
                throw new Exception("接单组织不能为空!");
            }

            #region 根据接单组织改变记账期间、币种、法人组织
            UFIDA.U9.Base.Organization.Organization org = UFIDA.U9.Base.Organization.Organization.Finder.Find("Code='" + so.DescFlexField.PrivateDescSeg14 + "'");//组织机构
            if (org == null)
            {
                throw new Exception("无效的接单组织!");
            }

            so.LegacyOrg = org;// 法人组织
            foreach (SOLine line in so.SOLines)
            {
                foreach (SOShipline subLine in line.SOShiplines)
                {
                    subLine.ShiperOrg = org;

                    Session.Current.InList(subLine);
                }
            }
            UFIDA.U9.Base.SOB.SetofBooks setofBooks = UFIDA.U9.Base.SOB.SetofBooks.Finder.Find("SOBType=0 and Org.Code='" + so.DescFlexField.PrivateDescSeg14 + "'");//主账簿
            if (setofBooks == null)
            {
                throw new Exception("接单组织:" + org.Name + "未设置主账簿!");
            }

            UFIDA.U9.Base.SOB.SOBAccountingPeriod sob = UFIDA.U9.CBO.SCM.Util.BusinessHelper.GetNotClosedSOBAccountingPeriodBySOB(setofBooks, org.Key, so.BusinessDate, false);
            if (sob != null)
            {
                //记账期间赋值
                so.KeepAccountPeriod = sob;
                so.FC = setofBooks.FunctionalCurrency;
            }
            #endregion
        }
Exemplo n.º 3
0
            public CheckBarCode FindByBusinessKey(UFIDA.U9.Base.Organization.Organization org, System.String barCode)
            {
                BusinessKeyParameter parameter = new BusinessKeyParameter();

                parameter.Org     = org == null?null:org.Key;
                parameter.BarCode = barCode;
                return(this.FindByBusinessKey(parameter));
            }
Exemplo n.º 4
0
        /// <summary>
        ///     获取上下文环境信息
        /// </summary>
        public ContextInfo GetContextInfo()
        {
            if (string.IsNullOrWhiteSpace(this.EnterpriseID))
            {
                throw new U9ContextException("企业ID不能为空");
            }
            if (string.IsNullOrWhiteSpace(this.OrgCode))
            {
                throw new U9ContextException("组织不能为空");
            }
            if (string.IsNullOrWhiteSpace(this.UserCode))
            {
                throw new U9ContextException("用户不能为空");
            }
            Enterprise enterprise = ContextObject.GetEnterprise(this.EnterpriseID);

            if (enterprise == null)
            {
                throw new U9ContextException(string.Format("企业:{0}不存在!", this.EnterpriseID));
            }
            using (ContextObject contextObject = new ContextObject(enterprise))
            {
                if (string.IsNullOrWhiteSpace(this.OrgCode))
                {
                    throw new U9ContextException("组织编码不能为空");
                }
                Organization org = Organization.FindByCode(this.OrgCode);
                if (org == null)
                {
                    throw new U9ContextException(string.Format("组织:{0}不存在", this.OrgCode));
                }
                User user = User.FindByCode(this.UserCode);
                if (user == null)
                {
                    throw new U9ContextException("用户不存在或密码不正确");
                }
                string encryptPassword = ContextHelper.EncryptPassword(this.Password);
                if (encryptPassword != user.Password)
                {
                    throw new U9ContextException("用户不存在或密码不正确");
                }
                if (!user.IsAlive)
                {
                    throw new U9ContextException("用户已失效");
                }
                return(ContextInfo.GetContext(enterprise, org, user, this.Culture,
                                              this.SupportCultureNameList));
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor with Full Argument
 /// </summary>
 public BillNoDTO(System.Int64 iD, System.DateTime createdOn, System.String createdBy, System.DateTime modifiedOn, System.String modifiedBy, System.Int64 sysVersion, System.String billNoID, UFIDA.U9.Cust.GS.FT.AllEnumBE.BillNoSatetEnum billNoState, System.DateTime usedDate, UFIDA.U9.CBO.HR.Operator.Operators usedPerson, UFIDA.U9.Cust.GS.FTBillNoRuleBE.BillNoRule billNoRuleID, System.String billNoName, UFIDA.U9.Base.Organization.Organization org)
 {
     this.ID           = iD;
     this.CreatedOn    = createdOn;
     this.CreatedBy    = createdBy;
     this.ModifiedOn   = modifiedOn;
     this.ModifiedBy   = modifiedBy;
     this.SysVersion   = sysVersion;
     this.BillNoID     = billNoID;
     this.BillNoState  = billNoState;
     this.UsedDate     = usedDate;
     this.UsedPerson   = usedPerson;
     this.BillNoRuleID = billNoRuleID;
     this.BillNoName   = billNoName;
     this.Org          = org;
 }
Exemplo n.º 6
0
 /// <summary>
 ///     获取上下文信息
 /// </summary>
 /// <param name="enterprise"></param>
 /// <param name="org"></param>
 /// <param name="user"></param>
 /// <param name="culture"></param>
 /// <param name="supportCultureNameList"></param>
 /// <returns></returns>
 public static ContextInfo GetContext(Enterprise enterprise, Organization org, User user, string culture,
                                      string supportCultureNameList)
 {
     return(Create(enterprise.Code, enterprise.Name, org.ID.ToString(), org.Code, org.Name, user.ID.ToString(),
                   user.Code, user.Name, culture, supportCultureNameList));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor with Full Argument
 /// </summary>
 public ShipCostForecastDTO(System.Int64 iD, System.DateTime createdOn, System.String createdBy, System.DateTime modifiedOn, System.String modifiedBy, System.Int64 sysVersion, UFIDA.U9.Cust.GS.FT.AllEnumBE.CostForecastTypeEnum forecastType, UFIDA.U9.Cust.GS.FT.ShipPlanDetailBE.ShipPlanDetailHead shipPlan, UFIDA.U9.Cust.GS.FT.ShipPlanDetailBE.ShipPlanDetailLine shipLine, System.DateTime forecastTime, System.String forecastMan, System.Decimal brokerage, System.Decimal discount, System.Decimal oceanFreight, System.Decimal otherFee, System.Decimal taxCredits, System.Decimal procurementCost, System.Decimal labourCharges, System.Decimal productCost, System.Decimal administrativeFee, System.Decimal interest, System.Decimal mouldFee, System.Decimal labelling, System.Decimal creditInsurance, System.Decimal bankCharge, System.Decimal productForecastRate, System.Decimal listForecastRate, System.Decimal productRate, System.Decimal listRate, System.Decimal exchangeRate, UFIDA.U9.Base.FlexField.DescFlexField.DescFlexSegments descflexfield, System.String demo, UFIDA.U9.Base.Currency.Currency currency, System.Decimal domesticFee, System.Decimal otherDomesticFee, UFIDA.U9.Cust.GS.FT.OrderBomBE.OrderBomHead orderBomHead, System.Decimal rMBProductCost, System.Decimal dollorProductCost, UFIDA.U9.Base.Organization.Organization org, System.String shipDocNo, System.Decimal fIFee, System.Decimal supplierDeduction)
 {
     this.ID                  = iD;
     this.CreatedOn           = createdOn;
     this.CreatedBy           = createdBy;
     this.ModifiedOn          = modifiedOn;
     this.ModifiedBy          = modifiedBy;
     this.SysVersion          = sysVersion;
     this.ForecastType        = forecastType;
     this.ShipPlan            = shipPlan;
     this.ShipLine            = shipLine;
     this.ForecastTime        = forecastTime;
     this.ForecastMan         = forecastMan;
     this.Brokerage           = brokerage;
     this.Discount            = discount;
     this.OceanFreight        = oceanFreight;
     this.OtherFee            = otherFee;
     this.TaxCredits          = taxCredits;
     this.ProcurementCost     = procurementCost;
     this.LabourCharges       = labourCharges;
     this.ProductCost         = productCost;
     this.AdministrativeFee   = administrativeFee;
     this.Interest            = interest;
     this.MouldFee            = mouldFee;
     this.Labelling           = labelling;
     this.CreditInsurance     = creditInsurance;
     this.BankCharge          = bankCharge;
     this.ProductForecastRate = productForecastRate;
     this.ListForecastRate    = listForecastRate;
     this.ProductRate         = productRate;
     this.ListRate            = listRate;
     this.ExchangeRate        = exchangeRate;
     this.Descflexfield       = descflexfield;
     this.Demo                = demo;
     this.Currency            = currency;
     this.DomesticFee         = domesticFee;
     this.OtherDomesticFee    = otherDomesticFee;
     this.OrderBomHead        = orderBomHead;
     this.RMBProductCost      = rMBProductCost;
     this.DollorProductCost   = dollorProductCost;
     this.Org                 = org;
     this.ShipDocNo           = shipDocNo;
     this.FIFee               = fIFee;
     this.SupplierDeduction   = supplierDeduction;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor with Full Argument
 /// </summary>
 public BonusCalculateRecordDTO(System.Int64 iD, System.DateTime createdOn, System.String createdBy, System.DateTime modifiedOn, System.String modifiedBy, System.Int64 sysVersion, UFIDA.U9.Cust.GS.FI.EnumBE.BonusOperatorsTypeEnum sourceType, UFIDA.U9.Base.SOB.SOBAccountingPeriod sOBAccountingPeriod, System.String oprator, System.DateTime oprateTime, UFIDA.U9.Cust.GS.FI.EnumBE.PeriodStatusEnum periodStatus, UFIDA.U9.Base.Organization.Organization org, System.String operatorBonus, System.String repairOperatorBonus)
 {
     this.ID                  = iD;
     this.CreatedOn           = createdOn;
     this.CreatedBy           = createdBy;
     this.ModifiedOn          = modifiedOn;
     this.ModifiedBy          = modifiedBy;
     this.SysVersion          = sysVersion;
     this.SourceType          = sourceType;
     this.SOBAccountingPeriod = sOBAccountingPeriod;
     this.Oprator             = oprator;
     this.OprateTime          = oprateTime;
     this.PeriodStatus        = periodStatus;
     this.Org                 = org;
     this.OperatorBonus       = operatorBonus;
     this.RepairOperatorBonus = repairOperatorBonus;
 }