// GET: Dashboard /// <summary> /// Provides action method for /Application/Dashboard request. /// </summary> /// <returns>Return action result for /Application/Dashboard request.</returns> public ActionResult Dashboard() { // Set the view captions for this action method... ViewBag.Title = "Dashboard Page"; ViewBag.PageTitle = "Dashboard"; ViewBag.PageSubTitle = "Provide at-a-glance views of KPIs (key performance indicators) relevant to online drive system of arcanys."; // Set the menus for the navigation side panel... using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } // Set the total of files stored on the online drive... int totalFiles = GetOnlineDrive().Count(); if (totalFiles <= 1) { ViewBag.TotalUploadedFile = String.Format("{0} {1}", totalFiles, "Total File on the Drive!"); } else { ViewBag.TotalUploadedFile = String.Format("{0} {1}", totalFiles, "Total Files on the Drive!"); } // Render the view as response to the request... return(View()); }
// GET: OnlineDriveUploadedDocumentSave /// <summary> /// Provides action method for /Home/OnlineDriveUploadedDocumentSave request. /// </summary> /// <param name="model">The ArcanysSystem.Models.OnlineDriveViewModel model</param> /// <param name="page">The index page to display with.</param> /// <returns>Return action result for /Home/OnlineDriveUploadedDocumentSave request.</returns> public ActionResult OnlineDriveUploadedDocumentSave(OnlineDriveViewModel model, int?page) { // Set the view captions for this action method... ViewBag.Title = "Online Drive Upload Page"; ViewBag.PageTitle = "Upload Your Files Here..."; ViewBag.PageSubTitle = "Simply drag en drop the file you'd like to upload on the drop box below."; ViewBag.TableTitle = "Uploaded File List"; ViewBag.ButtonAction = model.ButtonAction; // Set the menus for the navigation side panel... using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } // Gets the uploaded filename... this.OnlineDriveList = ApplicationSession.GlobalParameters.UploadedFileList; // Validate id there was a file uploaded... if (this.OnlineDriveList == null) { return(RedirectToAction("OnlineDriveUpload")); } if (this.OnlineDriveList.Count() > 0) { try { // Save all the uploaded files... if (model.ButtonAction == "Upload") { foreach (var item in this.OnlineDriveList) { model.Id = item.Id; model.FileNameGUID = item.FileNameGUID; model.FileName = item.FileName; model.FilePath = item.FilePath; model.UploadedOn = DateTime.Now; model.UploadedBy = 1; model.LastUpdatedOn = DateTime.Now; model.LastUpdatedBy = 1; model.DeletedOn = DateTime.Now; model.DeletedBy = 1; if (this.ModelState.IsValid) { this.PostOnlineDrive(model); } } } ApplicationSession.GlobalParameters.UploadedFileList = null; this.OnlineDriveList.Clear(); } catch (Exception) { } } // Redirect action to OnlineDriveUpload... return(RedirectToAction("OnlineDriveUpload")); }
public ActionResult Index() { using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); return(View(Configuration.Services.GetApiExplorer().ApiDescriptions)); }
// GET: Dashboard /// <summary> /// Provides action method for /Home/Index request. /// </summary> /// <returns>Return action result for /Home/Index request.</returns> public ActionResult Index() { // Set the view captions for this action method... ViewBag.Title = "Home Page"; ViewBag.PageTitle = string.Empty; ViewBag.PageSubTitle = string.Empty; // Set the menus for the navigation side panel... using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } // Render the view as response to the request... return(View()); }
public ActionResult Api(string apiId) { using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } if (!String.IsNullOrEmpty(apiId)) { HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId); if (apiModel != null) { return(View(apiModel)); } } return(View(ErrorViewName)); }
public ActionResult ResourceModel(string modelName) { using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } if (!String.IsNullOrEmpty(modelName)) { ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator(); ModelDescription modelDescription; if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription)) { return(View(modelDescription)); } } return(View(ErrorViewName)); }
// GET: OnlineDriveUpload /// <summary> /// Provides action method for /Home/OnlineDriveUpload request. /// </summary> /// <returns>Return action result for /Home/OnlineDriveUpload request.</returns> public ActionResult OnlineDriveUpload(int?page) { // Set the view captions for this action method... ViewBag.Title = "Online Drive File Uploading Page"; ViewBag.PageTitle = "Upload Your Files Here..."; ViewBag.PageSubTitle = "Simply drag en drop any files that you'd like to upload."; ViewBag.TableTitle = "Uploaded File List"; // Reset all the uploaded file list first... ApplicationSession.GlobalParameters.UploadedFileList = new List <OnlineDriveViewModel>(); ApplicationSession.GlobalParameters.UploadedFileList.Clear(); this.OnlineDriveList = new List <OnlineDriveViewModel>(); this.OnlineDriveList.Clear(); // Set action button to default value is action is null... if (string.IsNullOrEmpty(ViewBag.ButtonAction)) { ViewBag.ButtonAction = String.Empty; } // Set the menus for the navigation side panel... using (MenuProcess menuProcess = new MenuProcess()) { ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true); } // Populate the list of uploaded files... if (this.ModelState.IsValid) { try { return(this.View(this.GetOnlineDrive().ToList().ToPagedList(page ?? 1, 10))); } catch (Exception ex) { throw ex; } } // Render the view as response to the request... return(View()); }
void AddButtonInToolBar(XmlDocument xmldoc) { XmlNodeList btnNodes = xmldoc.SelectNodes("/root/Action/Buttons/Button"); if (btnNodes == null) { return; } foreach (XmlNode node in btnNodes) { CMenuItem mnu = new CMenuItem(frm.strUid); XmlNode evtnode = node.SelectSingleNode("evt"); if (evtnode == null) { mnu.MnuName = XmlUtil.GetSubNodeText(node, "."); mnu.LinkValue = XmlUtil.GetSubNodeText(node, "@onclick"); mnu.MnuId = XmlUtil.GetSubNodeText(node, "@id"); } else { mnu = MenuProcess.GetMenu(null, evtnode, frm.strUid); } toolbarbld.AddToolBarItem(mnu, ToolBarItemType.Button, frm.ToolBarBtn_Click); toolbarbld.AddToolBarItem(null, ToolBarItemType.Separator); /* //用AddToolBarItem替代,期待实现 * ToolStripItem tsi; * tsi = new ToolStripButton(mnu.MnuName); * tsi.Tag = mnu; * tsi.Click += new EventHandler(ToolBarBtn_Click); * if (this.toolStrip1.Items.Count > 0) * this.toolStrip1.Items.Add(new ToolStripSeparator()); * this.toolStrip1.Items.Add(tsi);*/ } }
public virtual void FillGrid(XmlNode cmbNode) { //grid列处理 if (XmlUtil.GetSubNodeText(cmbNode, "@sum") != null) { listViewObj.AllowSum = XmlUtil.GetSubNodeText(cmbNode, "@sum") == "1"; } if (XmlUtil.GetSubNodeText(cmbNode, "@allowgroup") != null) { listViewObj.AllowGroup = XmlUtil.GetSubNodeText(cmbNode, "@allowgroup") == "1"; } listViewObj.GroupBy = XmlUtil.GetSubNodeText(cmbNode, "@groupby"); listViewObj.SumItems = XmlUtil.GetSubNodeText(cmbNode, "@sumitems"); XmlNodeList nodes = cmbNode.SelectNodes("cols/f"); if (nodes.Count > 0) { //listobj.Columns = new ListGrid.ListGridColumnHeaderCollection(this.listViewObj); ClearItems(); foreach (XmlNode node in nodes) { ViewItem vi = new ViewItem(); vi.LoadXml(node); IDataFieldHeaderColumn ch = GetHeaderColumn(); ch.Text = vi.Text; ch.Width = vi.Width; if (!vi.Perm) { ch.Width = 0; } DataGridColumn dgc = new DataGridColumn(this); dgc.LoadXml(node); dgc.Text = ch.Text; dgc.Width = ch.Width; dgc.DataField = vi.Name; ch.DataType = dgc.DataType; ch.NeedSum = dgc.Sum; ch.DataField = dgc.dpt.Name; AddColumnItem(ch); this.Columns.Add(dgc); if (ViewList.ContainsKey(vi.Name)) { continue; } ViewList.Add(vi.Name, vi); if (!listViewObj.DataGridColumns.ContainsKey(dgc.dpt.Name)) { listViewObj.DataGridColumns.Add(dgc.dpt.Name, dgc); } } //AcceptRejectRule } //事件初始化 XmlNodeList evtnodes = cmbNode.SelectNodes("action/evt"); if (evtnodes.Count > 0) { foreach (XmlNode node in evtnodes) { CMenuItem mnu = MenuProcess.GetMenu(null, node, frmhandle.strUid); string strEvtName = XmlUtil.GetSubNodeText(node, "@id"); //'mnu = CMenuItem. switch (strEvtName) { case "dbclick": { this.ItemDbClickedMenu = mnu; //this.listView1.DoubleClick += new EventHandler(listView1_DoubleClick); break; } } } } listViewObj.Tag = this; }