Exemplo n.º 1
0
        public override void SetParameter(EventBase even)
        {
            ReturnDataToCallerFormDev _event = even as ReturnDataToCallerFormDev;
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(_event.ReturnSetXml);
            XmlNodeList xmlNodeList = xmlDoc.SelectNodes("ReturnSet/Return");
            DataRow     dr;
            bool        warningRow;

            this.dtReturnData.Rows.Clear();
            foreach (XmlNode xmlNode in xmlNodeList)
            {
                warningRow = false;
                dr         = dtReturnData.NewRow();
                if (_windowComponentService.CheckElementExistByCode
                        (xmlNode.Attributes["FormElementCode"].Value) == false)
                {
                    warningRow = true;
                }
                dr["FormElementCode"] = xmlNode.Attributes["FormElementCode"].Value;
                dr["Source"]          = xmlNode.Attributes["Source"].Value;
                dr["SourceName"]      =
                    StringParserLogic.DataSourceVisibleString(this.HostAdapter.HostFormEntity, xmlNode.Attributes["Source"].Value, out warningRow);
                dr["Warning"] = warningRow;
                dtReturnData.Rows.Add(dr);
            }
        }
Exemplo n.º 2
0
        public static void CheckWarning(DataListAddRowDev entity)
        {
            entity.Warning.Clear();
            if (entity.TargetWindow == EnumTargetWindow.Current)
            {
                if (entity.HostFormEntity.Elements.Contains(entity.DataList) == false)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_DataListOperatorDev_DataListNotExist);
                }
                else
                {
                    foreach (DataListAddRowEvent.DataItem data in entity.Data)
                    {
                        if (entity.HostFormEntity.Elements.Contains(data.DataColumn) == false)
                        {
                            entity.Warning.AddWarningSign(entity, Language.Current.EventDev_DataListOperatorDev_DataColumnNotExist);
                        }
                    }
                }
            }
            else if (entity.TargetWindow == EnumTargetWindow.Caller)
            {
                if (_windowComponentService.CheckElementExistByCode(
                        entity.DataList, FormElementEntityDevTypes.Instance.GetProvideAttribute(typeof(UIElementDataListEntity))) == false)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_DataListOperatorDev_DataListNotExist);
                }
                else
                {
                    foreach (DataListAddRowEvent.DataItem data in entity.Data)
                    {
                        if (_windowComponentService.CheckDataColumnExistByCode(entity.DataList, data.DataColumn) == false)
                        {
                            entity.Warning.AddWarningSign(entity, Language.Current.EventDev_DataListOperatorDev_DataColumnNotExist);
                        }
                    }
                }
            }
            DataSourceProvideArgs args = new DataSourceProvideArgs()
            {
                WindowEntity = entity.HostFormEntity
            };

            foreach (DataListAddRowEvent.DataItem data in entity.Data)
            {
                if (_dataSourceProvideFactory.Validate(data.Source, args) == false)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_DataListOperatorDev_FormElementNotExist);
                }
            }
        }
        public static void CheckWarning(ReturnDataToCallerFormDev entity)
        {
            entity.Warning.Clear();
            XmlDocument xmlDocReturnSet = new XmlDocument();

            xmlDocReturnSet.LoadXml(entity.ReturnSetXml);
            XmlNodeList xmlNodeListReturnSet = xmlDocReturnSet.SelectNodes("ReturnSet/Return");

            string[] strSource;
            UIElementDataListEntity sourceDataListEntity;

            foreach (XmlNode xmlNode in xmlNodeListReturnSet)
            {
                if (_windowComponentService.CheckElementExistByCode
                        (xmlNode.Attributes["FormElementCode"].Value) == false)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_ReturnDataToCallerFormDev_FormElementNotExist);
                }
                strSource = xmlNode.Attributes["Source"].Value.Split('.');
                if (entity.HostFormEntity.Elements.Contains(strSource[1]) == false)
                {
                    entity.Warning.AddWarningSign(entity, Language.Current.EventDev_ReturnDataToCallerFormDev_FormElementNotExist);
                }
                if (strSource.Length == 3)
                {
                    sourceDataListEntity =
                        entity.HostFormEntity.Elements.GetFormElementById(strSource[1]) as UIElementDataListEntity;
                    if (sourceDataListEntity != null)
                    {
                        if (sourceDataListEntity.DataColumns.Contains(strSource[2]) == false)
                        {
                            entity.Warning.AddWarningSign(entity, Language.Current.EventDev_ReturnDataToCallerFormDev_FormElementNotExist);
                        }
                    }
                }
            }
        }