本文整理汇总了C#中Campaign类的典型用法代码示例。如果您正苦于以下问题:C# Campaign类的具体用法?C# Campaign怎么用?C# Campaign使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Campaign类属于命名空间,在下文中一共展示了Campaign类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ShowCampaignTable
/// <summary>
/// select the table to show from the db and build the table in the page
/// </summary>
protected void ShowCampaignTable()
{
Campaign cam = new Campaign();
List<Campaign> campaigns = cam.GetCampaignList(email);
foreach (Campaign c in campaigns)
{
HtmlTableRow tr = new HtmlTableRow();
HtmlTableCell tc = new HtmlTableCell();
HtmlTableCell tc1 = new HtmlTableCell();
HtmlTableCell tc2 = new HtmlTableCell();
HtmlTableCell tc3 = new HtmlTableCell();
HtmlTableCell tc4 = new HtmlTableCell();
HtmlTableCell tc5 = new HtmlTableCell();
tc.InnerHtml = c.Name;
tc1.InnerHtml = c.DateCreated.ToString();
tc2.InnerHtml = c.Id.ToString();
tc3.InnerHtml = c.Voucher;
tc4.InnerHtml = c.ShareCount.ToString();
if (c.IsActive == true)
tc5.InnerHtml = "פעיל";
else
tc5.InnerHtml = "לא פעיל";
tr.Cells.Add(tc);
tr.Cells.Add(tc1);
tr.Cells.Add(tc2);
tr.Cells.Add(tc3);
tr.Cells.Add(tc4);
tr.Cells.Add(tc5);
campaignsData.Controls.Add(tr);
}
}
开发者ID:kerenmishael,项目名称:BusinessRealityFinalProject,代码行数:36,代码来源:Campaign.aspx.cs
示例2: SpriteSheet
/// <summary>
/// Initializes a new instance of the <see cref="SpriteSheet"/> class.
/// </summary>
/// <param name="campaign">The campaign this sprite sheet belongs to.</param>
/// <param name="sheetID">The ID of the sprite sheet.</param>
/// <param name="rows">The amount of rows in the sprite sheet.</param>
/// <param name="columns">The amount of columns in the sprite sheet.</param>
public SpriteSheet(Campaign campaign, string sheetID, int rows, int columns)
{
this.campaign = campaign;
this.SheetID = sheetID;
this.Rows = rows;
this.Columns = columns;
}
开发者ID:robertkety,项目名称:Hero6,代码行数:14,代码来源:SpriteSheet.cs
示例3: createCampaignBlock
public static void createCampaignBlock(Campaign campaign, int i, Transform parentTransform, Transform Block, SubRingDiskController subRingDiskCtrl)
{
Vector3 setRotation = parentTransform.rotation.eulerAngles;
setRotation.x = -90.0f;
float posX = (i < 1) ? 1.29f : 1.29f + (i * (1.29f * 0.14f));
float posY = 0f;
Transform currentBlock = (Transform)Instantiate(Block, new Vector3(0, 0, 0), Quaternion.identity);
currentBlock.SetParent(parentTransform);
currentBlock.localScale = new Vector3(0.5f, 0.5f, 0.5f);
currentBlock.rotation = Quaternion.Euler(setRotation);
currentBlock.localPosition = new Vector3(posX, posY, 0f);
//get an instance of the component.
Transform blockInstance = currentBlock.GetComponent<Transform>();
BlockController blockController = blockInstance.GetComponent<BlockController>();
blockController.speed = campaign.Priority;
blockController.order = i;
blockController.objectId = campaign.Id;
blockController.objectName = campaign.Name;
blockController.objectType = "Campaign";
blockController.labels = new string[]{"Type", "Status", "Start Date", "End Date", "Total Leads"};
blockController.fields = new string[]{campaign.Type, campaign.Status, campaign.StartDate, campaign.EndDate, "" + campaign.NumberOfLeads + ""};
blockController.description = campaign.Description;
blockController.parentSubRingDiskController = subRingDiskCtrl;
blockController.setText ("Campaign");
}
开发者ID:CodeScience,项目名称:VRpportunity,代码行数:31,代码来源:SubObjectUtil.cs
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
loggedInAdmin = Helpers.GetLoggedInAdmin();
currentCompany = Helpers.GetCurrentCompany();
currentCampaign = Helpers.GetCurrentCampaign();
if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, currentCompany))
{
Response.Redirect("/status.aspx?error=notadmin");
}
PopuplateBreadcrumbs();
CancelHyperLink.NavigateUrl = "/manage/Campaigns/ManageCampaign.aspx?campaign_id=" + currentCampaign.campaign_id;
if (!IsPostBack)
{
TitleTextBox.Text = currentCampaign.title;
NotesTextBox.Text = currentCampaign.notes;
StartDateTextBox.Text = currentCampaign.start_datetime.ToShortDateString();
EndDateTextBox.Text = currentCampaign.end_datetime.ToShortDateString();
}
}
开发者ID:vamsimg,项目名称:DocketPlaceWeb,代码行数:26,代码来源:UpdateCampaign.aspx.cs
示例5: DeleteCampaign
/// <summary>
/// Deleted a queued email
/// </summary>
/// <param name="campaign">Campaign</param>
public virtual void DeleteCampaign(Campaign campaign)
{
if (campaign == null)
throw new ArgumentNullException("campaign");
_campaignRepository.Delete(campaign);
}
开发者ID:khiemnd777,项目名称:aaron-core,代码行数:11,代码来源:CampaignService.cs
示例6: Create
public ActionResult Create([DataSourceRequest] DataSourceRequest request,CampaignVM viewModel)
{
try
{
if (viewModel != null && ModelState.IsValid)
{
Campaign newviewModel = new Campaign();
newviewModel.EndDate = viewModel.EndDate;
newviewModel.Name = viewModel.Name;
newviewModel.StartDate = viewModel.StartDate;
newviewModel.SystemRuleSystemRuleId = viewModel.SystemId;
newviewModel.UserUserId = viewModel.GameMasterId;
newviewModel.Description = viewModel.Description;
db.Campaigns.Add(newviewModel);
db.SaveChanges();
viewModel.CampaignId = newviewModel.CampaignId;
viewModel.System = db.SystemRules.Find(viewModel.SystemId).SystemName;
viewModel.GameMaster = db.Users.Find(viewModel.GameMasterId).Name;
}
}
catch (DataException dataEx)
{
ModelState.AddModelError(string.Empty, "Data error");
Elmah.ErrorSignal.FromCurrentContext().Raise(dataEx);
}
return Json(new[] { viewModel }.ToDataSourceResult(request, ModelState));
}
开发者ID:HansLeuschner,项目名称:SU,代码行数:30,代码来源:CampaignController.cs
示例7: Run
/// <summary>
/// Runs the code example.
/// </summary>
/// <param name="user">The AdWords user.</param>
/// <param name="campaignId">Id of the campaign to be updated.</param>
public void Run(AdWordsUser user, long campaignId)
{
// Get the CampaignService.
CampaignService campaignService =
(CampaignService)user.GetService(AdWordsService.v201601.CampaignService);
// Create the campaign.
Campaign campaign = new Campaign();
campaign.id = campaignId;
campaign.status = CampaignStatus.PAUSED;
// Create the operation.
CampaignOperation operation = new CampaignOperation();
[email protected] = Operator.SET;
operation.operand = campaign;
try {
// Update the campaign.
CampaignReturnValue retVal = campaignService.mutate((new CampaignOperation[] {operation}));
// Display the results.
if (retVal != null && retVal.value != null && retVal.value.Length > 0) {
Campaign updatedCampaign = retVal.value[0];
Console.WriteLine("Campaign with name = '{0}' and id = '{1}' was updated.",
updatedCampaign.name, updatedCampaign.id);
} else {
Console.WriteLine("No campaigns were updated.");
}
} catch (Exception e) {
throw new System.ApplicationException("Failed to update campaign.", e);
}
}
开发者ID:jimper,项目名称:googleads-dotnet-lib,代码行数:37,代码来源:UpdateCampaign.cs
示例8: add
public HttpResponseMessage add(Campaign post)
{
// Check for errors
if (post == null)
{
return Request.CreateResponse<string>(HttpStatusCode.BadRequest, "The post is null");
}
else if (Language.MasterPostExists(post.language_id) == false)
{
return Request.CreateResponse<string>(HttpStatusCode.BadRequest, "The language does not exist");
}
// Make sure that the data is valid
post.name = AnnytabDataValidation.TruncateString(post.name, 50);
post.category_name = AnnytabDataValidation.TruncateString(post.category_name, 50);
post.image_name = AnnytabDataValidation.TruncateString(post.image_name, 100);
post.link_url = AnnytabDataValidation.TruncateString(post.link_url, 200);
// Add the post
Campaign.Add(post);
// Return the success response
return Request.CreateResponse<string>(HttpStatusCode.OK, "The post has been added");
} // End of the add method
开发者ID:raphaelivo,项目名称:a-webshop,代码行数:25,代码来源:campaignsController.cs
示例9: update
public HttpResponseMessage update(Campaign post)
{
// Check for errors
if (post == null)
{
return Request.CreateResponse<string>(HttpStatusCode.BadRequest, "The post is null");
}
else if (Language.MasterPostExists(post.language_id) == false)
{
return Request.CreateResponse<string>(HttpStatusCode.BadRequest, "The language does not exist");
}
// Make sure that the data is valid
post.name = AnnytabDataValidation.TruncateString(post.name, 50);
post.category_name = AnnytabDataValidation.TruncateString(post.category_name, 50);
post.image_name = AnnytabDataValidation.TruncateString(post.image_name, 100);
post.link_url = AnnytabDataValidation.TruncateString(post.link_url, 200);
// Get the saved post
Campaign savedPost = Campaign.GetOneById(post.id);
// Check if the post exists
if (savedPost == null)
{
return Request.CreateResponse<string>(HttpStatusCode.BadRequest, "The record does not exist");
}
// Update the post
Campaign.Update(post);
// Return the success response
return Request.CreateResponse<string>(HttpStatusCode.OK, "The update was successful");
} // End of the update method
开发者ID:raphaelivo,项目名称:a-webshop,代码行数:34,代码来源:campaignsController.cs
示例10: Run
/// <summary>
/// Run the code example.
/// </summary>
/// <param name="service">An initialized Dfa Reporting service object
/// </param>
public override void Run(DfareportingService service)
{
long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE"));
long profileId = long.Parse(_T("INSERT_USER_PROFILE_ID_HERE"));
String campaignName = _T("INSERT_CAMPAIGN_NAME_HERE");
String landingPageName = _T("INSERT_LANDING_PAGE_NAME_HERE");
String url = _T("INSERT_LANDING_PAGE_URL_HERE");
// Create the campaign structure.
Campaign campaign = new Campaign();
campaign.Name = campaignName;
campaign.AdvertiserId = advertiserId;
campaign.Archived = false;
// Set the campaign start date. This example uses today's date.
campaign.StartDate =
DfaReportingDateConverterUtil.convertToDateString(DateTime.Now);
// Set the campaign end date. This example uses one month from today's date.
campaign.EndDate =
DfaReportingDateConverterUtil.convertToDateString(DateTime.Now.AddMonths(1));
// Insert the campaign.
Campaign result =
service.Campaigns.Insert(campaign, profileId, landingPageName, url).Execute();
// Display the new campaign ID.
Console.WriteLine("Campaign with ID {0} was created.", result.Id);
}
开发者ID:tsidell,项目名称:googleads-dfa-reporting-samples,代码行数:35,代码来源:CreateCampaign.cs
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
loggedInAdmin = Helpers.GetLoggedInAdmin();
currentCompany = Helpers.GetCurrentCompany();
currentAdGroup = Helpers.GetCurrentAdGroup();
currentCampaign = currentAdGroup.campaign_;
if (!Helpers.IsAuthorizedAdmin(loggedInAdmin, currentAdGroup.campaign_.company_))
{
Response.Redirect("/status.aspx?error=notadmin");
}
PopuplateBreadcrumbs();
if (!IsPostBack)
{
UpdateAdGroupHyperLink.NavigateUrl = "/manage/AdGroups/UpdateAdGroupDetails.aspx?adgroup_id=" + currentAdGroup.adgroup_id;
CreateAdMatchesHyperLink.NavigateUrl = "/manage/AdMatches/CreateAdMatches.aspx?adgroup_id=" + currentAdGroup.adgroup_id;
}
PopulateDetails();
ShowAdMatches(currentAdGroup);
}
开发者ID:vamsimg,项目名称:DocketPlaceWeb,代码行数:27,代码来源:ManageAdGroup.aspx.cs
示例12: Run
/// <summary>
/// Runs the code example.
/// </summary>
/// <param name="user">The AdWords user.</param>
/// <param name="campaignId">Id of the campaign to be removed.</param>
public void Run(AdWordsUser user, long campaignId) {
// Get the CampaignService.
CampaignService campaignService = (CampaignService) user.GetService(
AdWordsService.v201509.CampaignService);
// Create campaign with REMOVED status.
Campaign campaign = new Campaign();
campaign.id = campaignId;
campaign.status = CampaignStatus.REMOVED;
// Create the operation.
CampaignOperation operation = new CampaignOperation();
operation.operand = campaign;
[email protected] = Operator.SET;
try {
// Remove the campaign.
CampaignReturnValue retVal = campaignService.mutate(new CampaignOperation[] {operation});
// Display the results.
if (retVal != null && retVal.value != null && retVal.value.Length > 0) {
Campaign removedCampaign = retVal.value[0];
Console.WriteLine("Campaign with id = \"{0}\" was renamed to \"{1}\" and removed.",
removedCampaign.id, removedCampaign.name);
} else {
Console.WriteLine("No campaigns were removed.");
}
} catch (Exception e) {
throw new System.ApplicationException("Failed to remove campaign.", e);
}
}
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:36,代码来源:RemoveCampaign.cs
示例13: BtnCreate_Click
protected void BtnCreate_Click( object sender, EventArgs e )
{
if ( Page.IsValid ) {
Campaign campaign = new Campaign( StoreId, TxtName.Text );
campaign.Save();
Redirect( WebUtils.GetPageUrl( Constants.Pages.EditCampaign ) + "?id=" + campaign.Id + "&storeId=" + campaign.StoreId );
}
}
开发者ID:uniquelau,项目名称:Tea-Commerce-for-Umbraco,代码行数:8,代码来源:CreateCampaign.ascx.cs
示例14: SetUp
public void SetUp()
{
repository = new FakeCampaignRepository();
//((FakeCampaignRepository)repository).SetUpRepository();
campaign = EntityHelpers.GetValidCampaign();
causeTemplate = EntityHelpers.GetValidCauseTemplate();
campaign.CauseTemplate = causeTemplate;
}
开发者ID:JordanRift,项目名称:Grassroots,代码行数:9,代码来源:CampaignTests.cs
示例15: getCampaignById
public Campaign getCampaignById(int id) {
Campaign campaign = new Campaign();
HttpResponseMessage httpResponseMessage = this.httpGet($"{this.getAPIUri()}/campaign/{id}");
if (httpResponseMessage.IsSuccessStatusCode) {
campaign = JsonConvert.DeserializeObject<Campaign>(httpResponseMessage.Content.ReadAsStringAsync().Result);
}
return campaign;
}
开发者ID:universal11,项目名称:CampaignReactorClient,代码行数:10,代码来源:CampaignReactorClient.cs
示例16: Any
public object Any(Hello request)
{
//Issue 1
//This now fails.
var campaign = new Campaign();
campaign.TrackingId = 0;
campaign.CampaignPhone = "none";
campaign.CostAmount = 0M;
campaign.EndDate = 0L;
campaign.StartDate = SystemClock.Instance.Now.Ticks / NodaConstants.TicksPerMillisecond;
campaign.FixedCost = 0M;
campaign.IsActive = true;
campaign.IsRetread = true;
campaign.IsFactorTrustApp = true;
campaign.IsFactorTrustLeads = true;
campaign.IsDuplicate = true;
campaign.IsEmail = true;
campaign.MasterId = 0;
campaign.IsFirmOffer = false;
campaign.LeadDelCostTypeId = 0;
campaign.LeadDelRespTypeId = 0;
campaign.LeadDelTypeId = 0;
campaign.LeadRoutingTypeId = 0;
campaign.Name = "Exception Campaign";
campaign.IsExceptionCampaign = true;
campaign.IsDefaultCampaign = false;
campaign.IsActive = true;
var rowId = Db.Insert(campaign, true);
//Issue 2
// This is also broken
/* var campaigns = Db.Dictionary<int, string>(Db.
From<Campaign>().
Select(x => new { x.Id, x.Name }).
Where(x => x.IsActive));*/
// but yet, this works
/*var campaigns = Db.Dictionary<int, string>("select id, name from campaign where isactive = 1");*/
return new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name) };
}
开发者ID:stephenpatten,项目名称:SSORM4.0.43OracleRepo,代码行数:52,代码来源:MyServices.cs
示例17: Get
public static IQueryable<Campaign> Get(List<Guid> provinceIDList, DateTime? from, DateTime? to, Campaign.TypeX type)
{
RedBloodDataContext db = new RedBloodDataContext();
if (provinceIDList == null || provinceIDList.Count == 0) return null;
return db.Campaigns.Where(r => provinceIDList.Contains(r.CoopOrg.GeoID1.Value)
&& r.Type == type
&& r.Date != null
&& (from == null || r.Date.Value.Date >= from.Value.Date)
&& (to == null || r.Date.Value.Date <= to.Value.Date)
);
}
开发者ID:ghostnguyen,项目名称:redblood,代码行数:13,代码来源:CampaignBLL.cs
示例18: TestGetAllCampaignsMockAndCallServer
public void TestGetAllCampaignsMockAndCallServer()
{
ServiceSignature mockSignature = MockUtilities.RegisterMockService(user,
AdWordsService.v201601.CampaignService, typeof(MockCampaignServiceEx));
CampaignService campaignService = (CampaignService) user.GetService(mockSignature);
Assert.That(campaignService is MockCampaignServiceEx);
Campaign campaign = new Campaign();
campaign.name = "Interplanetary Cruise #" + new TestUtils().GetTimeStamp();
campaign.status = CampaignStatus.PAUSED;
campaign.biddingStrategyConfiguration = new BiddingStrategyConfiguration();
campaign.biddingStrategyConfiguration.biddingStrategyType = BiddingStrategyType.MANUAL_CPC;
Budget budget = new Budget();
budget.budgetId = budgetId;
campaign.budget = budget;
campaign.advertisingChannelType = AdvertisingChannelType.SEARCH;
// Set the campaign network options to GoogleSearch and SearchNetwork
// only. Set ContentNetwork, PartnerSearchNetwork and ContentContextual
// to false.
campaign.networkSetting = new NetworkSetting() {
targetGoogleSearch = true,
targetSearchNetwork = true,
targetContentNetwork = false,
targetPartnerSearchNetwork = false
};
// Create operations.
CampaignOperation operation = new CampaignOperation();
[email protected] = Operator.ADD;
operation.operand = campaign;
CampaignReturnValue retVal = null;
Assert.DoesNotThrow(delegate() {
retVal = campaignService.mutate((new CampaignOperation[] { operation }));
});
Assert.NotNull(retVal);
Assert.NotNull(retVal.value);
Assert.AreEqual(retVal.value.Length, 1);
Assert.AreEqual(retVal.value[0].name, campaign.name);
Assert.AreNotEqual(retVal.value[0].id, 0);
Assert.True((campaignService as MockCampaignServiceEx).MutateCalled);
}
开发者ID:jimper,项目名称:googleads-dotnet-lib,代码行数:49,代码来源:MockTests.cs
示例19: OutputCampaign
/// <summary>
/// Outputs the Campaign.
/// </summary>
protected void OutputCampaign(Campaign campaign)
{
if (campaign != null)
{
OutputStatusMessage(string.Format("BudgetType: {0}", campaign.BudgetType));
OutputStatusMessage(string.Format("CampaignType: {0}", campaign.CampaignType));
OutputStatusMessage(string.Format("DailyBudget: {0}", campaign.DailyBudget));
OutputStatusMessage(string.Format("Description: {0}", campaign.Description));
OutputStatusMessage("ForwardCompatibilityMap: ");
if (campaign.ForwardCompatibilityMap != null)
{
foreach (var pair in campaign.ForwardCompatibilityMap)
{
OutputStatusMessage(string.Format("Key: {0}", pair.Key));
OutputStatusMessage(string.Format("Value: {0}", pair.Value));
}
}
OutputStatusMessage(string.Format("Id: {0}", campaign.Id));
OutputStatusMessage(string.Format("MonthlyBudget: {0}", campaign.MonthlyBudget));
OutputStatusMessage(string.Format("Name: {0}", campaign.Name));
OutputStatusMessage("Settings: \n");
if (campaign.Settings != null)
{
foreach (var setting in campaign.Settings)
{
var shoppingSetting = setting as ShoppingSetting;
if (shoppingSetting != null)
{
OutputStatusMessage("ShoppingSetting: \n");
OutputStatusMessage(string.Format("Priority: {0}", shoppingSetting.Priority));
OutputStatusMessage(string.Format("SalesCountryCode: {0}", shoppingSetting.SalesCountryCode));
OutputStatusMessage(string.Format("StoreId: {0}", shoppingSetting.StoreId));
}
}
}
OutputStatusMessage(string.Format("Status: {0}", campaign.Status));
OutputStatusMessage(string.Format("TrackingUrlTemplate: {0}", campaign.TrackingUrlTemplate));
OutputStatusMessage("UrlCustomParameters: ");
if (campaign.UrlCustomParameters != null && campaign.UrlCustomParameters.Parameters != null)
{
foreach (var customParameter in campaign.UrlCustomParameters.Parameters)
{
OutputStatusMessage(string.Format("\tKey: {0}", customParameter.Key));
OutputStatusMessage(string.Format("\tValue: {0}", customParameter.Value));
}
}
OutputStatusMessage(string.Format("TimeZone: {0}", campaign.TimeZone));
}
}
开发者ID:moinahmed,项目名称:BingAds-dotNet-SDK,代码行数:52,代码来源:ExampleBase.cs
示例20: Room
/// <summary>
/// Initializes a new instance of the <see cref="Room"/> class.
/// </summary>
/// <param name="campaign">The campaign this item belongs to.</param>
/// <param name="backgroundID">The ID of the room background.</param>
/// <param name="walkAreaID">The ID of the room walk area.</param>
/// <param name="hotSpotMaskID">The ID of the room hot spot mask.</param>
protected Room(
Campaign campaign,
string backgroundID,
string walkAreaID,
string hotSpotMaskID)
: base(campaign)
{
this.pathfinder = new AStar(2500, (node, neighbor) => 1, this.CalculateOctileHeuristic);
this.backgroundID = backgroundID;
this.walkAreaID = walkAreaID;
this.hotSpotMaskID = hotSpotMaskID;
this.characters = new List<Character>();
this.items = new List<Item>();
this.hotspots = new Dictionary<Color, Hotspot>();
}
开发者ID:robertkety,项目名称:Hero6,代码行数:22,代码来源:Room.cs
注:本文中的Campaign类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论