当前位置: 首页>>代码示例>>C#>>正文


C# Guid.GetValueOrDefault方法代码示例

本文整理汇总了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);
 }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:14,代码来源:CatalogueController.cs

示例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);
        }
开发者ID:key-value,项目名称:Eagle.First,代码行数:15,代码来源:AllWeekPlanController.cs

示例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);
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:7,代码来源:WorkCommentController.cs

示例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);
 }
开发者ID:ZenHiro,项目名称:itdtv,代码行数:7,代码来源:HotlineController.cs

示例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()));
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:18,代码来源:WorkGroupController.cs

示例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");
 }
开发者ID:renklaf,项目名称:authservices,代码行数:9,代码来源:ManageController.cs

示例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);
        }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:17,代码来源:AccountController.cs

示例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;
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:11,代码来源:UpdateWeekSummary.cs

示例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();
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:12,代码来源:JournalController.cs

示例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();
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:12,代码来源:TreeController.cs

示例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);
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:11,代码来源:RestMaintainController.cs

示例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);
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:11,代码来源:RestMaintainController.cs

示例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);
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:11,代码来源:RestMaintainController.cs

示例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);
 }
开发者ID:ramirobr,项目名称:VestalisV3,代码行数:17,代码来源:CatalogueController.cs

示例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();
 }
开发者ID:key-value,项目名称:Eagle.First,代码行数:15,代码来源:TrackTargetController.cs


注:本文中的System.Guid.GetValueOrDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。