예제 #1
0
        public ActionResult updateDept(eFunctionItem dept, string userId)
        {
            dept.UPDATE_UID = Session["UserId"].ToString();
            dynamic   showMessageString = string.Empty;
            DataTable dtResult          = aFunctionAccess.updateFunction(dept);
            string    strResult         = dtResult.Rows[0][0].ToString();
            string    strMes            = dtResult.Rows[0][1].ToString();

            showMessageString = new
            {
                param1 = 200,
                param2 = strResult,
                param3 = strMes
            };

            try
            {
                Session["func_tree"] = null;
                return(Json(showMessageString, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                var errorMsg = ex.Message.ToString();
                showMessageString = new
                {
                    param1 = 404,
                    param2 = "error",
                    param3 = "proccess error"
                };
                return(Json(showMessageString, JsonRequestBehavior.AllowGet));
            }
        }
예제 #2
0
        public JsonResult getDeptDetail(string deptcode)
        {
            eFunctionItem eResult   = new eFunctionItem();
            DataTable     dtResult  = aFunctionAccess.getFunctionDetail(deptcode);
            dynamic       strResult = string.Empty;

            strResult = new
            {
                parent_name   = dtResult.Rows[0]["PARENTNAME"].ToString(),
                deptcode      = dtResult.Rows[0]["FUNCCODE"].ToString(),
                deptName      = dtResult.Rows[0]["FUNCNAME"].ToString(),
                deptParent    = dtResult.Rows[0]["FUNCPARENT"].ToString(),
                deptShortName = dtResult.Rows[0]["SHORTNAME"].ToString(),
                isActive      = dtResult.Rows[0]["ISACTIVE"].ToString()
            };
            return(Json(strResult, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        private static List <eFunctionItem> getFunctionTree()
        {
            List <eFunctionItem> lstResult = new List <eFunctionItem>();
            DataTable            dtResult  = new DataTable();

            dtResult = aFunctionAccess.getAllFunction();
            foreach (DataRow dtr in dtResult.Rows)
            {
                eFunctionItem item = new eFunctionItem();
                item.FUNCCODE   = dtr["FUNCCODE"].ToString();
                item.FUNCNAME   = dtr["FUNCNAME"].ToString();
                item.FUNCPARENT = dtr["FUNCPARENT"].ToString();
                item.ISLEAF     = dtr["ISLEAF"].ToString();
                lstResult.Add(item);
            }
            return(lstResult);
        }
예제 #4
0
        public static DataTable updateFunction(eFunctionItem dept)
        {
            DataTable dtResult = new DataTable();

            OracleParameter[] _sqlParam = new OracleParameter[6];
            _sqlParam[0] = new OracleParameter("PDEPTCODE", string.IsNullOrEmpty(dept.FUNCCODE) ? "" : dept.FUNCCODE);
            _sqlParam[1] = new OracleParameter("pDeptName", string.IsNullOrEmpty(dept.FUNCNAME) ? "" : dept.FUNCNAME);
            _sqlParam[2] = new OracleParameter("pDeptShortName", string.IsNullOrEmpty(dept.SHORTNAME) ? "" : dept.SHORTNAME);
            _sqlParam[3] = new OracleParameter("pIsActive", dept.ISACTIVE);
            _sqlParam[4] = new OracleParameter("pUserId", dept.UPDATE_UID);
            _sqlParam[5] = new OracleParameter("T_TABLE", OracleDbType.RefCursor)
            {
                Direction = ParameterDirection.Output
            };
            dtResult = DBHelper.getDataTable_SP("PKHR_FUNC_ORG_VER2.SP_UPDATE_FUNCTION", _sqlParam);
            return(dtResult);
        }