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);
            }
        }
        public override void SetParameter(EventBase even)
        {
            ReturnDataToCallerFormDev _event = even as ReturnDataToCallerFormDev;

            this.txtName.Text = _event.Name;
            this.txtCode.Text = _event.Code;
        }
        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);
                        }
                    }
                }
            }
        }