Exemple #1
0
        public List <DictionaryEntryDto> GetDictionaryByCode(d_general_table tableInfo)
        {
            string where = $"SELECT * FROM d_general WHERE general_table_id='{tableInfo.id}' and delete_time = 0";
            List <d_general>          all  = FindListBySql(QueryStringDeleteFlag(where));
            List <DictionaryEntryDto> list = new List <DictionaryEntryDto>();

            if (all == null)
            {
                return(list);
            }
            foreach (var entry in all)
            {
                //if (entry.is_default == 1)
                //    list.Add(new DictionaryEntryDto(entry.code.ToString(), entry.name, 1));
                //else
                list.Add(new DictionaryEntryDto(entry.code, entry.name));
            }

            return(list);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["tableId"]))
            {
                int.TryParse(Request.QueryString["tableId"], out tableId);
            }
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                thisGeneral = genBll.GetSingleGeneral(id);
            }
            long parentId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["parnetId"]) && long.TryParse(Request.QueryString["parnetId"], out parentId))
            {
                parentGeneral = genBll.GetSingleGeneral(parentId);
            }
            if (thisGeneral != null)
            {
                isAdd   = false;
                tableId = thisGeneral.general_table_id;
                if (tableId == (int)GeneralTableEnum.PRODUCT_CATE && thisGeneral.parent_id != null)
                {
                    parentGeneral = genBll.GetSingleGeneral((long)thisGeneral.parent_id);
                }
            }

            if (tableId == 0)
            {
                Response.Write("<script>alert('未获取到相关信息,请刷新页面后重试!');window.close();</script>");
                return;
            }
            thisTable = new DAL.d_general_table_dal().FindById(tableId);
            if (tableId == (int)GeneralTableEnum.TICKET_STATUS)
            {
                tempList = genBll.GetGeneralByTable((int)GeneralTableEnum.SLA_EVENT_TYPE);
            }
            else if (tableId == (int)GeneralTableEnum.PAYMENT_SHIP_TYPE)
            {
                codeList = new CostCodeBLL().GetCodeByCate((int)DicEnum.COST_CODE_CATE.MATERIAL_COST_CODE);
            }
            if (tableId == (int)GeneralTableEnum.PROJECT_STATUS && thisGeneral != null && thisGeneral.is_system == 1)
            {
                Response.Write("<script>alert('系统状态,不能编辑!');window.close();</script>");
                return;
            }

            if (tableId == (int)GeneralTableEnum.ACTION_TYPE)
            {
                tempList = new List <d_general>()
                {
                    genBll.GetSingleGeneral((long)DicEnum.ACTIVITY_CATE.PROJECT_NOTE, true),
                    genBll.GetSingleGeneral((long)DicEnum.ACTIVITY_CATE.CONTRACT_NOTE, true),
                    genBll.GetSingleGeneral((long)DicEnum.ACTIVITY_CATE.TASK_NOTE, true),
                };
            }
            if (tableId == (int)GeneralTableEnum.SYSTEM_SUPPORT_EMAIL)
            {
                var email = genBll.GetSupportEmail();
                if (email != null && isAdd)
                {
                    Response.Write("<script>alert('系统支持邮箱只能有一条!');window.close();</script>");
                    return;
                }
            }
            if (tableId == (int)EMT.DoneNOW.DTO.GeneralTableEnum.SYS_TICKET_RESOLUTION_METRICS && isAdd)
            {
                Response.Write("<script>alert('工单解决参数设置不允许新增!');window.close();</script>");
                return;
            }
            if (tableId == (int)EMT.DoneNOW.DTO.GeneralTableEnum.PRODUCT_CATE)
            {
                tempList = genBll.GetGeneralByTable((int)GeneralTableEnum.INSTALLED_PRODUCT_CATE);
            }
        }