Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        internal bool SaveModalItem(string conn)
        {
            var dataComponentModal = new Data.Component.ComponentModal(conn);

            this.ComponentModalItemID = dataComponentModal.SaveModalItem(this.ClientID,
                                                                         this.ComponentModalID,
                                                                         this.ComponentID,
                                                                         this.ChildComponentID);
            if (this.ComponentModalItemID != "")
            {
                foreach (LinkComponentField lf in this.Relations)
                {
                    dataComponentModal.SaveItemRelation(this.ClientID,
                                                        this.ComponentModalItemID,
                                                        lf.ParentField,
                                                        lf.RelatedField,
                                                        lf.Parent,
                                                        lf.Child);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        internal bool SaveRelation(string conn, List <LinkComponentField> lk)
        {
            var dataComponentModal = new Data.Component.ComponentModal(conn);

            foreach (LinkComponentField lf in lk)
            {
                if (this.Relations.Where(x => x.ModalItemRelationID == lf.ModalItemRelationID).FirstOrDefault() == null)
                {
                    dataComponentModal.SaveItemRelation(this.ClientID,
                                                        this.ComponentModalItemID,
                                                        lf.ParentField,
                                                        lf.RelatedField,
                                                        lf.Parent,
                                                        lf.Child);
                }
                else
                {
                    dataComponentModal.UpdateItemRelation(this.ClientID,
                                                          lf.ModalItemRelationID,
                                                          this.ComponentModalItemID,
                                                          lf.ParentField,
                                                          lf.RelatedField);
                }
            }
            return(true);
        }