private Category getBorrowDownKey(string enumKey, string name, string queryField, string type, bool hasAllAttr = true) { var enumServcie = FormulaHelper.GetService <IEnumService>(); var dataTable = enumServcie.GetEnumTable(enumKey, type); var category = new Category(); category.Name = name; category.Key = queryField; category.QueryField = queryField; if (hasAllAttr) { var item = new CategroyItem(); item.Name = "全部"; item.Value = "All"; item.SortIndex = 0; item.IsDefault = true; category.Items.Add(item); } for (int i = 0; i < dataTable.Rows.Count; i++) { var dataRow = dataTable.Rows[i]; var item = new CategroyItem(); item.Name = dataRow["text"].ToString(); item.Value = dataRow["value"].ToString(); item.SortIndex = i + 1; category.Items.Add(item); } return(category); }
public ActionResult TabList() { string projectID = this.GetQueryString("ProjectID"); var tab = new Tab(); string sql = @"select mc.* from S_C_ManageContract as mc left join S_C_ManageContract_ProjectRelation as cpr on mc.ID=cpr.S_C_ManageContractID where cpr.ProjectID='{0}' and IsSigned='Signed' order by SignDate desc"; sql = string.Format(sql, projectID); var dt = this.SqlHelper.ExecuteDataTable(sql); Category contractItem = new Category(); contractItem.Key = ""; contractItem.Name = "已签合同"; for (int i = 0; i < dt.Rows.Count; i++) { var dataRow = dt.Rows[i]; var item = new CategroyItem(); item.Name = dataRow["Name"].ToString(); item.Value = dataRow["ID"].ToString(); item.SortIndex = i + 1; contractItem.Items.Add(item); if (i == 0) { contractItem.SetDefaultItem(item.Value); } } contractItem.Multi = false; tab.Categories.Add(contractItem); tab.IsDisplay = true; ViewBag.Tab = tab; return(View()); }
public ActionResult TabList() { string projectID = this.GetQueryString("ProjectID"); var tab = new Tab(); string sql = @"select * from S_SP_SupplierContract where State='Sign' and ProjectInfo='{0}' order by SignDate desc"; sql = string.Format(sql, projectID); var dt = this.MarketSQLDB.ExecuteDataTable(sql); Category contractItem = new Category(); contractItem.Key = ""; contractItem.Name = "已签分包合同"; for (int i = 0; i < dt.Rows.Count; i++) { var dataRow = dt.Rows[i]; var item = new CategroyItem(); item.Name = dataRow["Name"].ToString(); item.Value = dataRow["ID"].ToString(); item.SortIndex = i + 1; contractItem.Items.Add(item); if (i == 0) { contractItem.SetDefaultItem(item.Value); } } contractItem.Multi = false; tab.Categories.Add(contractItem); tab.IsDisplay = true; ViewBag.Tab = tab; return(View()); }
public ActionResult List() { string modeCode = this.GetQueryString("ProjectModeCode"); var mode = Project.Logic.BaseConfigFO.GetMode(modeCode); if (mode == null) { throw new Formula.Exceptions.BusinessException("未能找到编号为【" + modeCode + "】的管理模式"); } var tab = new Tab(); var list = mode.S_T_ISODefine.Select(d => new { text = d.Name, value = d.ID, sortIndex = d.SortIndex }).OrderBy(p => p.sortIndex).ToList(); var catagory = new Formula.Category(); catagory.Name = "表单类型"; catagory.DisplayName = "表单类型"; catagory.Key = "ISODefineType"; catagory.QueryField = "ISODefineType"; catagory.Multi = false; foreach (var define in list) { var item = new CategroyItem(); item.Name = define.text; item.Value = define.value; item.SortIndex = define.sortIndex.HasValue ? define.sortIndex.Value : 0; catagory.Items.Add(item); } catagory.SetDefaultItem(list.FirstOrDefault().value); tab.Categories.Add(catagory); var deptCategory = CategoryFactory.GetCategory("Market.ManDept", "责任部门", "ProjectChargeDeptID"); deptCategory.SetDefaultItem(); deptCategory.Multi = false; tab.Categories.Add(deptCategory); var phaseCategory = CategoryFactory.GetCategory("Project.Phase", "设计阶段", "ProjectInfoPhaseValue"); phaseCategory.SetDefaultItem(); phaseCategory.Multi = false; tab.Categories.Add(phaseCategory); var projectClassCategory = CategoryFactory.GetCategory("Base.ProjectClass", "业务类型", "ProjectInfoClass"); projectClassCategory.SetDefaultItem(); projectClassCategory.Multi = false; tab.Categories.Add(projectClassCategory); var stateCategory = CategoryFactory.GetCategory(typeof(Project.Logic.ProjectCommoneState), "项目状态", "ProjectInfoState"); stateCategory.SetDefaultItem(); stateCategory.Multi = false; tab.Categories.Add(stateCategory); var flowCategory = CategoryFactory.GetCategory("FlowPhase", "流程状态", "FlowPhase"); flowCategory.SetDefaultItem(); flowCategory.Multi = false; tab.Categories.Add(flowCategory); tab.IsDisplay = true; ViewBag.Tab = tab; return(View()); }