public static Branch CreateBranch(ApplicationDbContext db, Guid companyId, BusinessTypeEnum businessType, string branchName, string addressLine1, string addressLine2, string addressLine3, string addressTownCity, string addressCounty, string addressPostcode, string telephoneNumber, string email, string contactName, PrivacyLevelEnum privacyLevel, EntityStatusEnum entityStatus) { Branch branch = new Branch() { BranchId = Guid.NewGuid(), CompanyId = companyId, BusinessType = businessType, BranchName = branchName, AddressLine1 = addressLine1, AddressLine2 = addressLine2, AddressLine3 = addressLine3, AddressTownCity = addressTownCity, AddressCounty = addressCounty, AddressPostcode = addressPostcode, TelephoneNumber = telephoneNumber, Email = email, ContactName = contactName, PrivacyLevel = privacyLevel, EntityStatus = entityStatus }; db.Branches.Add(branch); db.SaveChanges(); return(branch); }
private PLData Fill(DataRow dr, BusinessTypeEnum plType) { PLData data = null; switch (plType) { case BusinessTypeEnum.RealizedPL: data = RealizedPLFactory.Create(dr); break; case BusinessTypeEnum.FloatingPL: data = FloatingPlDataFactory.Create(dr); break; case BusinessTypeEnum.InterestPL: data = InterestPLDataFactory.Create(dr); break; case BusinessTypeEnum.StoragePL: data = StoragePlDataFactory.Create(dr); break; case BusinessTypeEnum.Commission: data = ComissionPLDataFactory.Create(dr); break; case BusinessTypeEnum.Levy: data = LevyPLDataFactory.Create(dr); break; } return data; }
// #################################################################################### // Create business // #################################################################################### public Business GetOrCreateTestBusiness(string name, string accountId, BusinessTypeEnum businessType) { var businessName = name + " " + businessType.ToString(); var business = Db.Businesses.Where(g => g.BusinessName == businessName).FirstOrDefault(); if (business == null) { business = Db.BusinessCreate(BusinessTypeEnum.Daikin); business.BusinessName = businessName; business.BusinessTypeId = businessType; business.AccountId = accountId; business.ShowPricing = (businessType == BusinessTypeEnum.Dealer || businessType == BusinessTypeEnum.Other); business.Enabled = true; business.CommissionSchemeAllowed = (businessType == BusinessTypeEnum.Distributor || businessType == BusinessTypeEnum.ManufacturerRep); business.Address.AddressLine1 = "18th Floor"; business.Address.AddressLine2 = "475 Fifth Avenue"; business.Address.Location = "New York"; business.Address.PostalCode = "10017"; business.Address.StateId = Db.States.Where(c => c.Name == "New York").Select(c => c.StateId).FirstOrDefault(); business.Contact.Website = "www.daikincity.com"; // Add all permissions to daikin to business Db.CopyPermissions(EntityEnum.BusinessType, (int)businessType, EntityEnum.Business, business.BusinessId); } return(business); }
public void Update(BusinessData data) { name = data.Name.IsDefault ? name : data.Name; businessType = data.BusinessType.IsDefault ? businessType : data.BusinessType; taxIdentificationNumber = data.TaxIdentificationNumber.IsDefault ? taxIdentificationNumber : data.TaxIdentificationNumber; state = data.State.IsDefault ? state : data.State; Store(); }
public static Branch UpdateBranch(Guid branchId, Guid companyId, BusinessTypeEnum businessType, string branchName, string addressLine1, string addressLine2, string addressLine3, string addressTownCity, string addressCounty, string addressPostcode, string telephoneNumber, string email, string contactName, PrivacyLevelEnum privacyLevel, EntityStatusEnum entityStatus) { ApplicationDbContext db = new ApplicationDbContext(); Branch branch = UpdateBranch(db, branchId, companyId, businessType, branchName, addressLine1, addressLine2, addressLine3, addressTownCity, addressCounty, addressPostcode, telephoneNumber, email, contactName, privacyLevel, entityStatus); db.Dispose(); return(branch); }
public static List <ZS_Audit> CheckAudit(List <int> ids, BusinessTypeEnum businessType) { if (ids == null || ids.Count <= 0) { return(new List <ZS_Audit>()); } var sql = "SELECT * FROM ZS_Audit WHERE DataId in @DataIds AND BusinessType=@BusinessType"; return(DapperHelper.GetAppMall.Query <ZS_Audit>(sql, new { BusinessType = businessType, DataIds = ids }).ToList()); }
public ActionResult View(int businessID, BusinessTypeEnum businessType) { switch (businessType) { case BusinessTypeEnum.Hotel: case BusinessTypeEnum.Company: return(RedirectToAction("View", "Entity", new { ID = businessID })); } throw new NotImplementedException(); }
public Business BusinessCreate(BusinessTypeEnum type) { var entity = new Business(); entity.BusinessId = this.Context.GenerateNextLongId(); entity.BusinessTypeId = type; entity.Address = AddressCreate(); entity.Contact = ContactCreate(); this.Context.Businesses.Add(entity); return(entity); }
public Business CreateTestBusiness(DPOContext context, BusinessTypeEnum type, string name) { this.context = context; var bus = context.Businesses.Where(u => u.BusinessName == name).FirstOrDefault(); if (bus == null) { bus = Db.BusinessCreate(type); bus.AccountId = name; bus.BusinessName = name; bus.Enabled = true; CreateTestAddress(context, bus.Address, name); CreateTestContact(context, bus.Contact, name); } ; return(bus); }
private DepositData Fill(DataRow dr, string baseCurrencyName, BusinessTypeEnum businessType) { DepositData data = new DepositData(); data.Type = dr.EscapeDBNULL<int>("Type"); data.AccountCode = dr.EscapeDBNULL<string>("AccountCode"); data.MT4Code = dr.EscapeDBNULL<int>("MT4LoginId").ToString(); data.TransactionNo = dr.EscapeDBNULL<string>("Code"); data.SourceCustomerCode = dr.EscapeDBNULL<string>("CustomerCode"); data.SourceCustomerName = dr.EscapeDBNULL<string>("CustomerName"); data.SourceCustomerAliasCode = dr.EscapeDBNULL<string>("CustomerAlias"); data.AccountingDesription = dr.EscapeDBNULL<string>("AccountingDesription"); data.SourceAmount = dr.EscapeDBNULL<decimal>("TargetAmount"); data.SourceCurrency = dr.EscapeDBNULL<Guid>("TargetCurrencyID"); data.UpdateTime = dr.EscapeDBNULL<DateTime>("UpdateTime"); data.MarginReference = dr.EscapeDBNULL<long>("MarginReference"); if (dr["iExchangeCurrencyName"] == DBNull.Value) return null; data.SourceCurrencyName = dr.EscapeDBNULL<string>("iExchangeCurrencyName"); if (dr["iExchangeCurrencyRate"] == DBNull.Value) return null; data.SourceCurrencyRate = (decimal)(dr.EscapeDBNULL<double>("iExchangeCurrencyRate")); if (businessType == BusinessTypeEnum.Withdraw || businessType == BusinessTypeEnum.Deposit) { data.BankName = dr.EscapeDBNULL<string>("BankName"); data.AccountName = dr.EscapeDBNULL<string>("AccountName"); data.BankCode = dr.EscapeDBNULL<string>("BankCode"); if (dr["BankCurrencyRate"] == DBNull.Value) return null; if (dr["BankCurrencyName"] == DBNull.Value) return null; if (dr["BankMt4LoginId"] == DBNull.Value) return null; if (dr["BankCurrencyId"] == DBNull.Value) return null; data.TargetMt4 = dr.EscapeDBNULL<int>("BankMt4LoginId").ToString(); data.TargetAmount = dr.EscapeDBNULL<decimal>("AmountRecevided"); data.TargetCurrency = dr.EscapeDBNULL<Guid>("BankCurrencyId"); data.TargetCurrencyRate = (decimal)(dr.EscapeDBNULL<double>("BankCurrencyRate")); data.TargetCurrencyName = dr.EscapeDBNULL<string>("BankCurrencyName"); if (data.SourceCurrency != data.TargetCurrency) { if (dr["DayTradeRate1"] == DBNull.Value || dr["DayTradeRate2"] == DBNull.Value) { return null; } var dtr1 = dr.EscapeDBNULL<double>("DayTradeRate1"); var dtr2 = dr.EscapeDBNULL<double>("DayTradeRate2"); data.DayTradeRate = Math.Max(dtr1, dtr2); } } int? iExchangePlAccount = this._AccountService.GetExchangePlAccount(); if (iExchangePlAccount == null) return null; data.iExchangePlMT4LoginID = iExchangePlAccount.Value.ToString(); data.BaseCurrencyName = baseCurrencyName; return data; }
public static Branch UpdateBranch(ApplicationDbContext db, Guid branchId, Guid companyId, BusinessTypeEnum businessType, string branchName, string addressLine1, string addressLine2, string addressLine3, string addressTownCity, string addressCounty, string addressPostcode, string telephoneNumber, string email, string contactName, PrivacyLevelEnum privacyLevel, EntityStatusEnum entityStatus) { Branch branch = GetBranch(db, branchId); branch.CompanyId = companyId; branch.BranchName = branchName; branch.BusinessType = businessType; branch.AddressLine1 = addressLine1; branch.AddressLine2 = addressLine2; branch.AddressLine3 = addressLine3; branch.AddressTownCity = addressTownCity; branch.AddressCounty = addressCounty; branch.AddressPostcode = addressPostcode; branch.TelephoneNumber = telephoneNumber; branch.Email = email; branch.ContactName = contactName; branch.PrivacyLevel = privacyLevel; branch.EntityStatus = entityStatus; db.Entry(branch).State = EntityState.Modified; db.SaveChanges(); return(branch); }
/// <summary> /// Converts Eagle's Business types to Ecom Business types /// </summary> /// <param name="businessType">Type code of business in eagle</param> /// <returns>Business type code in Ecom</returns> private static int MapBusinessType(BusinessTypeEnum businessType) { return businessType == BusinessTypeEnum.Distributor ? DISTRIBUTOR_TYPE_CODE : EXTERNAL_PRODUCT_PROVIDER_CODE; }
/// <summary> /// 获取审核信息 /// </summary> /// <param name="id"></param> /// <param name="businessType"></param> /// <returns></returns> public static List <ZS_Audit> CheckAudit(int id, BusinessTypeEnum businessType) { var sql = "SELECT * FROM ZS_Audit WHERE DataId=@DataId AND BusinessType=@BusinessType"; return(DapperHelper.GetAppMall.Query <ZS_Audit>(sql, new { BusinessType = businessType, DataId = id }).ToList()); }
public static ZS_Audit CheckAuditFirst(int id, BusinessTypeEnum businessType) { return(CheckAudit(id, businessType).FirstOrDefault()); }
public OtherPlDataProducer(BusinessTypeEnum businessType) { this._businessType = businessType; }
private string GetFundCode(BusinessTypeEnum plType) { string fundNoStr = string.Empty; if (plType > BusinessTypeEnum.Transfer) return fundNoStr; fundNoStr = FundManager.Default.GetFundNoStr(); if (fundNoStr == string.Empty) { MessageBox.Show("FundNo can't be empty"); throw new ArgumentException("fundNoStr is empty", "fundNoStr"); } else if (fundNoStr == null) { throw new ArgumentNullException("fundNoStr", "fundNoStr is null"); } return fundNoStr; }
/// <summary> /// 是否已审,已审无法修改 /// 增加三审, /// 有三审角色可改 /// </summary> /// <param name="id"></param> /// <param name="businessType"></param> /// <returns></returns> public static bool CheckAuditEditIs(int id, BusinessTypeEnum businessType, UserRight userRight) { if (userRight == null) { return(false); } //管理员可修改,无需验正 if (userRight.User.UName == "admin") { return(true); } var getAuid = CheckAuditFirst(id, businessType); var roleInfo = userRight.RoleList; if (getAuid == null) { return(true); } if (!getAuid.RecordState.HasValue) { getAuid.RecordState = 0; } switch (getAuid.RecordState.Value) { case (short)HasRolesAuditEnum.默认: //一审人可修改 if (roleInfo.Where(a => a.RoleName.Contains("审核人1")).Count() > 0) { return(true); } ; break; case (short)HasRolesAuditEnum.审核人1: if (roleInfo.Where(a => a.RoleName.Contains("审核人2")).Count() > 0) { return(true); } ; break; case (short)HasRolesAuditEnum.审核人2: if (roleInfo.Where(a => a.RoleName.Contains("审核人3")).Count() > 0) { return(true); } ; break; case (short)HasRolesAuditEnum.审核人3: if (roleInfo.Where(a => a.RoleName.Contains("最终审核人")).Count() > 0) { return(true); } ; break; case (short)HasRolesAuditEnum.最终审核人: default: break; } return(false); }