Exemple #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            //Save to DB then close

            if (txtName.Text.Equals("") || txtUrl.Text.Equals(""))
                return;

            using (SABSyncEntities sabSyncEntities = new SABSyncEntities())
            {
                providers feed = new providers
                                     {
                                         name = txtName.Text,
                                         url = txtUrl.Text
                                     };

                sabSyncEntities.AddToproviders(feed);
                sabSyncEntities.SaveChanges();
            }

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
 /// <summary>
 /// Create a new providers object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static providers Createproviders(global::System.Int64 id)
 {
     providers providers = new providers();
     providers.id = id;
     return providers;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the providers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToproviders(providers providers)
 {
     base.AddObject("providers", providers);
 }