public void Delete(SalesInvoice SalesInvoice)
 {
     using (DbManager db = new DbManager())
     {
         Accessor.Query.Delete(db, SalesInvoice);
     }
 }
 public void Save(SalesInvoice SalesInvoice)
 {
     using (DbManager db = new DbManager())
     {
         if (SalesInvoice.RecordNo != 0)
         {
             Accessor.Query.Update(db, SalesInvoice);
         }
         else
         {
             Accessor.Query.Insert(db, SalesInvoice);
         }
     }
 }
 private List<SalesInvoice> GetSelectedSalesInvoice()
 {
     List<SalesInvoice> list = new List<SalesInvoice>();
     foreach (GridViewRow row in this.gvSalesInvoice.Rows)
     {
         CheckBox ck = ((CheckBox)row.FindControl("chkID"));
         Image imgSalesInvoice = (Image)row.FindControl("imgInvoice");
         if (ck.Checked)
         {
             SalesInvoice si = new SalesInvoice();
             si.SalesInvoiceNumber = row.Cells[5].Text;
             si.SoldTo = row.Cells[8].Text;
             si.SalesInvoiceDate = DateTime.Parse(row.Cells[6].Text);
             si.PLNumber = row.Cells[12].Text;
             si.RecordNo = int.Parse(imgSalesInvoice.AlternateText);
             list.Add(si);
         }
     }
     return list;
 }
        private List<SalesInvoice> GetSalesInvoiceToBeCancelled()
        {
            List<SalesInvoice> list = new List<SalesInvoice>();
            foreach (GridViewRow row in this.gvPreviewSelectedDR.Rows)
            {
                CheckBox ck = ((CheckBox)row.FindControl("chkSelectedSalesInvoice"));

                if (ck.Checked)
                {
                    SalesInvoice si = new SalesInvoice();
                    si.RecordNo = int.Parse(ck.ToolTip);// = this.SIManager.GetSalesInvoiceByKey(long.Parse(ck.ToolTip));
                    list.Add(si);
                }

                else
                {
                    //Code if it is not checked ......may not be required
                }
            }
            return list;
        }