private void button1_Click(object sender, EventArgs e) { //Fix Button if (PostIdentity != 0) { Coe25DBDataContext db = new Coe25DBDataContext(); List<tbl_History> history = (from m in db.tbl_Histories where m.PostID == PostIdentity && m.IsFixed == false select m).ToList(); if (history.Count > 0) { history.ForEach(delegate(tbl_History hist) { hist.IsFixed = true; }); db.SubmitChanges(); MessageBox.Show("POST is Fix."); SetListBox(); } } }
private void button3_Click(object sender, EventArgs e) { try { tbl_Cluster cluster = new tbl_Cluster(); cluster.UniqueCode = this.textBox2.Text; cluster.ClusterPhoneNumber = this.textBox1.Text; cluster.CreateDate = DateTime.UtcNow; Coe25DBDataContext db = new Coe25DBDataContext(); db.tbl_Clusters.InsertOnSubmit(cluster); db.SubmitChanges(); db.Dispose(); CreateNewCluster = cluster.UniqueCode; this.Close(); } catch { } }