public void Save(CustomerReturnSlip CustomerReturnSlip)
 {
     using (DbManager db = new DbManager())
     {
         if (CustomerReturnSlip.RecordNo != 0)
         {
             Accessor.Query.Update(db, CustomerReturnSlip);
         }
         else
         {
             Accessor.Query.Insert(db, CustomerReturnSlip);
         }
     }
 }
 public void Delete(CustomerReturnSlip CustomerReturnSlip)
 {
     using (DbManager db = new DbManager())
     {
         Accessor.Query.Delete(db, CustomerReturnSlip);
     }
 }
 private List<CustomerReturnSlip> GetSelectedCustomerReturnSlipToBeCancelled()
 {
     List<CustomerReturnSlip> list = new List<CustomerReturnSlip>();
     foreach (GridViewRow row in this.gvPreviewSelectedDR.Rows)
     {
         CheckBox ck = ((CheckBox)row.FindControl("chkSelectedCRSToBeCancelled"));
         if (ck.Checked)
         {
             CustomerReturnSlip crs = new CustomerReturnSlip();
             crs.RecordNo = int.Parse(ck.ToolTip); // = this.CRSManager.GetCustomerReturnSlipByKey(long.Parse(ck.ToolTip));
             list.Add(crs);
         }
         else
         {
             //Code if it is not checked ......may not be required
         }
     }
     return list;
 }
 private List<CustomerReturnSlip> GetSelectedCustomerReturnSlip()
 {
     List<CustomerReturnSlip> list = new List<CustomerReturnSlip>();
     foreach (GridViewRow row in this.gvCustomerReturnSlip.Rows)
     {
         CheckBox ck = ((CheckBox)row.FindControl("chkID"));
         if (ck.Checked)
         {
             CustomerReturnSlip crs = new CustomerReturnSlip();
             crs.RecordNo = int.Parse(ck.ToolTip);// = this.CRSManager.GetCustomerReturnSlipByKey(long.Parse(ck.ToolTip));
             crs.CustomerReturnSlipNumber = row.Cells[4].Text;
             crs.Customer = row.Cells[6].Text;
             crs.CustomerReturnSlipDate = DateTime.Parse( row.Cells[5].Text);
             crs.PUSNo = row.Cells[8].Text;
             list.Add(crs);
         }
         else
         {
             //Code if it is not checked ......may not be required
         }
     }
     return list;
 }
        private List<CustomerReturnSlip> GetSelectedCustomerReturnSlips()
        {
            List<CustomerReturnSlip> list = new List<CustomerReturnSlip>();
            foreach (GridViewRow row in this.gvDeliveryReceipts.Rows)
            {
                CheckBox ck = ((CheckBox)row.FindControl("chkID"));
                Image imgReturn = (Image)row.FindControl("imgReturn");
                if (ck.Checked)
                {
                    CustomerReturnSlip crs = new CustomerReturnSlip();
                    crs.CustomerReturnSlipNumber = row.Cells[5].Text;
                    crs.CustomerReturnSlipDate = DateTime.Parse(row.Cells[6].Text);
                    crs.Customer = row.Cells[7].Text;
                    crs.PkgNo = row.Cells[10].Text;
                    crs.RecordNo = int.Parse(imgReturn.AlternateText);
                    crs.PUSNo = row.Cells[8].Text;
                    list.Add(crs);
                }

            }
            return list;
        }
        private List<CustomerReturnSlip> GetSelectedCustomerReturnSlips()
        {
            List<CustomerReturnSlip> list = new List<CustomerReturnSlip>();
            foreach (GridViewRow row in this.gvDeliveryReceipts.Rows)
            {
                CheckBox ck = ((CheckBox)row.FindControl("chkID"));

                if (ck.Checked)
                {
                    CustomerReturnSlip crs = new CustomerReturnSlip();
                    crs.CustomerReturnSlipNumber = row.Cells[5].Text;
                    crs.CustomerReturnSlipDate = DateTime.Parse(row.Cells[6].Text);
                    crs.Customer = row.Cells[7].Text;
                    crs.PkgNo = row.Cells[10].Text;
                    crs.RecordNo = int.Parse(ck.ToolTip);
                    list.Add(crs);
                }
                else
                {
                    //Code if it is not checked ......may not be required
                }
            }
            return list;
        }