コード例 #1
0
        public string AddOrModifyAsync([FromForm] FieldRelation model)
        {
            BaseResult baseResult = new BaseResult();

            try
            {
                if (model != null)
                {
                    //if (!string.IsNullOrWhiteSpace(model.ScontrollerName))
                    //{
                    //    if (await _FieldRelationService.AddOrModifyFieldRelationAsync(model, User.Identity.Name) != null)
                    //    {
                    //        baseResult.Code = 0;
                    //        baseResult.Msg = "操作成功!";
                    //    }
                    //    else
                    //    {
                    //        baseResult.Code = 1;
                    //        baseResult.Msg = "操作失败!";
                    //    }
                    //}
                    //else
                    //{
                    //    baseResult.Code = 3;
                    //    baseResult.Msg = "控制器名称不能为空!";
                    //}
                }
            }
            catch (Exception ex)
            {
                baseResult.Code = 3;
                baseResult.Msg  = ex.Message;
            }
            return(JsonHelper.ObjectToJSON(baseResult));
        }
コード例 #2
0
        public async Task <FieldRelation> AddOrModifyFieldRelationAsync(FieldRelation model, string sOperator)
        {
            FieldRelation entityFieldRelation;

            if (model.Id == 0)
            {
                entityFieldRelation = _mapper.Map <FieldRelation>(model);
                await _FieldRelationRepository.AppendAsync(entityFieldRelation, sOperator);
            }
            else
            {
                entityFieldRelation = await _FieldRelationRepository.SelectAsync(model.Id);

                if (entityFieldRelation != null)
                {
                    //_mapper.Map(model, entityFieldRelation);
                    entityFieldRelation.IforeignkeyId = model.IforeignkeyId;
                    entityFieldRelation.IprimarykeyId = model.IprimarykeyId;
                    _FieldRelationRepository.Update(entityFieldRelation, sOperator);
                }
            }
            return(entityFieldRelation);
        }
コード例 #3
0
ファイル: frmTest.cs プロジェクト: Pelsoft/fwk_10.3
        /// <summary>
        /// Genera nodos a partir de la navegaci�n de claves foraneas que referencian a la tabla.
        /// </summary>
        /// <param name="pParentNode">Nodo padre.</param>
        /// <date>2006-04-05T00:00:00</date>
        /// <author>moviedo</author>
        private void GenerateChildNodes(TreeNode pParentNode, ref Tables pTablas)
        {
            string wTableName = string.Empty;
        
            FieldRelationList wRelatedFields;
            try
            {
                if (pParentNode.Nodes.Count == 0)
                {
                 

                    foreach (Table wTabla in pTablas)
                        
                    {
                        TreeNode wTreeNodeTable = AddChildNode(pParentNode, wTabla.Name);

                         wRelatedFields = new FieldRelationList();

                         foreach (Column wColumn in wTabla.Columns)
                        {
                            if (wColumn.IsIdentity)
                            {
                                FieldRelation wRelation = new FieldRelation();

                                wRelation.FieldName = wColumn.Name;
                                wRelation.ParentFieldName = wColumn.Name; 
                                wRelatedFields.Add(wRelation);

                                AddChildNode(wTreeNodeTable, wColumn.Name, wRelatedFields);
                            }
                            else { AddChildNode(wTreeNodeTable, wColumn.Name); }
                           
                        }

                       

                    }

                    pParentNode.Expand();

                }


            }
            catch (Exception ex)
            {
                throw ex;
            }
           
        }
コード例 #4
0
 public string LoadData(PageInfo <FieldRelation> pageInfo, FieldRelation oSearchEntity = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     return(JsonHelper.ObjectToJSON(_FieldRelationService.GetPageList(pageInfo, oSearchEntity, sOperator, iOrderGroup, sSortName, sSortOrder)));
 }
コード例 #5
0
 public int Append(FieldRelation entityFieldRelation, string sOperator)
 {
     return(_FieldRelationRepository.Append(entityFieldRelation, sOperator));
 }
コード例 #6
0
 public async Task <int> AppendAsync(FieldRelation entityFieldRelation, string sOperator)
 {
     return(await _FieldRelationRepository.AppendAsync(entityFieldRelation, sOperator));
 }
コード例 #7
0
 public async Task <FieldRelation> SelectAsync(FieldRelation entityFieldRelation = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     return(await _FieldRelationRepository.SelectAsync(entityFieldRelation, sOperator, iOrderGroup, sSortName, sSortOrder));
 }
コード例 #8
0
 public FieldRelation Select(FieldRelation entityFieldRelation = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     return(_FieldRelationRepository.Select(entityFieldRelation, sOperator, iOrderGroup, sSortName, sSortOrder));
 }
コード例 #9
0
 public List <FieldRelation> SelectALL(FieldRelation entityFieldRelation = null, string sOperator = null, int iOrderGroup = 0, int iMaxCount = 0, string sSortName = null, string sSortOrder = null)
 {
     return(_FieldRelationRepository.SelectALL(entityFieldRelation, sOperator, iOrderGroup, iMaxCount, sSortName, sSortOrder));
 }
コード例 #10
0
 public PageInfo <FieldRelation> GetPageList(PageInfo <FieldRelation> pageInfo, FieldRelation oSearchEntity = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     return(_FieldRelationRepository.GetPageList(pageInfo, oSearchEntity, sOperator, iOrderGroup, sSortName, sSortOrder));
 }