private void CommandManager_Clicked(object sender, EventArgs e)
        {
            int relationID = 0;
            DP_DataRepository RelationData = null;
            //if (EditArea.AreaInitializer.SourceRelationColumnControl != null)
            //{
            //    relationID = EditArea.AreaInitializer.SourceRelationColumnControl.Relationship.ID;
            //    RelationData = EditArea.AreaInitializer.SourceRelationColumnControl.RelatedData;
            //    //if (RelationData != null)
            //    //    RelationData.ValueChanged = true;
            //}

            DP_DataRepository newData = AgentHelper.CreateAreaInitializerNewData(EditArea);

            //var list = AgentHelper.CreateListFromSingleObject<DP_DataRepository>(newData);
            //if (EditArea.AreaInitializer.SourceRelationColumnControl == null)
            //{
            //    EditArea.AreaInitializer.Datas.Add(newData);
            //}
            //else
            //{
            //    EditArea.ChildRelationshipInfo.RelatedData.Add(newData);
            //}
            EditArea.AddData(newData, true);
            //EditArea.ShowDataInDataView(list, false);
        }
示例#2
0
        public void CreateDefaultData()
        {
            bool shouldCreatData = true;

            //if (DataEntryEntity.IsReadonly)
            //{
            //    shouldCreatData = false;
            //}
            //if (AreaInitializer.SourceRelationColumnControl != null)
            //{
            //    if (AreaInitializer.SourceRelationColumnControl.Relationship.IsReadonly)
            //        shouldCreatData = false;
            //}
            if (shouldCreatData)
            {
                shouldCreatData = GetDataList().Count == 0;
            }

            if (shouldCreatData)
            {
                DP_DataRepository newData = AgentHelper.CreateAreaInitializerNewData(this);
                var addResult             = AddData(newData, true);
                if (!addResult)
                {
                    AgentUICoreMediator.GetAgentUICoreMediator.UIManager.ShowInfo("عدم دسترسی به داده پیش فرض و یا داده های وابسته", newData.ViewInfo, Temp.InfoColor.Red);
                }
                //else
                //{

                //}
                //if (AreaInitializer.SourceRelationColumnControl != null)
                //{
                //    if (DataView != null)
                //    {
                //        //////SpecializedDataView.DisableEnableDataSection(true);
                //        //////if (AreaInitializer.BusinessReadOnlyByParent || AreaInitializer.ParentDataItemBusinessReadOnly.Any(x => x == ChildRelationshipInfo.SourceData) || AreaInitializer.SecurityReadOnlyByParent || AreaInitializer.SecurityReadOnly)
                //        //////{
                //        //////    SpecializedDataView.DisableEnableDataSection(false);
                //        //////}
                //    }
                //}
            }
        }