Esempio n. 1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, HtStandardEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 2
0
 public ActionResult SaveForm(string keyValue, HtStandardEntity entity)
 {
     htstandardbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }
Esempio n. 3
0
        /// <summary>
        /// 获取机构部门组织树菜单
        /// </summary>
        /// <returns></returns>
        //[HttpGet]
        public ActionResult GetStandardTreeJson(string isCheck, string ids = "", string selIds = "", string tid = "")
        {
            //暂时取所有,后期用户权限开发完成,数据将通过权限下来进行展示
            Operator user = OperatorProvider.Provider.Current();

            selIds = "," + selIds.Trim(',') + ",";
            var treeList = new List <TreeEntity>();

            var where = string.Format(" and CreateUserOrgCode='{0}' or Id='0'", user.OrganizeCode);
            var data = htstandardbll.GetList(where).OrderBy(t => t.EnCode).ToList();

            try
            {
                StringBuilder sb = new StringBuilder();
                if (!string.IsNullOrEmpty(tid))
                {
                    HtStandardEntity hs = htstandardbll.GetEntity(tid);
                    if (hs != null)
                    {
                        DataTable dt = new ERCHTMS.Busines.BaseManage.DepartmentBLL().GetDataTable(string.Format("select id from BIS_HTSTANDARD t where instr('{0}',encode)=1", hs.EnCode));
                        foreach (DataRow dr in dt.Rows)
                        {
                            sb.AppendFormat("{0},", dr[0].ToString());
                        }
                    }
                }
                if (!string.IsNullOrWhiteSpace(ids))
                {
                    ids = ids.Trim(',');
                    ids = "," + ids + ",";
                }
                foreach (HtStandardEntity item in data)
                {
                    if (!selIds.Contains("," + item.Id + ","))
                    {
                        string     hasChild = htstandardbll.IsHasChild(item.Id) ? "1" : "0";
                        TreeEntity tree     = new TreeEntity();
                        tree.id       = item.Id;
                        tree.text     = item.Name.Replace("\n", "").Replace("\\", "╲");
                        tree.value    = item.Id;
                        tree.parentId = item.Parentid;
                        tree.isexpand = (item.Parentid == "-1") ? true : false;
                        tree.complete = true;
                        if (!string.IsNullOrWhiteSpace(ids))
                        {
                            tree.checkstate = ids.Contains("," + item.Id + ",") ? 1 : 0;
                        }
                        tree.hasChildren = hasChild == "1" ? true : false;
                        tree.Attribute   = "Code";
                        tree.showcheck   = string.IsNullOrEmpty(isCheck) ? false : true;
                        if (!string.IsNullOrEmpty(tid))
                        {
                            if (sb.ToString().Contains(item.Id))
                            {
                                tree.isexpand = true;
                            }
                        }
                        tree.AttributeValue = item.EnCode + "|" + hasChild;
                        treeList.Add(tree);
                    }
                }
                return(Content(treeList.TreeToJson("-1")));
            }
            catch (Exception ex)
            {
                return(Error(ex.Message));
            }
        }