private void button2_Click(object sender, EventArgs e) { if (listBox1.SelectedItem != null) { int id = int.Parse((string)listBox1.SelectedItem); var ctx = new SCMContext(); var qItem = ctx.QINs.Find(id); ctx.q_log_call(DateTime.Now.ToString("MM/dd/yy"), DateTime.Now.ToString("HH:mm tt"), "102", "03", null, qItem.TNo, "0:10':20\""); listBox1.Items.Remove(listBox1.SelectedItem); } }
private void button1_Click(object sender, EventArgs e) { var ext = txtExt.Text; var user = txtUserName.Text; var theDate = Convert.ToDateTime(date.Text, System.Globalization.CultureInfo.InvariantCulture); var dt = theDate.ToString("MM/dd/yy"); var tt = theDate.ToString("HH:mm tt"); var ctx = new SCMContext(); ctx.q_log_call(dt, tt, null, null, "Incoming", phone.Text, null); qid = ctx.QINs.Max(x => x.Id); listBox1.Items.Add(qid.ToString()); qid = 0; }