예제 #1
0
        public async Task <ActionResult> LoadMainTainModule(string modId, string subModId, string parram, [FromBody] List <ModuleFieldInfo> fieldsInfos)
        {
            var outPut = new RestOutput <object>();

            try
            {
                var m_Client = new CoreController(_configuration);
                var data     = m_Client.LoadMainTainModule(modId);
                MaintainModuleInfo modMaintain = null;
                var store = "";
                if (data.Any())
                {
                    modMaintain = data.First();
                    store       = CommonFunction.GetStoreRunModMaintain(modMaintain, subModId ?? ESubMod.MVW.ToString());
                }
                var fields = CommonFunction.GetModuleFields(fieldsInfos, modId, FLDGROUP.PARAMETER);
                var cm     = new WebApiCore.CommonFunction();
                var lst    = new List <string>();
                if (!string.IsNullOrEmpty(store))
                {
                    var param = m_Client.DiscoveryParameters(store.IndexOf(".") > 0 ? store : store);
                    cm.GetNpgsqlParameterValues(param, fields);
                    var dataStore = m_Client.RunStoreToDataTable(store, param);
                    outPut.Data = JsonConvert.SerializeObject(dataStore);
                    return(Ok(outPut));
                }
                return(Ok(outPut));
            }
            catch (Exception ex)
            {
                outPut.ResultCode = -1;
                outPut.Message    = ex.ToString();
                return(Ok(outPut));
            }
        }
예제 #2
0
        public async Task <ActionResult> LoadModMaintainByModId(string modId)
        {
            var outPut = new RestOutput <List <MaintainModuleInfo> >();

            try
            {
                var m_Client = new CoreController(_configuration);
                var data     = m_Client.LoadMainTainModule(modId);
                outPut.Data = data;
                return(Ok(outPut));
            }
            catch (Exception ex)
            {
            }
            return(Ok(outPut));
        }