コード例 #1
0
        public void UpdateFilter(XElement xml)
        {
            Storage.ExecuteNonQueryXML("EXEC [model].[EntityFilterUpdate] @xml", xml.ToString());


            //using (var c = new SqlConnection(Global.ConnectionString))
            //using (var cmd = new SqlCommand("EXEC [model].[EntityFilterUpdate] @xml", c))
            //{
            //    cmd.Parameters.Add("xml", DbType.String).Value = xml.ToString();// GenerateXml(EntityFilter).ToString();
            //    c.Open();

            //    cmd.ExecuteNonQuery();
            //}

            Storage.ClearInstanceCache(typeof(EntityFilter), EntityFilter.ID);
            if (EntityFilter.Name != null)
            {
                (TemplateSavedMessageBox.FindControl("LabelShowNameTemplate") as Label).Text = string.Format("Фильтр «{0}» успешно сохранён.", EntityFilter.Name);
                TemplateSavedMessageBox.Show();
            }
        }
コード例 #2
0
        public void ApplyCopyFilterButton_Click(object sender, EventArgs e)
        {
            SaveToCache();

            string name = (CopyFilterDialog.FindControl("InsertNameBox") as TextBox).Text;

            ErrorsChecking(name, true);

            entityFilter.Name = name;

            var xml = GenerateXml(entityFilter);

            CreateFilter(xml);
            var filterID = GetFilterID(name, entityFilter.Entity.ID.ToString());

            CopyFilterDialog.Close();

            var entityListAttributeView = this.Parent;
            var FilterList = entityListAttributeView.FindControl("FilterList") as DropDownList;

            FilterList.Items.Clear();
            FilterList.Items.Add(new ListItem("не выбрано", ""));
            FilterList.DataBind();
            FilterList.SelectedValue = filterID;

            this.DataBind();
            this.EntityFilterID = int.Parse(filterID);

            if (EntityFilter.Name != null)
            {
                (TemplateSavedMessageBox.FindControl("LabelShowNameTemplate") as Label).Text = string.Format("Фильтр «{0}» успешно сохранён.", EntityFilter.Name);
                TemplateSavedMessageBox.Show();
            }

            if (ButtonSaveClick != null)
            {
                ButtonSaveClick(this, e);
            }
        }