/// <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);
 }
        // 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);
        }
 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
0
 public ActionResult Credit(Guid? id)
 {
     if (id.IsNull())
         return View(new HotLine { Position = _iService.GetPosition() });
     var result = _iService.GetEntityById(id.GetValueOrDefault());
     return View(result);
 }
 // 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
0
 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
0
        /// <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);
        }
 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;
 }
 // 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
0
 // 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();
 }
 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);
 }
 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);
 }
 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
0
 /// <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);
 }
 // 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();
 }
        // GET: Brand/RestMaintain
        public ActionResult Index(Guid? cityId, string restName, int pageNum = 1)
        {
            var restaurantServices = ServiceLocator.Instance.GetService<IRestaurantServices>();
            var restList = restaurantServices.Get(cityId.GetValueOrDefault(), restName, 1, pageNum);
            ViewBag.totalPage = restaurantServices.PageCount;

            var cityServices = ServiceLocator.Instance.GetService<ICityServices>();
            var cityList = cityServices.GetCities();
            ViewBag.cityList = new HtmlString(cityList.ToJson());

            ViewBag.cityId = cityId;
            ViewBag.searchName = new HtmlString(restName);
            return PartialView(model: new HtmlString(restList.ToJson()));
        }
        public ActionResult ConnectSteps(Guid? restId, int pageNum)
        {
            if (!restId.HasValue)
            {
                return Content("");
            }
            var monitorConnectStepServices = ServiceLocator.Instance.GetService<IMonitorConnectStepServices>();
            var monitorConnectSteps = monitorConnectStepServices.GetMonitorConnectSteps(restId.GetValueOrDefault(), pageNum);

            var cell = new SplinterCell<ShowStep>();
            cell.Data = monitorConnectSteps;
            cell.PageCount = monitorConnectStepServices.PageCount;

            return Json(cell);
        }
示例#18
0
        public ActionResult Tables(Guid? restId, int pageNum)
        {
            if (!restId.HasValue)
            {
                return Content("");
            }
            var tableServices = ServiceLocator.Instance.GetService<ITableServices>();
            tableServices.PageSize = 12;
            var tables = tableServices.GetDeskList(restId.GetValueOrDefault(), pageNum);

            var cell = new SplinterCell<ShowTable>();
            cell.Data = tables;
            cell.PageCount = tableServices.PageCount;

            return Json(cell);
        }
 // GET: WorkContent/WorkComment/Create
 public ActionResult Create(Guid? id, Guid? recordId)
 {
     var userId = new Guid(User.Identity.Name);
     var workRecordServices = ServiceLocator.Instance.GetService<IWorkRecordServices>();
     var updateWorkComment = new UpdateWorkComment();
     if (id.HasValue)
     {
         updateWorkComment = workRecordServices.GetWorkComment(userId, id.Value);
     }
     else
     {
         updateWorkComment.RecordId = recordId.GetValueOrDefault();
     }
     ViewBag.UpdateWorkComment = new HtmlString(updateWorkComment.ToJson());
     return PartialView();
 }
        public async Task<ActionResult> Index(Guid? selectedDepartment)
        {
            var getCoursesTask = GetHttpResponMessageResultAsyc<List<CourseModel>>("api/courses", "department");
            var getDepartmentsTask = GetHttpResponMessageResultAsyc<List<DepartmentModel>>("api/departments");

            var courses = await getCoursesTask;
            var departments = await getDepartmentsTask;

            ViewBag.SelectedDepartment = new SelectList(departments, "Id", "Name", selectedDepartment);

            var selectedDepartmentId = selectedDepartment.GetValueOrDefault();
            var viewmodel = new CourseIndexViewModel
            {
                Course = courses.Where(c => !selectedDepartment.HasValue || c.Department.Id == selectedDepartmentId)
                    .OrderBy(c => c.Id)
            };

            return View(viewmodel);
        }
