本文整理汇总了C#中Bobs.Usr类的典型用法代码示例。如果您正苦于以下问题:C# Usr类的具体用法?C# Usr怎么用?C# Usr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Usr类属于Bobs命名空间,在下文中一共展示了Usr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TestThatNamespaceCacheKeysAreInvalidatedBySqlCommands
public void TestThatNamespaceCacheKeysAreInvalidatedBySqlCommands()
{
Caching.Instances.Main.FlushAll();
Usr u1 = new Usr()
{
NickName= Guid.NewGuid().ToString(),
Email = Guid.NewGuid().ToString()
};
u1.Update();
Usr u2 = new Usr()
{
NickName = Guid.NewGuid().ToString(),
Email = Guid.NewGuid().ToString()
};
u1.Update();
u2.Update();
Assert.IsNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u1.K)));
Assert.IsNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u2.K)));
Banner b = new Banner() { UsrK = u1.K };
b.Update();
Assert.IsNotNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u1.K)));
Assert.IsNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u2.K)));
b.UsrK= u2.K;
b.Update();
Assert.IsNotNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u1.K)));
Assert.IsNotNull(Caching.Instances.Main.Get(Caching.CacheKeys.Usr.Banners(u2.K)));
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:30,代码来源:NamespacedCacheKeyTests.cs
示例2: AddAsBuddy
public void AddAsBuddy(Usr currentUsr, List<int> buddyUsrKs)
{
foreach (int buddyUsrK in buddyUsrKs)
{
currentUsr.AddBuddy(new Usr(buddyUsrK), Usr.AddBuddySource.BuddyImporter, Buddy.BuddyFindingMethod.EmailAddress, null);
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:7,代码来源:BuddyImporterService.cs
示例3: uiLookupUserButton_Click
void uiLookupUserButton_Click(object sender, EventArgs e)
{
//string PromoterRefNumeric = rNumbers.Replace(PromoterRef.Text.Trim(), "");
//try
//{
Usr u = new Usr(int.Parse(this.uiUserAutoComplete.Value));
if (u.IsPromoter)
{
Response.Redirect(u.UrlApp("promoters"));
}
else
{
this.uiUserIsNotPromoterPanel.Visible = true;
}
//else if (u.IsSkeleton)
//{
// NoPromoterAccounts.Visible = false;
// NotFoundLabel.Visible = true;
//}
//else
//{
// NotFoundLabel.Visible = false;
// NoPromoterAccounts.InnerHtml = u.Link() + " is not in any promoter accounts";
// NoPromoterAccounts.Visible = true;
//}
//}
//catch
//{
// NoPromoterAccounts.Visible = false;
// NotFoundLabel.Visible = true;
//}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:33,代码来源:SalesFind.ascx.cs
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!Usr.Current.IsAdmin)
throw new Exception("");
Usr u = new Usr(ContainerPage.Url["UsrK"]);
u.DeleteProfilePic();
Mailer sm = new Mailer();
sm.UsrRecipient = u;
sm.TemplateType = Mailer.TemplateTypes.AnotherSiteUser;
sm.Body = "<p>Your profile photo has been deleted</p>";
sm.Body += "<p>This could have been for one of several reasons:</p>";
sm.Body += "<ul>";
sm.Body += "<li>Profile pictures <b>MUST BE OF YOUR FACE</b>.</li>";
sm.Body += "<li>Profile pictures must show your face clearly - make sure you <b>ZOOM IN</b>.</li>";
sm.Body += "<li>The face must match your sex";
if (u.IsMale || u.IsFemale)
sm.Body += " (you currently have <b>" + (u.IsMale ? "MALE" : "FEMALE") + "</b> selected as your sex)";
sm.Body += " - see the <a href=\"[LOGIN(/pages/mydetails)]\">My details</a> page to change your selected sex.</li>";
sm.Body += "</ul>";
sm.Body += "<p>You can create a new profile picture on the <a href=\"[LOGIN(/pages/mypicture)]\">Create my picture</a> page.</p>";
sm.Subject = "Your DontStayIn profile photo has been deleted";
sm.RedirectUrl = "/pages/mypicture";
sm.Send();
Response.Redirect(u.Url());
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:27,代码来源:DeletePic.ascx.cs
示例5: DaveIgnore
public void DaveIgnore(object o, System.EventArgs e)
{
Usr Dave = new Usr(4);
Cambro.Web.Helpers.WriteAlertHeader();
Cambro.Web.Helpers.WriteAlert("Selecting...", 1);
Query q = new Query();
if (Vars.DevEnv)
q.TopRecords = 50;
PromoterSet bs = new PromoterSet(q);
for (int count = 0; count < bs.Count; count++)
{
Promoter p = bs[count];
// Do work here!
try
{
Thread t = new Thread(p.QuestionsThreadK);
ThreadUsr tu = t.GetThreadUsr(Dave);
tu.ChangeStatus(ThreadUsr.StatusEnum.Ignore, DateTime.Now, true, true);
if (count % 100 == 0)
Cambro.Web.Helpers.WriteAlert("Done " + count + "/" + bs.Count + " - " + p.UrlName, 2);
}
catch
{
Cambro.Web.Helpers.WriteAlert("Done " + count + "/" + bs.Count + " - EXCEPTION! " + p.UrlName, 3);
}
bs.Kill(count);
}
Cambro.Web.Helpers.WriteAlert("Done!", 4);
Cambro.Web.Helpers.WriteAlertFooter("/admin/promoterpm");
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:35,代码来源:PromoterPm.ascx.cs
示例6: InviteContacts
public void InviteContacts(Usr currentUsr, List<Contact> contacts)
{
foreach (Contact c in contacts)
{
Usr u = Usr.GetOrCreateSkeletonUser(currentUsr, c.Email, "", null, "", true, true);
currentUsr.AddBuddy(u, true, true, Usr.AddBuddySource.BuddyImporter, Buddy.BuddyFindingMethod.EmailAddress, c.Name);
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:8,代码来源:BuddyImporterService.cs
示例7: AddUsr
public void AddUsr(Usr u)
{
if (u != null)
{
Items.Add(new ListItem(u.NickName, u.K.ToString()));
ItemsPlain.Add(new ListItem(u.NickName, u.K + "$" + u.Pic.ToString().ToUpper()));
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:8,代码来源:.!45226!MultiUsr.ascx.cs
示例8: AddTag
public static Tag AddTag(string tagText, Tagging.ITaggable objectToTag, Usr usrAddingTag)
{
try
{
Transaction t = new Transaction();
try
{
Tag tag = Tag.GetTag(tagText);
if (tag.Blocked)
{
throw new InvalidTagException();
}
TagPhoto tagPhoto = TagPhoto.GetTagPhoto(tag.K, objectToTag.K);
TagPhotoHistory.TagPhotoHistoryAction action = TagPhotoHistory.TagPhotoHistoryAction.Created;
if (tagPhoto == null)
{
tagPhoto = new TagPhoto()
{
TagK = tag.K,
PhotoK = objectToTag.K,
Disabled = false
};
tagPhoto.Update(t);
action = TagPhotoHistory.TagPhotoHistoryAction.Created;
}
if (tagPhoto.Disabled)
{
if (!usrAddingTag.IsJunior)
{
throw new Exception("You do not have rights to re-enable that tag");
}
tagPhoto.Disabled = false;
tagPhoto.Update(t);
action = TagPhotoHistory.TagPhotoHistoryAction.Enabled;
}
TagPhotoHistory history = new TagPhotoHistory()
{
DateTime = DateTime.Now,
Action = action,
UsrK = usrAddingTag.K,
TagPhotoK = tagPhoto.K
};
history.Update(t);
t.Commit();
return tag;
}
catch (Exception ex)
{
t.Rollback();
throw ex;
}
}
catch (InvalidTagException)
{
return null;
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:58,代码来源:Tag.cs
示例9: GetUsrPhotosPagedDataService
public static IPagedDataService<Photo> GetUsrPhotosPagedDataService(Usr usr)
{
var orderBy = new []
{
new KeyValuePair<object, OrderBy.OrderDirection>(Photo.Columns.DateTime, OrderBy.OrderDirection.Descending),
new KeyValuePair<object, OrderBy.OrderDirection>(Photo.Columns.K, OrderBy.OrderDirection.Descending)
};
return usr.ChildFavouritePhotos(orderBy);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:9,代码来源:UsrFavouritePhotosController.cs
示例10: TestDeletesRemoveBobsFromCache
public void TestDeletesRemoveBobsFromCache()
{
Usr usr = new Usr();
usr.Update();
UsrTableDef def = new UsrTableDef();
Caching.Instances.Main.Set(new Caching.CacheKeys.BobCacheKey("Usr", usr.K, def.TableCacheKey), Guid.NewGuid().ToString());
Assert.IsNotNull(Caching.Instances.Main.Get(new Caching.CacheKeys.BobCacheKey("Usr", usr.K, def.TableCacheKey)));
usr.Delete();
Assert.IsNull(Caching.Instances.Main.Get(new Caching.CacheKeys.BobCacheKey("Usr", usr.K, def.TableCacheKey)));
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:10,代码来源:TriggerTests.cs
示例11: DeleteNow
public void DeleteNow(object o, System.EventArgs e)
{
Usr c = new Usr(int.Parse(ObjectKTextBox.Text));
if (!c.Banned)
throw new DsiUserFriendlyException("User should be banned first!");
c.StripAll();
DoneLabel.Visible = true;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:10,代码来源:StripUsr.ascx.cs
示例12: Delete_RemoveUsr1ThenLoadUsr1_BobNotFoundThrown
public void Delete_RemoveUsr1ThenLoadUsr1_BobNotFoundThrown()
{
SetupCacheForTesting();
Usr usr = new Usr();
usr.Update();
int k = usr.K;
usr.Delete();
usr = new Usr(k);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:11,代码来源:UsrTests.cs
示例13: Change
protected void Change(object sender, EventArgs e)
{
Usr u = new Usr(int.Parse(UsrK.Text));
if (!u.IsAdmin)
{
u.SetPassword(UsrPassword.Text, true);
OutLabel.Text = "Done.";
}
else
OutLabel.Text = "Can't change an admin password on this page.";
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:11,代码来源:ChangePassword.ascx.cs
示例14: DeleteNow
public void DeleteNow(object o, System.EventArgs e)
{
if (ObjectTypeDropDown.SelectedValue.Equals("Photo"))
{
Photo c = new Photo(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Gallery"))
{
Gallery c = new Gallery(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Venue"))
{
Venue c = new Venue(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Event"))
{
Event c = new Event(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Comment"))
{
Comment c = new Comment(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Thread"))
{
Thread c = new Thread(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Usr"))
{
Usr c = new Usr(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
else if (ObjectTypeDropDown.SelectedValue.Equals("Article"))
{
Article c = new Article(int.Parse(ObjectKTextBox.Text));
SendEmail(c);
Delete.DeleteAll(c);
}
DoneLabel.Visible = true;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:52,代码来源:MultiDelete.ascx.cs
示例15: MakePayment
public void MakePayment(List<InvoiceDataHolder> invoices, decimal amount, Usr usr, int promoterK, int actionUsrK, string cardFullName, string cardAddressStreet, string cardAddressArea, string cardAddressTown, string cardAddressCounty, int cardAddressCountryK, string cardAddressPostCode, string cardAddressCountry, string cardNumber, DateTime cardExpiryDate, string cardCV2, Transfer.FraudCheckEnum fraudCheckEnum, bool saveCard, Guid duplicateGuid, DateTime cardStartDate, string cardIssueNumber)
{
this.amount = Math.Round(amount, 2);
if (this.amount <= 0)
{
throw new Exception("Cannot make a payment for " + this.amount.ToString("c") + ". It must be a positive amount.");
}
else
{
this.cardNumber = cardNumber.Trim().Replace(" ", "");
this.cardAddressCountry = cardAddressCountry.Trim();
this.fraudCheckEnum = fraudCheckEnum;
this.invoiceDataHolders = invoices;
this.transfer.Guid = Guid.NewGuid();
this.transfer.DuplicateGuid = duplicateGuid;
this.transfer.Amount = this.amount;
this.transfer.Type = Transfer.TransferTypes.Payment;
this.transfer.Method = Transfer.Methods.Card;
this.transfer.Company = Model.Entities.Transfer.CompanyEnum.DH;
this.transfer.CardAddress1 = cardAddressStreet.Trim();
this.transfer.CardAddressArea = cardAddressArea;
this.transfer.CardAddressCounty = cardAddressCounty;
this.transfer.CardAddressTown = cardAddressTown;
this.transfer.CardAddressCountryK = cardAddressCountryK;
this.transfer.CardPostcode = cardAddressPostCode.Trim();
this.transfer.CardName = cardFullName.Trim();
this.transfer.CardCV2 = cardCV2.Trim();
this.transfer.CardExpires = cardExpiryDate;
this.transfer.CardStart = cardStartDate;
if (cardIssueNumber.Length > 0)
this.transfer.CardIssue = Convert.ToInt32(cardIssueNumber);
this.transfer.SetUsrAndActionUsr(usr);
this.transfer.DateTimeCreated = DateTime.Now;
this.transfer.PromoterK = promoterK;
this.usr = usr;
this.transfer.StoreCardEndAndHashAndCardType(this.cardNumber);
ValidateMinimumDetails();
try
{
response = secVpnService.validateCardFull(
userName,
password,
transfer.Guid.ToString(), // DSI created SecPay Transaction Id "tran0001"
ipAddress, // Credit Card user IP address "127.0.0.1"
cardFullName, // User Name "Mr Cardholder"
cardNumber, // User card number "4444333322221111"
开发者ID:davelondon,项目名称:dontstayin,代码行数:49,代码来源:.!43230!SecPay.cs
示例16: User
public Usr User(int k)
{
if (userK == null)
userK = new Dictionary<int, Usr>();
try
{
if (!userK.ContainsKey(k))
userK[k] = new Usr(k);
}
catch
{
return new Usr(4);
}
return userK[k];
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:15,代码来源:Contact.ascx.cs
示例17: GetUsrPhotosPagedDataService
public static IPagedDataService<Photo> GetUsrPhotosPagedDataService(Usr usr, int spottedByUsrK)
{
var orderBy = new []
{
new KeyValuePair<object, OrderBy.OrderDirection>(Photo.Columns.DateTime, OrderBy.OrderDirection.Descending) ,
new KeyValuePair<object, OrderBy.OrderDirection>(Photo.Columns.K, OrderBy.OrderDirection.Descending)
};
if (spottedByUsrK > 0)
{
return usr.ChildPhotosOfMe(new Q(Photo.Columns.UsrK, spottedByUsrK), orderBy);
}
else
{
return usr.ChildPhotosOfMe(orderBy);
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:16,代码来源:UsrPhotosController.cs
示例18: NickNameCachingIsWorking
public void NickNameCachingIsWorking()
{
SetupCacheForTesting();
Usr usr1 = new Usr(1);
UnitTestUtilities.Sql.SqlTrace trace = new UnitTestUtilities.Sql.SqlTrace(Common.Properties.ConnectionString);
trace.Start();
Usr usrGotWithoutCachedNickname = Usr.GetFromNickName(usr1.NickName);
trace.Stop();
Assert.AreNotEqual(0, trace.TotalReads);
trace.ClearData();
trace.Start();
Usr usrGotWithCachedNickname = Usr.GetFromNickName(usr1.NickName);
trace.Stop();
Assert.AreEqual(0, trace.TotalReads);
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:16,代码来源:UsrTests.cs
示例19: Page_Init
private void Page_Init(object sender, System.EventArgs e)
{
if (Usr.Current == null)
{
Usr u = new Usr(ContainerPage.Url["UsrK"]);
if (u.LoginString.ToLower() != ContainerPage.Url["LoginString"].ToString().ToLower())
{
Usr.KickUserIfNotLoggedIn("You must be logged in to view your user preferences.");
}
else
{
CurrentUsr = u;
}
}
else
CurrentUsr = Usr.Current;
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:17,代码来源:Unsubscribe.ascx.cs
示例20: CountUsrs_PlaceConditions_NotIncludingIfUsrHasBeenToEventInTown
public void CountUsrs_PlaceConditions_NotIncludingIfUsrHasBeenToEventInTown()
{
new Delete(TablesEnum.Usr, new Q(true)).Run();
Random r = new Random();
List<int> placeKs = new List<int>() { 1, 2, 3, 4 };
List<int> notPlaceKs = new List<int>() { 5, 6, 7, 8, 9, 10, 11 };
int usrsToCreate = 15;
int usrs = 0;
usrsToCreate.Times(() =>
{
Usr u = new Usr()
{
Email = Guid.NewGuid().ToString(),
IsSkeleton = false,
IsEmailVerified = true,
SendFlyers = true
};
u.Update();
int i = r.Next(placeKs.Count + notPlaceKs.Count);
int placeK;
if (i < placeKs.Count)
{
usrs++;
placeK = placeKs[i];
}
else
{
placeK = notPlaceKs[i - placeKs.Count];
}
UsrPlaceVisit up = new UsrPlaceVisit()
{
UsrK = u.K,
PlaceK = placeK
};
up.Update();
});
Assert.AreEqual(usrs, Flyer.CountUsrs(placeKs, new List<int>(), false));
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:42,代码来源:Flyer_Tests.cs
注:本文中的Bobs.Usr类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论