public ActionResult DeleteConfirmed(int id) { testt testt = db.testts.Find(id); db.testts.Remove(testt); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id")] testt testt) { if (ModelState.IsValid) { db.Entry(testt).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testt)); }
public ActionResult Create([Bind(Include = "id")] testt testt) { if (ModelState.IsValid) { db.testts.Add(testt); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(testt)); }
// GET: testts public ActionResult Index() { tp_jsf_timesheet time = new tp_jsf_timesheet(); Employe ee = new Employe(); var myModel = new testt(); myModel.listA = ee.GetAll(); // ts.Add(tp_jsf_timesheet); return(View(myModel)); /* IEnumerable<tp_jsf_employe> list = ts.GetAll();*/ }
// GET: testts/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } testt testt = db.testts.Find(id); if (testt == null) { return(HttpNotFound()); } return(View(testt)); }
private void recordWithPaymentToolStripMenuItem_Click(object sender, EventArgs e) { try { string company = comboBox1.Text; string contactperson = textBox2.Text; string address = textBox1.Text; Int64 ph = Int64.Parse(maskedTextBox1.Text); string shiptoo = ""; try { shiptoo = textBox3.Text; } catch { shiptoo = ""; } string shipbyy = ""; try { shipbyy = textBox6.Text; } catch { shipbyy = ""; } Int64 shipcost = 0; try { shipcost = Int64.Parse(maskedTextBox2.Text); } catch { shipcost = 0; } string date = dateTimePicker1.Text; Int64 payment = 0; try { payment = Int64.Parse(domainUpDown2.Text); } catch { payment = 0; } string salesperson = ""; try { salesperson = textBox5.Text; } catch { salesperson = ""; } string note = ""; try { note = textBox4.Text; } catch { note = ""; } double total = double.Parse(label9.Text) + shipcost; double paid = double.Parse(label9.Text); double change = 0; string done = "true"; int idd = 0; ado_project d = new ado_project(); d.select_id_Companyname(company, ref idd); d.insert_invoice(company, contactperson, address, ph, shiptoo, shipbyy, shipcost, date, date, payment, salesperson, note, total, paid, change, done, idd); int use_id = 0; d.select_id(company, date, ref use_id); for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { Int64 amount_num = Int64.Parse(dataGridView1.Rows[i].Cells[0].Value.ToString()); int item = int.Parse(dataGridView1.Rows[i].Cells[1].Value.ToString()); string descriiption = dataGridView1.Rows[i].Cells[2].Value.ToString(); Int64 unittprice = Int64.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString()); Int64 ssuptotal = Int64.Parse(dataGridView1.Rows[i].Cells[4].Value.ToString()); //string itemm = ""; //d.select_itemmname(item,ref itemm); d.insert_invoice2(amount_num, item, ssuptotal, use_id); Int64 ref_unmber = 0; d.select_itemname(item, ref ref_unmber); Int64 new_num = ref_unmber - amount_num; d.update_numberitem(item, new_num); } DialogResult dialogResult = MessageBox.Show("Recoding With Payment Done ,Do you Want Print Invoice?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { DataTable2TableAdapter d2 = new DataTable2TableAdapter(); invoiceSet1.DataTable2DataTable dd = new invoiceSet1.DataTable2DataTable(); d2.Fill(dd, use_id); testt rpt = new testt(); rpt.SetDataSource(dd[0].Table); Report_Viewer vd = new Report_Viewer(); vd.crystalReportViewer1.ReportSource = rpt; vd.ShowDialog(); } } catch (Exception) { MessageBox.Show("Try Again"); } textBox3.Text = ""; textBox6.Text = ""; maskedTextBox1.Text = ""; textBox4.Text = ""; textBox5.Text = ""; domainUpDown2.Text = ""; label9.Text = "00.00"; }