本文整理汇总了C#中SemplestModel.Semplest类的典型用法代码示例。如果您正苦于以下问题:C# Semplest类的具体用法?C# Semplest怎么用?C# Semplest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Semplest类属于SemplestModel命名空间,在下文中一共展示了Semplest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BillType
public ActionResult BillType()
{
//var model = new BillType();
//{
// model.BillType1 = "Credit Card";
// model.Customers.Add(new Customer());
//};
using (var db = new SemplestModel.Semplest())
{
try
{
if (db.BillTypes.Count() > 0)
return View(db.BillTypes.ToList());
else
return View();
}
catch
{
return View();
}
}
//return View();
}
示例2: HomeModelChild
public HomeModelChild()
{
using (var entities = new SemplestModel.Semplest())
Configuration = entities.Configurations.FirstOrDefault();
CampaignSetup = new CampaignSetupModel();
CampaignSetup.AdModelProp.Addresses.FirstOrDefault().StateCodeFK = 0;
}
示例3: CampaignSetup
public ActionResult CampaignSetup(CampaignSetupModel cs, string command)
{
if (command == "") command = "";
var logEnty = new LogEntry {ActivityId = Guid.NewGuid(), Message = "Loading CampaignSetup Controller"};
Logger.Write(logEnty);
//var logService = new LogService();
//logService.AddToLog(1, "Campaign Setup Accessed", "CampaignSetup//CampaignSetup//CampaignSetup", 1);
//var scw = new ServiceClientWrapper();
//scw.SendEmail("subject", "[email protected]", "[email protected]", "test mail");
//var campaignSetupModel = new CampaignSetupModel();
Session["SiteLinks"] = null;
Session["NegativeKeywords"] = null;
Session["NegativeKeywordsText"] = null;
Session["CampaignSetupModel"] = cs;
Session["AllCategories"] = null;
ViewBag.IsLaunched = false;
ViewBag.IsCompleted = false;
ViewBag.IsLaunchedAndCompleted = false;
cs.AdModelProp.IsNew = true;
var dbContext = new SemplestModel.Semplest();
var userid =
((Credential)System.Web.HttpContext.Current.Session[SharedResources.SEMplestConstants.SESSION_USERID]).
UsersFK;
cs.BillType = dbContext.Users.First(key => key.UserPK == userid).Customer.BillTypeFK;
return View(cs);
}
示例4: LogIn
public ActionResult LogIn(Semplest.SharedResources.Models.ProfileModel pm, string ReturnUrl)
{
using (SemplestEntities dbContext = new SemplestEntities())
{
Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID] = 1;
return RedirectToAction("CampaignSetup", "Campaign");
var creds = dbContext.Credentials.Where(c => c.Username == pm.UserName && c.Password == pm.Password1);
if (creds.Count() == 1)
{
Credential c = creds.First();
Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID] = c.UsersFK;
if (c.User.UserRolesAssociations.First().RolesFK == 2)
//means this is an admin user
return RedirectToAction("Index", "Home");
else if (c.User.IsRegistered)
//user is a regular core user
return RedirectToAction("CampaignSetup", "Campaign");
else if (!string.IsNullOrEmpty(pm.SecurityAnswer) && !string.IsNullOrEmpty(pm.SecurityQuestion))
{
//authenticated properly but hasn't registered yet
c.SecurityAnswer = pm.SecurityAnswer;
c.SecurityQuestion = pm.SecurityQuestion;
c.User.IsRegistered = true;
dbContext.SaveChanges();
return RedirectToAction("Index", "Home");
}
else
pm.IsRegistered = false;
}
return View(pm);
}
}
示例5: Index
public ActionResult Index(ReportIndexModel model)
{
Credential cred = ((Credential)(Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID]));
SemplestModel.Semplest dbContext = new SemplestModel.Semplest();
model.AdvertisingEngines = dbContext.AdvertisingEngines;
model.ProductGroups = dbContext.Credentials.Where(x => x.UsersFK == cred.UsersFK).First().User.Customer.ProductGroups;
return RedirectToAction("ReportDetails", model);
}
示例6: ReportDetails
public ActionResult ReportDetails(ReportIndexModel model)
{
Credential cred = ((Credential)(Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID]));
SemplestModel.Semplest dbContext = new SemplestModel.Semplest();
model.AdvertisingEngines = dbContext.AdvertisingEngines;
model.ProductGroups = dbContext.Credentials.Where(x => x.UsersFK == cred.UsersFK).First().User.Customer.ProductGroups;
model.Detail = dbContext.vwPromotionCharts.Where(t => t.UserPK == cred.UsersFK).OrderBy(t => t.Keyword);
model.Configuration = dbContext.Configurations.FirstOrDefault();
return View(model);
}
示例7: Index
public ActionResult Index(ReportIndexModel model)
{
var cred = ((Credential)(Session[SharedResources.SEMplestConstants.SESSION_USERID]));
var dbContext = new SemplestModel.Semplest();
model.AdvertisingEngines = dbContext.AdvertisingEngines;
var credential = dbContext.Credentials.FirstOrDefault(x => x.UsersFK == cred.UsersFK);
if (credential != null)
model.ProductGroups = credential.User.Customer.ProductGroups;
return RedirectToAction("ReportDetails", model);
}
示例8: Index2
public ActionResult Index2()
{
SemplestModel.Semplest dbContext = new SemplestModel.Semplest();
Credential cred = ((Credential)(Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID]));
HomeModelChild child = new HomeModelChild();
IQueryable<Credential> cCred = dbContext.Credentials.Where(x => x.UsersFK == cred.UsersFK);
ViewBag.Title = cCred.First().User.FirstName + " " + cCred.First().User.LastName + " - " + cCred.First().User.Customer.Name;
child.ProductGroups = cCred.First().User.Customer.ProductGroups;
return View(child);
}
示例9: SchedulerView
public ActionResult SchedulerView()
{
var dbContext = new SemplestModel.Semplest();
var
svmc = new SchedulerViewModelCollection();
foreach (SchedulerView svm in dbContext.SchedulerViews)
{
svmc.SVM.Add(new SchedulerViewModel{ CustomerName = svm.CustomerName, ExecutionStartTime = svm.ExecutionStartTime, Frequency = svm.Frequency, IsComplete = svm.IsComplete, IsEnabled = svm.IsEnabled, IsInactive = svm.IsInactive, IsSuccessful = svm.IsSuccessful, PromotionName = svm.PromotionName, ScheduleJobPK = svm.ScheduleJobPK, ScheduleName = svm.ScheduleName, SchedulePK = svm.SchedulePK});
}
svmc.Status = "All";
return View(svmc);
}
示例10: Index
//
// GET: /CreateNewCustomerAccount/
public ActionResult Index(string usersearch, string accountnumbersearch, string emailsearch, FormCollection form)
{
//ViewBag.Message = "Welcome to SEMPLEST ADMIN!";
SemplestModel.Semplest dbcontext = new SemplestModel.Semplest();
var viewModel =
from u in dbcontext.Users
join c in dbcontext.Customers on u.CustomerFK equals c.CustomerPK
where ((c.Name.Contains(usersearch) || u.FirstName.Contains(usersearch) || u.LastName.Contains(usersearch)))
select new HomeModel
{
Customer = c.Name,
AccountNumber = c.CustomerPK,
FirstName = u.FirstName,
LastName = u.LastName,
Email = u.Email
};
var predicate = PredicateBuilder.True<HomeModel>();
if (form["searchtype"] == "Customer" && usersearch != null && usersearch != "")
{
predicate = (p => p.Customer.ToLower().Contains(usersearch.ToLower()));
}
if (form["searchtype"] == "LastName" && usersearch != null && usersearch != "")
{
predicate = (p => p.LastName.ToLower().Contains(usersearch.ToLower()));
}
int accnumber;
bool validaccountsearch = int.TryParse(accountnumbersearch, out accnumber);
if (accountnumbersearch != null && accountnumbersearch != "" && validaccountsearch)
{
predicate = (p => p.AccountNumber == accnumber);
}
if (emailsearch != null && emailsearch != "")
{
predicate = (p => p.Email.ToLower().Contains(emailsearch.ToLower()));
}
//ordering by lastname, firstname
viewModel = viewModel.OrderBy(p => p.Customer).ThenBy(p => p.LastName).ThenBy(p => p.FirstName);
viewModel = viewModel.AsExpandable().Where(predicate);
return View(viewModel);
}
示例11: Index2
public ActionResult Index2()
{
SemplestModel.Semplest dbContext = new SemplestModel.Semplest();
Credential cred = ((Credential)(Session[Semplest.SharedResources.SEMplestConstants.SESSION_USERID]));
HomeModelChild child = new HomeModelChild();
IQueryable<Credential> cCred = dbContext.Credentials.Where(x => x.UsersFK == cred.UsersFK);
var ps = dbContext.GetCustomerPromotionStatus(cCred.Single().User.CustomerFK).OrderBy(q => q.PromotionStatus).ThenBy(q => q.PromotionName).ToList();
ViewBag.Title = cCred.First().User.FirstName + " " + cCred.First().User.LastName + " - " + cCred.First().User.Customer.Name;
child.CustomerPromotions = ps;
return View(child);
}
示例12: ErrorView
public PartialViewResult ErrorView(string ddl)
{
var dbContext = new SemplestModel.Semplest();
List<ErrorModel> list = new List<ErrorModel>();
DateTime reqDate = DateTime.Parse(ddl);
foreach (Error er in dbContext.Errors.Where(x => x.CreatedDate.Month == reqDate.Month && x.CreatedDate.Day == reqDate.Day && x.CreatedDate.Year == reqDate.Year).OrderByDescending(x => x.CreatedDate))
{
var em = new ErrorModel();
em.ErrorMessage = er.ErrorMessage;
em.User = er.User != null ? er.User.Credentials.First().Username : "N/A";
em.TimeStamp = er.CreatedDate;
list.Add(em);
}
return PartialView("_ErrorView", list);
}
示例13: Create
public ActionResult Create(BillType billtype)
{
try
{
using (var db = new SemplestModel.Semplest())
{
db.BillTypes.Add(billtype);
db.SaveChanges();
}
return RedirectToAction("BillType");
}
catch
{
return View();
}
}
示例14: CampaignSetupModel
public CampaignSetupModel()
{
ProductGroup = new ProductGroupModel();
AdModelProp = new AdModel();
BillingLaunch = new BillingLaunchModel();
// for categories
AllCategories = new List<CategoriesModel>();
SelectedCategories = new List<CategoriesModel>();
CategoryIds = new List<int>();
// for keywords
AllKeywords = new List<KeywordsModel>();
AllKeywordProbabilityObjects = new List<KeywordProbabilityObject>();
SelectedKeywords = new List<KeywordsModel>();
KeywordIds = new List<int>();
SiteLinks = new List<SiteLink>();
Configuration = new SemplestModel.Semplest().Configurations.Single();
}
示例15: ReportSummaryGrid
public ActionResult ReportSummaryGrid(string promotionFk, string advertisingEngineFk, DateTime? startDate, DateTime? endDate)
{
var dbContext = new SemplestModel.Semplest();
var cred = ((Credential)(Session[SharedResources.SEMplestConstants.SESSION_USERID]));
var promotionFks = Array.ConvertAll(promotionFk.Split(','), int.Parse);
var adFks = Array.ConvertAll(advertisingEngineFk.Split(','), int.Parse);
var grp = dbContext.vwPromotionCharts.Where(t => promotionFks.Contains(t.PromotionFK) && t.UserPK == cred.UsersFK && adFks.Contains(t.AdvertisingEngineFK) && t.TransactionDate >= startDate && t.TransactionDate <= endDate).OrderBy(t => t.Keyword).GroupBy(t => new { t.PromotionName });
var reports = grp.Select(v => new vwPromotionChartModel
{
AmountSpent = v.Sum(t => t.NumberClick * t.AverageCPC),
NumberImpressions = v.Sum(t => t.NumberImpressions),
KeyWord = v.FirstOrDefault().PromotionName,
NumberClick = v.Sum(t => t.NumberClick),
SearchCTR = v.Sum(t => t.NumberClick / t.NumberImpressions),
CPC = v.Sum(t => t.NumberClick) == 0 ? 0 : v.Sum(t => t.NumberClick * t.AverageCPC) / v.Sum(t => t.NumberClick),
AveragePosition = v.Average(t => t.AveragePosition),
}).ToList();
return Json(reports, JsonRequestBehavior.AllowGet);
}