本文整理汇总了C#中Parse.ParseUser.GetPointerObject方法的典型用法代码示例。如果您正苦于以下问题:C# ParseUser.GetPointerObject方法的具体用法?C# ParseUser.GetPointerObject怎么用?C# ParseUser.GetPointerObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse.ParseUser
的用法示例。
在下文中一共展示了ParseUser.GetPointerObject方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAgent
private ParseUser GetAgent(Purchase purchase)
{
ParseUser agent = null;
var teacher = new ParseUser();
if (purchase.ClipKey != null)
{
teacher = purchase.ClipKey.Teacher;
}
if (purchase.BundleKey != null)
{
teacher = purchase.BundleKey.Teacher;
}
var userAdminData = teacher.GetPointerObject<UserAdminData>("adminData");
if (userAdminData != null && userAdminData.Agent != null)
{
agent = userAdminData.Agent;
}
return agent;
}
示例2: InitPuchaseView
private static void InitPuchaseView(ParseUser loggedInUser, CheckoutViewModel checkoutViewModel)
{
var adminData = loggedInUser.GetPointerObject<UserAdminData>("adminData");
adminData.PurchaseCount = 0;
Task.Run(() => adminData.SaveAsync());
checkoutViewModel.PaymentSuccess = true;
checkoutViewModel.PurchasesForUser = new CheckoutPurchaseViewModel[0];
}
示例3: GetTeacherAdminData
private UserAdminData GetTeacherAdminData(Purchase purchase)
{
var teacher = new ParseUser();
if (purchase.ClipKey != null)
{
teacher = purchase.ClipKey.Teacher;
}
if (purchase.BundleKey != null)
{
teacher = purchase.BundleKey.Teacher;
}
return teacher.GetPointerObject<UserAdminData>("adminData");
}
示例4: SetPurchases
private void SetPurchases(ParseRepository repository, ParseUser user)
{
var userPurchases = repository.FindUserPurchases(user.ObjectId);
var userAdminData = user.GetPointerObject<UserAdminData>("adminData");
userAdminData.PurchaseCount = userPurchases.Count(x => x.BundleKey != null || x.ClipKey != null);
Task.Run(() => userAdminData.SaveAsync()).Wait();
}
示例5: TeacherAccountCreditStatement
private AccountStatementDto TeacherAccountCreditStatement(CreateCouponViewModel createCouponVm, AccountStatementBuilder accountStatementBuilder,
double paymentTransaction, List<AccountStatementDto> accountStatements, ParseUser teacher, CurrencyRetriver currencyRetriever)
{
var currentCurrencyDto = currencyRetriever.GetCurrent();
// add creding + debit record for teacher
var teacherAccountCreditStatement = accountStatementBuilder.SetAccountStatement(
teacher,
paymentTransaction,
0,
TransactionType.CouponBuyerPayment,
DateTime.Now,
currentCurrencyDto);
var teacherAccountDebitStatement = accountStatementBuilder.SetAccountStatement(
teacher,
0,
createCouponVm.TeacherData.GapToPay,
TransactionType.CouponBuyerDebit,
DateTime.Now,
currentCurrencyDto);
createCouponVm.TeacherData.Balance = teacher.GetPointerObject<UserAdminData>("adminData").Balance;
accountStatements.AddRange(new[]
{
teacherAccountCreditStatement,
teacherAccountDebitStatement,
});
return teacherAccountCreditStatement;
}
示例6: SiteAccountCreditStatement
private void SiteAccountCreditStatement(CreateCouponViewModel createCouponVm, AccountStatementBuilder accountStatementBuilder, double amountForSiteAccountCredit, List<AccountStatementDto> accountStatements, ParseUser siteAccount, CurrencyRetriver currencyRetriever)
{
var siteAccountCreditStatement = accountStatementBuilder.SetAccountStatement(
siteAccount,
amountForSiteAccountCredit,
0,
TransactionType.CouponSiteCredit,
DateTime.Now,
currencyRetriever.GetCurrent());
createCouponVm.SiteAccountBalance = siteAccount.GetPointerObject<UserAdminData>("adminData").Balance;
accountStatements.Add(siteAccountCreditStatement);
}
示例7: VatCreditStatement
private static void VatCreditStatement(CreateCouponViewModel createCouponVm, double maamPaymentCredit, AccountStatementBuilder accountStatementBuilder, List<AccountStatementDto> accountStatements, AccountStatementDto teacherAccountCreditStatement, double maam, double maamFromBalance, ParseUser maamAccount, ParseUser maamBalanceAccount, CurrencyRetriver currencyRetriever)
{
if (maamPaymentCredit > 0)
{
// add record for mamm account
var maamAccountCreditStatement = accountStatementBuilder.SetAccountStatement(
maamAccount,
maamPaymentCredit,
0,
TransactionType.CouponVatCredit,
DateTime.Now,
currencyRetriever.GetCurrent());
accountStatements.Add(maamAccountCreditStatement);
createCouponVm.MaamAccountBalance = maamAccount.GetPointerObject<UserAdminData>("adminData").Balance;
if (teacherAccountCreditStatement != null)
{
teacherAccountCreditStatement.IncludingVat = maam;
}
}
if (maamFromBalance > 0)
{
// add record for mamm balance account מעמ יתרות
var maamBalanceAccountCreditStatement = accountStatementBuilder.SetAccountStatement(
maamBalanceAccount,
maamFromBalance,
0,
TransactionType.CouponVatCredit,
DateTime.Now,
currencyRetriever.GetCurrent());
accountStatements.Add(maamBalanceAccountCreditStatement);
createCouponVm.MaamBalanceAccountBalance = maamBalanceAccount.GetPointerObject<UserAdminData>("adminData").Balance;
}
}
示例8: AgentCreditStatement
private void AgentCreditStatement(CreateCouponViewModel createCouponVm, IMyMentorRepository repository, ParseUser agentAccount, ParseUser teacher, ParseUser siteAccount, CommissionsDto globalCommissionsTable, AccountStatementBuilder accountStatementBuilder, List<AccountStatementDto> accountStatements, CurrencyRetriver currencyRetriever)
{
if (agentAccount == null)
{
//agent user not found ,send email
//var missingAgent = teacher.GetPointerObject<UserAdminData>("adminData").GetPointerObject<ParseUser>("agent");
SendErrorEmail(createCouponVm,MyMentorResources.couponErrAgentNotFound);
// Mailer.SendAgentNotFound(missingAgent.Username,teacher.Username,createCouponVm.EventId);
return;
}
var userAdminData = agentAccount.GetPointerObject<UserAdminData>("adminData");
var acpAgentCommission = userAdminData.AcpTeacherCommission == Global.NoCommission ?
globalCommissionsTable.AgentCommission :
userAdminData.AcpTeacherCommission;
var agentSugOsek = agentAccount.GetPointerObject<SugOsek>("sugOsek");
var agentGetVat = agentSugOsek.GetVat ? 1: 0;
var agentPayVat = agentSugOsek.PayVat ? 1 :0;
var teacherSugOsek = teacher.GetPointerObject<SugOsek>("sugOsek");
var teacherPayVat = teacherSugOsek.PayVat? 1: 0;
var maamFlag = teacherPayVat == agentGetVat ? 0 : 1;
var teachertCurrency = teacher.GetPointerObject<Currency>("currency").ConvertToCurrencyDto();
var agentCurrency = agentAccount.GetPointerObject<Currency>("currency").ConvertToCurrencyDto();
var emlatHamaraFlag = agentCurrency.ObjectId != teachertCurrency.ObjectId;
var conversionCommission = globalCommissionsTable.ConversionCommission;
var maam = globalCommissionsTable.Maam;
var gapToPay = createCouponVm.TeacherData.GapToPay;
var totalCommission = (gapToPay + (maamFlag * ((-gapToPay/(100 +maam)* maam * teacherPayVat)+(gapToPay*maam/100 *agentGetVat)))) * acpAgentCommission;
var agentIncludingVat = agentSugOsek.GetVat ? maam : 0;
double emlatHamara;
// זיכוי סוכן
var agentCreditAccountStatement = accountStatementBuilder.SetAccountStatement(
agentAccount,
totalCommission,
0,
TransactionType.CouponAgentCommission,
DateTime.Now,
currencyRetriever.GetCurrent(),
includingVAT: agentIncludingVat);
accountStatements.Add(agentCreditAccountStatement);
createCouponVm.AgentBalance = agentAccount.GetPointerObject<UserAdminData>("adminData").Balance;
// חיוב סוכן בעמלת המרה
if (emlatHamaraFlag)
{
emlatHamara = totalCommission*conversionCommission;
var agentDebitAccountStatement = accountStatementBuilder.SetAccountStatement(
agentAccount,
0,
emlatHamara,
TransactionType.CouponAgentExCommission,
DateTime.Now,
currencyRetriever.GetCurrent(),
includingVAT: agentIncludingVat);
accountStatements.Add(agentDebitAccountStatement);
createCouponVm.AgentBalance = agentAccount.GetPointerObject<UserAdminData>("adminData").Balance;
}
//חיוב האתר בעמלת הסוכן
maamFlag = 0 == teacherPayVat ? 0 : 1;
totalCommission = (gapToPay + (maamFlag * ((-gapToPay / (100 + maam) * maam * teacherPayVat) + (gapToPay * maam / 100 * 0)))) * acpAgentCommission;
var siteAccountDebitStatement = accountStatementBuilder.SetAccountStatement(
siteAccount,
0,
totalCommission,
TransactionType.CouponAgentCommission,
DateTime.Now,
currencyRetriever.GetCurrent());
accountStatements.Add(siteAccountDebitStatement);
createCouponVm.SiteAccountBalance = siteAccount.GetPointerObject<UserAdminData>("adminData").Balance;
if (emlatHamaraFlag)
{
//זיכוי האתר בעמלת המרה של הסוכן
emlatHamara = totalCommission*conversionCommission;
siteAccountDebitStatement = accountStatementBuilder.SetAccountStatement(
siteAccount,
emlatHamara,
0,
TransactionType.CouponAgentExCommission,
DateTime.Now,
currencyRetriever.GetCurrent());
accountStatements.Add(siteAccountDebitStatement);
createCouponVm.SiteAccountBalance = siteAccount.GetPointerObject<UserAdminData>("adminData").Balance; ;
}
}