/// <summary> /// 将计划表绑定到计划列表GridView控件 /// </summary> /// <param name="dtPlans">数据源</param> private void BindgvPlans(DataTable dtPlans) { try { DataTable dtActions = (DataTable)ViewState["dtActions"]; //扩展计划表,增加一个字段"Title",保存操作的名称,也是计划的名称 DataTable dtTemp = dtPlans.Copy(); dtTemp.Columns.Add("Title"); foreach (DataRow drTemp in dtTemp.Rows) { int actionId = SystemDataExtension.GetInt16(drTemp, "ActionID"); DataRow drAction = ActionBLL.GetActionByID(actionId, dtActions); drTemp.BeginEdit(); drTemp["Title"] = drAction["Title"]; drTemp.EndEdit(); } dtTemp.AcceptChanges(); //绑定分级计划列表 DataTable dtLPlans = TaskBLL.GetTasksWithLevel(dtTemp, "Title", "ParentID", false); gvPlans.DataSource = dtLPlans; gvPlans.DataBind(); } catch (Exception ex) { lbErr.Text = ex.ToString(); } }
public ActionResult EditActionInfo(int id) { var obj = ActionBLL.GetActionByID(id); if (obj.DataResult == null) { return(Content(obj.Message)); } int areaID = obj.DataResult.AreaID; obj.DataResult.AreasSelectList = new SelectList(AreaBLL.GetAreas(), "ID", "AreaName", areaID); obj.DataResult.ControllersSelectList = new SelectList(ControllerBLL.GetControllersByAreaID(areaID), "ID", "ControllerName"); return(PartialView("_EditActionInfo", obj.DataResult)); }
/// <summary> /// 新增编辑弹窗 /// </summary> /// <returns></returns> public ActionResult Dialog() { string actionId = Request["Id"]; if (string.IsNullOrEmpty(actionId) || actionId == "0") { SYS_Action ac = new SYS_Action() { ActionNum = "自动生成" }; return(View(ac)); } string errMsg = string.Empty; SYS_Action actionModel = actionBLL.GetActionByID(Convert.ToInt32(actionId), ref errMsg); if (string.IsNullOrEmpty(errMsg)) { //记录操作日志 //Common.LogHelper.InsertLog(String.Format("新增权限,ID-{0}", actionModel.ID.ToString()), 51, "权限列表"); return(View(actionModel)); } return(View(new SYS_Action())); }