예제 #1
0
        public JObject AddEntityRecords(string value1, string value2, string value3)
        {
            var sourceEntity     = new JavaScriptSerializer().Deserialize <string>(value1);
            var sourceEntityId   = new JavaScriptSerializer().Deserialize <string>(value2);
            var targetEntityList = new JavaScriptSerializer().Deserialize <List <string> >(value3);

            foreach (var tmpValue in targetEntityList)
            {
                var data = new FundXLegalEntityDataModel();

                if (sourceEntity == "Fund")
                {
                    data.FundId        = int.Parse(sourceEntityId);
                    data.LegalEntityId = int.Parse(tmpValue);
                }
                else if (sourceEntity == "LegalEntity")
                {
                    data.LegalEntityId = int.Parse(sourceEntityId);
                    data.FundId        = int.Parse(tmpValue);
                }

                FundXLegalEntityDataManager.Create(data, SessionVariables.RequestProfile);
            }

            var jObject = new JObject();

            jObject["Result"] = true;
            return(jObject);
        }
예제 #2
0
        public JObject RemoveEntityRecords(string value, string value1)
        {
            var sourceEntity = new JavaScriptSerializer().Deserialize <string>(value);
            var dataQuery    = new FundXLegalEntityDataModel();

            if (sourceEntity == "Fund")
            {
                var FundId = new JavaScriptSerializer().Deserialize <string>(value1);
                dataQuery.FundId = int.Parse(FundId);
            }
            else if (sourceEntity == "LegalEntity")
            {
                var LegalEntityId = new JavaScriptSerializer().Deserialize <string>(value1);
                dataQuery.LegalEntityId = int.Parse(LegalEntityId);
            }
            else
            {
                dataQuery.FundId        = -1;
                dataQuery.LegalEntityId = -1;
            }

            FundXLegalEntityDataManager.Delete(dataQuery, SessionVariables.RequestProfile);

            var jObject = new JObject();

            jObject["Result"] = true;
            return(jObject);
        }
예제 #3
0
        public IEnumerable <FundXLegalEntityDataModel> GetEntityRecords(string value, string value1)
        {
            var sourceEntity = new JavaScriptSerializer().Deserialize <string>(value);
            var dataQuery    = new FundXLegalEntityDataModel();

            if (sourceEntity == "Fund")
            {
                var FundId = new JavaScriptSerializer().Deserialize <string>(value1);
                dataQuery.FundId = int.Parse(FundId);
            }
            else if (sourceEntity == "LegalEntity")
            {
                var LegalEntityId = new JavaScriptSerializer().Deserialize <string>(value1);
                dataQuery.LegalEntityId = int.Parse(LegalEntityId);
            }

            return(FundXLegalEntityDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile, 0));
        }