public ActionResult Create(long? parentId, int sectionId = 1) { var model = new PageFormModel() { ParentId = parentId, SectionId = sectionId, TypeId = 2 }; return View(model); }
private void LiAdminForm_Load(object sender, EventArgs e) { Init(); LiMessageForm ribbonForm = new LiMessageForm(); AddPageMdi(PageFormModel.getInstance(0, ribbonForm, ribbonForm.Name, "", false)); setShowInfo(); }
public ActionResult Create(long?parentId, int sectionId = 1) { var model = new PageFormModel() { ParentId = parentId, SectionId = sectionId, TypeId = 2 }; return(View(model)); }
public ActionResult Edit(PageFormModel model) { if (ModelState.IsValid) { var item = GetSession.Get <Page>(model.Id); Mapper.Map <PageFormModel, Page>(model, item); item.UpdatedDate = DateTime.Now; GetSession.Update(item); return(RedirectToAction("Index", new { model.ParentId, model.SectionId })); } return(View(model)); }
private void xtraTabbedMdiManager1_PageRemoved(object sender, MdiTabPageEventArgs e) { XtraTabbedMdiManager xtraTabbedMdiManager = ((XtraTabbedMdiManager)sender); PageFormModel deletePageFormModel = null; foreach (KeyValuePair <string, PageFormModel> kvp in LiContexts.LiContext.pageFormModels) { if (xtraTabbedMdiManager.Pages[kvp.Value.liForm] == null) { deletePageFormModel = kvp.Value; } } if (deletePageFormModel != null) { LiContexts.LiContext.pageFormModels.Remove(deletePageFormModel.ToString()); } }
public ActionResult Create(PageFormModel model,FormCollection coll) { var item = Mapper.Map<PageFormModel, Page>(model); Page parent = null; if (model.ParentId.HasValue) { parent = GetSession.Get<Page>(model.ParentId); item.Parent = parent; } int maxOrder = GetSession.Query<Page>() .Where(x => x.Parent == parent && x.SectionId == model.SectionId ).Max(x => (int?)x.PageOrder) ?? 0; if (item.TypeId == 999) { item.PageTemplate = "tv"; item.Iframelink1DelayTime = coll["Iframelink1"].ToString().Split(',')[1]; item.Iframelink2DelayTime = coll["Iframelink2"].ToString().Split(',')[1]; item.Iframelink3DelayTime = coll["Iframelink3"].ToString().Split(',')[1]; item.Iframelink4DelayTime = coll["Iframelink4"].ToString().Split(',')[1]; item.Iframelink5DelayTime = coll["Iframelink5"].ToString().Split(',')[1]; } if (item.TypeId == 001) { } item.PageOrder = maxOrder + 1; item.IsInternal = true; item.UpdatedDate = DateTime.Now; GetSession.Save(item); return RedirectToAction("Index", new { model.ParentId, model.SectionId }); }
public ActionResult Create(PageFormModel model, FormCollection coll) { var item = Mapper.Map <PageFormModel, Page>(model); Page parent = null; if (model.ParentId.HasValue) { parent = GetSession.Get <Page>(model.ParentId); item.Parent = parent; } int maxOrder = GetSession.Query <Page>() .Where(x => x.Parent == parent && x.SectionId == model.SectionId ).Max(x => (int?)x.PageOrder) ?? 0; if (item.TypeId == 999) { item.PageTemplate = "tv"; item.Iframelink1DelayTime = coll["Iframelink1"].ToString().Split(',')[1]; item.Iframelink2DelayTime = coll["Iframelink2"].ToString().Split(',')[1]; item.Iframelink3DelayTime = coll["Iframelink3"].ToString().Split(',')[1]; item.Iframelink4DelayTime = coll["Iframelink4"].ToString().Split(',')[1]; item.Iframelink5DelayTime = coll["Iframelink5"].ToString().Split(',')[1]; } if (item.TypeId == 001) { } item.PageOrder = maxOrder + 1; item.IsInternal = true; item.UpdatedDate = DateTime.Now; GetSession.Save(item); return(RedirectToAction("Index", new { model.ParentId, model.SectionId })); }
public ActionResult Edit(PageFormModel model) { if (ModelState.IsValid) { var item = GetSession.Get<Page>(model.Id); Mapper.Map<PageFormModel, Page>(model, item); item.UpdatedDate = DateTime.Now; GetSession.Update(item); return RedirectToAction("Index", new { model.ParentId, model.SectionId }); } return View(model); }
/// <summary> /// 菜单显示,左右键事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void treeList1_MouseUp(object sender, MouseEventArgs e) { TreeList tree = sender as TreeList; //右键菜单 if (e.Button == MouseButtons.Right && ModifierKeys == Keys.None && treeList1.State == TreeListState.Regular) { Point p = new Point(Cursor.Position.X, Cursor.Position.Y); TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (hitInfo.HitInfoType == HitInfoType.Cell) { tree.SetFocusedNode(hitInfo.Node); } if (tree.FocusedNode != null) { //popupMenuTree.ShowPopup(p); _currentTreeDataModel = (TreeDataModel)tree.GetRow(tree.FocusedNode.Id); } } //左键编辑 if (e.Button == MouseButtons.Left && ModifierKeys == Keys.None && treeList1.State == TreeListState.NodePressed) { Point p = new Point(Cursor.Position.X, Cursor.Position.Y); TreeListHitInfo hitInfo = tree.CalcHitInfo(e.Location); if (hitInfo.HitInfoType == HitInfoType.Cell) { tree.SetFocusedNode(hitInfo.Node); } if (tree.FocusedNode != null && tree.FocusedNode.ParentNode != null) { _currentTreeDataModel = (TreeDataModel)tree.GetRow(tree.FocusedNode.Id); TreeDataModel rootTreeDataModel = (TreeDataModel)tree.GetRow(tree.FocusedNode.RootNode.Id); if (rootTreeDataModel.Code == "LiBusinessManage" && !currentTreeDataModel.isGroup) { if (currentTreeDataModel.Code.Length > 8 && currentTreeDataModel.Code.Substring(0, 8) == "LiReport") { LiForm.Dev.LiReportForm liForm = ReportFormUtil.getReportForm(currentTreeDataModel.Code, LiContext.SystemCode) as LiForm.Dev.LiReportForm; liForm.Text = currentTreeDataModel.Name; PageFormModel pageFormModel = PageFormModel.getInstance(0, liForm, currentTreeDataModel.Code, "", false); AddPageMdi(pageFormModel); } else { if (currentTreeDataModel.Code.Substring(currentTreeDataModel.Code.Length - 4, 4) == "List") { RibbonForm ribbonForm = FormUtil.getVoucherList(currentTreeDataModel.Code.Substring(0, currentTreeDataModel.Code.Length - 4), LiContext.SystemCode); ribbonForm.Text = currentTreeDataModel.Name; PageFormModel pageFormModel = PageFormModel.getInstance(0, ribbonForm, currentTreeDataModel.Code, "", false); AddPageMdi(pageFormModel); } else { LiForm.Dev.LiForm liForm = FormUtil.getVoucher(currentTreeDataModel.Code) as LiForm.Dev.LiForm; liForm.Text = currentTreeDataModel.Name; if (AddPageMdi(PageFormModel.getInstance(0, liForm, currentTreeDataModel.Code))) { liForm.setVoucherNewStatus(); } } } } } } }
public bool ContainPageMdi(PageFormModel pageFormModel) { return(LiContexts.LiContext.ContainPageMdi(pageFormModel)); }
// 打开子窗体方法 public bool AddPageMdi(PageFormModel pageFormModel) { return(LiContexts.LiContext.AddPageMdi(pageFormModel, this)); }