private void InsertSalesInfo(object sender, EventArgs e) { rand = r.Next(111111, 999999); salesIDBox.Text = "sales" + rand; SalesRep sr = new SalesRep(); sr.SalesID = this.salesIDBox.Text; sr.CustName = this.custnameBox.Text; sr.CustAddress = this.custadbox.Text; sr.CustContacts = this.custcontactBox.Text; sr.CustMail = this.custmailBox.Text; sr.VecModel = this.modelBox.Text; sr.VecNetCost = this.costBox.Text; sr.Payment = this.combopaymentBox.Text; sr.Date = this.dateTimePicker2.Text; sr.SalesInvoice = i; Console.WriteLine(i); SalesRepositoryDB srdb = new SalesRepositoryDB(); if (srdb.Insert(sr)) { MessageBox.Show("Insert Completed!", "Succeed"); } else { MessageBox.Show("Insert Not Complete", "Error"); } }
public static IRepository <sales> get_sales_repo() { string conn = configFile.getSetting("pubsDBConnectionString"); IRepository <sales> sales_repo = new SalesRepositoryDB(conn); return(sales_repo); }
private void transClick(object sender, EventArgs e) { groupBox5.Hide(); groupBox3.Hide(); empIdBoxC.Text = i; SalesRepositoryDB cltdb = new SalesRepositoryDB(); List <SalesRep> clientList = cltdb.GetAllSalesByEmp(i); this.dataGridView2.DataSource = clientList; panelTrans.Show(); panelTrans.Dock = DockStyle.Fill; viewClientPanel.Hide(); clientPanel.Hide(); vehiclePanel.Hide(); salesPanel.Hide(); //string x = DateTime.Now; }