示例#21
0
        public FileResult GetImage(Guid? id, int? width, int? height, string defImage = "", string type = "crop")
        {
            var imageId = id.GetValueOrDefault();

            var key = $"394A2D54D6684366918C9D37DE27FD1E-[{imageId}][{width ?? -1}][{height ?? -1}][{defImage}][{type}]";

            if (_cacheWrapper[key] != null)
                return _cacheWrapper[key] as FileResult;

            lock (GetImageLocker)
            {
                if (_cacheWrapper[key] == null)
                {
                    byte[] bytes = null;

                    var converType = string.Equals(type, "crop", StringComparison.OrdinalIgnoreCase) ?
                        CrazyImage.ConvertType.Crop : CrazyImage.ConvertType.Frame;

                    if (imageId != Guid.Empty)
                    {
                        var path = _fileSystemService.GetFilePath(imageId);
                        bytes = CrazyImage.GetThumbImage(path, width, height, converType);
                    }

                    if (bytes == null || bytes.Length <= 0)
                        bytes = CrazyImage.GetThumbImage(string.Equals(defImage, "NoPhoto", StringComparison.OrdinalIgnoreCase) ?
                            Properties.Resources.NoPhoto : Properties.Resources.NoImage,
                            width,
                            height,
                            converType);

                    _cacheWrapper[key] = File(bytes, "image/png");
                };
            }

            return (FileResult)_cacheWrapper[key];
        }
示例#22
0
 /// <summary>
 /// Get the select catalogue value to edit
 /// </summary>
 /// <param name="catalogueValueId">Id of the selected catalogue value</param>
 /// <returns>ActionResult</returns>
 public ActionResult EditCatalogueValue(Guid? catalogueValueId)
 {
     CatalogueValue model = CatalogueBusiness.GetCatalogueValue(catalogueValueId.GetValueOrDefault());
     return View("CatalogueValue", model);
 }
示例#23
0
 /// <summary>
 /// Initialize the auto complete field
 /// </summary>
 /// <param name="autoCompleteField">Field</param>
 /// <param name="serviceOrderId">Id of service order</param>
 public static void InitAutoCompleteInspectionReportField(FieldsAutoCompleteTextField autoCompleteField, Guid? serviceOrderId = null)
 {
     //Get the sql statement for filling the itemsource
     string command = autoCompleteField.ItemSourceCondition.Replace("SERVICEORDERID", serviceOrderId.GetValueOrDefault().ToString());
     //Execute the sql statement and fill the itemsource
     autoCompleteField.ItemSource = InspectionReportBusiness.GetAutoCompleteItemSource(command);
 }
示例#24
0
        /// <summary>
        /// Search the catalogues for exporting to excel
        /// </summary>
        /// <param name="businessApplicatioId">Id of business application</param>
        /// <param name="catalogueSelectedName">Name of the catalogue</param>
        /// <param name="catalogueId">Id of the catalogue</param>
        public void SearchCatalogueValuesExcel(Guid? businessApplicatioId, string catalogueSelectedName, Guid? catalogueId)
        {
            CatalogueValueSearchModel model = new CatalogueValueSearchModel();
            PaginatedList<CatalogueValue> searchResult = new PaginatedList<CatalogueValue>();
            searchResult = CatalogueBusiness.SearchCatalogueValueList(catalogueId.GetValueOrDefault(), 0, SortDirection.Ascending, "CatalogueValueData", 0, true);
            string businessApplicatioName = string.Empty;

            businessApplicatioName = AuthorizationBusiness.GetAllBusinessAplications()
                .First(data => data.BusinessApplicationId == businessApplicatioId.GetValueOrDefault()).BusinessApplicationName;

            model.CatalogueSelectedId = catalogueId.GetValueOrDefault();
            model.SearchResult = searchResult;
            model.CatalogueSelectedName = CatalogueBusiness.GetCatalogueCategory(catalogueId.Value).CatalogueCategoryName;
            model.BusinessApplicatioName = businessApplicatioName;

            Session.Add("SearchCatalogueValuesExcel", model);
        }
示例#25
0
 /// <summary>
 /// Perform the delete operation for any catalogue value
 /// </summary>
 /// <param name="catalogueValueId">Id of catalogue Value</param>
 /// <param name="businessApplicationId">Id of business application</param>
 public ActionResult DeleteCatalogueValue(Guid? catalogueValueId, Guid? businessApplicationId)
 {
     string message = CatalogueBusiness.DeleteCatalogueValue(catalogueValueId.GetValueOrDefault(),
         businessApplicationId.GetValueOrDefault(), UserName);
     return Json(message);
 }
