protected void ButtonInsert_Click(object sender, EventArgs e) { try { Zi zi = new Zi(); zi.Data = DateTime.Now; // radiobutton insert if (RadioButtonYes.Checked) { zi.Checked = "Yes"; } if (RadioButtonNo.Checked) { zi.Checked = "No"; } if (RadioButtonYesSolved.Checked) { zi.Solved = "YesS"; } if (RadioButtonNoSolved.Checked) { zi.Solved = "NoS"; } zi.Comments = TextBox2.Text; Zi.Insert(zi); MessageBox.Show("Inserted"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { GridView1.DataSource = Zi.Get(null).ToList(); GridView1.DataBind(); DropDownListTest.DataSource = Zi.Get(null).ToList(); DropDownListTest.DataBind(); DropDownListTest.DataTextField = "Data"; DropDownListTest.DataValueField = "ID"; DropDownListTest.DataBind(); }
public static Zi[] GetZis(int numberOfZis) { var zis = new Zi[numberOfZis]; for (int i = 0; i < numberOfZis; i++) { int k = random.Next(1, Hanzi.StartWith_B.Count); zis[i] = new Zi(Hanzi.StartWith_B[k]); } return(zis); }
public override string ToString() { return(Zi.ToString() + "/" + Luna + "/" + An); }
protected void TextBox2_TextChanged(object sender, EventArgs e) { TextBox3.Text = Zi.Get(null).Where(p => p.Comments == TextBox2.Text).FirstOrDefault().Data.ToString(); }