本文整理汇总了C#中System.Guid.GetValueOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# Guid.GetValueOrDefault方法的具体用法?C# Guid.GetValueOrDefault怎么用?C# Guid.GetValueOrDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Guid
的用法示例。
在下文中一共展示了Guid.GetValueOrDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteSelectedValues
/// <summary>
/// Delete selected values
/// </summary>
/// <param name="selectedValues">Ids of selected values</param>
/// <param name="businessApplicationId">Id of business application</param>
/// <returns></returns>
public ActionResult DeleteSelectedValues(string selectedValues, Guid? businessApplicationId)
{
string[] ids = selectedValues.Split(new char[] { '&' }, StringSplitOptions.RemoveEmptyEntries);
List<Guid> valueIds = new List<Guid>();
ids.ToList().ForEach(id => valueIds.Add(new Guid(id)));
List<string> result = CatalogueBusiness.DeleteSelectedValues(valueIds, businessApplicationId.GetValueOrDefault(), UserName);
return Json(result);
}
示例2: Details
// GET: WorkContent/AllWeekPlan/Details/5
public ActionResult Details(Guid? targetId)
{
var weeklyPlanServices = ServiceLocator.Instance.GetService<IWeeklyPlanServices>();
var weekComents = weeklyPlanServices.GetShowWeekComents(targetId.GetValueOrDefault());
var weeklyPlanList = new List<ShowWeekComent>();
if (weekComents.Any())
{
weeklyPlanList.Add(new ShowWeekComent() { ConnectType = 0 });
weeklyPlanList.AddRange(weeklyPlanServices.GetShowWeekComents(targetId.GetValueOrDefault()));
weeklyPlanList.Add(new ShowWeekComent() { ConnectType = 2 });
}
return Json(weeklyPlanList);
}
示例3: Details
public ActionResult Details(Guid? id)
{
var userId = new Guid(User.Identity.Name);
var workRecordServices = ServiceLocator.Instance.GetService<IWorkRecordServices>();
var workComments = workRecordServices.GetWorkComments(id.GetValueOrDefault(), userId);
return Json(workComments);
}
示例4: Credit
public ActionResult Credit(Guid? id)
{
if (id.IsNull())
return View(new HotLine { Position = _iService.GetPosition() });
var result = _iService.GetEntityById(id.GetValueOrDefault());
return View(result);
}
示例5: Index
// GET: WorkContent/WorkGroup
public ActionResult Index(Guid? depId, DateTime? selectTime)
{
var departmentServices = ServiceLocator.Instance.GetService<IDepartmentServices>();
var departments = new List<ShowDepartment>();
departments.Add(new ShowDepartment() { Name = "全部" });
departments.AddRange(departmentServices.Get());
ViewBag.Department = new HtmlString(departments.ToJson());
var workRecordServices = ServiceLocator.Instance.GetService<IWorkRecordServices>();
if (selectTime.Null())
{
selectTime = DateTime.Now;
}
var showWorkRecords = workRecordServices.GetAllRecords(selectTime.GetValueOrDefault(), depId.GetValueOrDefault());
ViewBag.DepId = depId.GetValueOrDefault();
ViewBag.selectTime = selectTime;
return PartialView(new HtmlString(showWorkRecords.ToJson()));
}
示例6: CurrentConfiguration
public ActionResult CurrentConfiguration(Guid? idpId)
{
var fileData = GetCachedConfiguration(idpId.GetValueOrDefault(defaultIdpGuid));
if (fileData == null)
{
return new HttpStatusCodeResult(System.Net.HttpStatusCode.InternalServerError, "Internal server error, no IDP configured");
}
return TestETag(fileData.JsonData, fileData.ETag, "application/json");
}
示例7: DeletePermission
/// <summary>
/// Perform the delete operation in the permission screen
/// </summary>
/// <param name="loginName">User name</param>
/// <param name="businessAppId">Id of business application</param>
/// <param name="userType">User type</param>
/// <returns></returns>
public ActionResult DeletePermission(string loginName, Guid? businessAppId, int? userType)
{
string result = string.Empty;
if(loginName != UserName)
AuthorizationBusiness.DeletePermission(loginName, businessAppId.GetValueOrDefault(), UserName, userType.GetValueOrDefault());
else
result = Resources.Administration.NonDeletePermissionMessage;
return Json(result);
}
示例8: CreateSummary
public static UpdateWeekSummary CreateSummary(Guid? weekId, WeekSummary weekSummary)
{
var updateWeekSummary = new UpdateWeekSummary();
updateWeekSummary.ID = weekId.GetValueOrDefault();
if (!weekSummary.Null())
{
updateWeekSummary.Description = weekSummary.Description;
updateWeekSummary.DepartmentId = weekSummary.DepartmentId;
}
return updateWeekSummary;
}
示例9: Create
// GET: Architecture/Journal/Create
public ActionResult Create(Guid? id)
{
var journalServices = ServiceLocator.Instance.GetService<IJournalServices>();
var journal = new UpdateJournal();
if (id.HasValue)
{
journal = journalServices.Get(id.GetValueOrDefault());
}
ViewBag.UpdateJournal = new HtmlString(journal.ToJson());
return PartialView();
}
示例10: Create
// GET: Architecture/Tree/Create
public ActionResult Create(Guid? id)
{
var treeServices = ServiceLocator.Instance.GetService<ITreeServices>();
var tree = new UpdateTree();
if (id.HasValue)
{
tree = treeServices.Get(id.GetValueOrDefault());
}
ViewBag.UpdateTree = new HtmlString(tree.ToJson());
return PartialView();
}
示例11: Restart
public ActionResult Restart(Guid? restId)
{
if (!restId.HasValue)
{
return Json(new Cells(false, "请选择正确的餐厅", 0));
}
var restartCommand = new RestartCommand(restId.GetValueOrDefault());
restartCommand.Work();
var result = restartCommand.GetResult();
return Json(result);
}
示例12: UpLog
public ActionResult UpLog(Guid? restId)
{
if (!restId.HasValue)
{
return Json(new Cells(false, "请选择正确的餐厅", 0));
}
var upLoadLog = new UpLoadLog(restId.GetValueOrDefault());
upLoadLog.Work();
var result = upLoadLog.GetResult();
return Json(result);
}
示例13: RestState
public ActionResult RestState(Guid? restId)
{
if (!restId.HasValue)
{
return Json(new Cells(false, "请选择正确的餐厅", 0));
}
var training = new Training(restId.GetValueOrDefault());
training.Work();
var result = training.GetResult();
return Json(result);
}
示例14: EditCatalogue
/// <summary>
/// Peroform the edit operation
/// </summary>
/// <param name="catalogueIdEdit">Id of catalogue for edit</param>
/// <returns>ActionResult</returns>
public ActionResult EditCatalogue(Guid? catalogueIdEdit)
{
Catalogue catalogue = CatalogueBusiness.GetCatalogueCategory(catalogueIdEdit.GetValueOrDefault());
CatalogueModel model = new CatalogueModel
{
BusinessApplicationId = catalogue.BusinessApplicationId,
CatalogueCategoryName = catalogue.CatalogueCategoryName,
CatalogueId = catalogue.CatalogueId,
ScreenOpenMode = ScreenOpenMode.Edit
};
return View("Catalogue", model);
}
示例15: Create
// GET: Architecture/TrackTarget/Create
public ActionResult Create(Guid? id)
{
var trackTargetServices = ServiceLocator.Instance.GetService<ITrackTargetServices>();
var updateTrackTarget = new UpdateTrackTarget();
if (id.HasValue)
{
updateTrackTarget = trackTargetServices.Get(id.GetValueOrDefault());
}
var trackPlanServices = ServiceLocator.Instance.GetService<ITrackPlanServices>();
var trackPlan = trackPlanServices.Get();
ViewBag.TrackPlans = new HtmlString(trackPlan.ToJson());
ViewBag.UpdateTrackTarget = new HtmlString(updateTrackTarget.ToJson());
return PartialView();
}