示例#26
0
        /// <summary>
        /// Display the list of catalogue values
        /// </summary>
        /// <param name="catalogueId">Id of selected catalogue</param>
        /// <returns>ActionResult</returns>
        public PartialViewResult SearchCatalogueValueList(Guid? catalogueId)
        {
            PaginatedList<CatalogueValue> model = new PaginatedList<CatalogueValue>();
            int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
            model = CatalogueBusiness.SearchCatalogueValueList(catalogueId.GetValueOrDefault(), pageSize, SortDirection.Ascending, "CatalogueValueData", 1, false);

            Session.Add("catalogueId", catalogueId);
            return PartialView("_CatalogueValueGrid", model);
        }
示例#27
0
        /// <summary>
        /// Perform the search of catalogues
        /// </summary>
        /// <param name="page">Selected page</param>
        /// <param name="businessApplicationId">Id of business application</param>
        /// <returns>PartialViewResult</returns>
        public PartialViewResult SearchCatalogueList(int? page, Guid? businessApplicationId)
        {
            int pageSize = Cotecna.Vestalis.Web.Properties.Settings.Default.PageSize;
            PaginatedList<CatalogueModel> model = new PaginatedList<CatalogueModel>();

            ParameterSearchCatalogues parameters = new ParameterSearchCatalogues()
            {
                BusinessApplicationId = businessApplicationId.GetValueOrDefault(),
                PageSize = pageSize,
                SortDirection = SortDirection.Ascending,
                SortedColumn = "BusinessApplicationName",
                SelectedPage = page.GetValueOrDefault(),
                UserName = UserName
            };

            model = CatalogueBusiness.SearchCategoryCatalogue(parameters);
            Session.Add("catalogueBusinessApplicationId", businessApplicationId);
            return PartialView("_CatalogueGrid", model);
        }
示例#28
0
        /// <summary>
        /// Retrieve the list of catalogues for exporting to excel
        /// </summary>
        /// <param name="businessAppId">Id of business application</param>
        public void SearchCatalogueCategoriesExcel(Guid? businessAppId)
        {
            PaginatedList<CatalogueModel> model = new PaginatedList<CatalogueModel>();

            ParameterSearchCatalogues parameters = new ParameterSearchCatalogues()
            {
                BusinessApplicationId = businessAppId.GetValueOrDefault(),
                PageSize = 0,
                SortDirection = SortDirection.Ascending,
                SortedColumn = "BusinessApplicationName",
                SelectedPage = 0,
                IsExport = true,
                UserName = UserName
            };

            model = CatalogueBusiness.SearchCategoryCatalogue(parameters);

            Session.Add("SearchCatalogueCategoriesExcel", model);
        }
示例#29
0
 public ActionResult NewCatalogueValue(Guid? catalogueId)
 {
     CatalogueValue model = new CatalogueValue();
     model.CatalogueId = catalogueId.GetValueOrDefault();
     return View("CatalogueValue", model);
 }
示例#30
0
        /// <summary>
        ///     Populates the group roles.
        /// </summary>
        /// <param name="checkboxList"></param>
        /// <param name="groupTypeGuid"></param>
        private void PopulateRelationshipTypesSelector( RockCheckBoxList checkboxList, Guid? groupTypeGuid )
        {
            bool showSelector = false;

            checkboxList.Items.Clear();

            var groupType = GroupTypeCache.Read( groupTypeGuid.GetValueOrDefault() );

            if ( groupType != null )
            {
                var selectableRoles = new GroupTypeRoleService( new RockContext() ).GetByGroupTypeId( groupType.Id );

                // Exclude the Owner Role from the list of selectable Roles because a Person cannot be related to themselves.
                var ownerGuid = GroupRole.GROUPROLE_KNOWN_RELATIONSHIPS_OWNER.AsGuid();

                selectableRoles = selectableRoles.Where( x => x.Guid != ownerGuid );

                checkboxList.Items.Clear();

                foreach ( var item in selectableRoles )
                {
                    checkboxList.Items.Add( new ListItem( item.Name, item.Guid.ToString() ) );
                }

                showSelector = checkboxList.Items.Count > 0;
            }

            checkboxList.Visible = showSelector;
        }