Exemplo n.º 1
0
        public void addToExpense(REntity rEntity)
        {
            var receiptId = Request.QueryString["ReceiptId"];

            rEntity.ReceiptID = Convert.ToInt32(receiptId);
            receiptBusiness.addToExpense(rEntity);
            receiptImage.ImageUrl     = "~/Receipt/" + rEntity.ReceiptPath;
            receiptEntity.ReceiptPath = rEntity.ReceiptPath;
            receiptBusiness.deleteData(rEntity);
        }
        protected void btnExpense_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow row in GridView1.Rows)
            {
                if (((CheckBox)row.FindControl("checkBox2")).Checked == true)
                {
                    rEntity.ReceiptID = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Values["ReceiptID"].ToString());

                    receiptBusiness.addToExpense(rEntity);
                    Response.Redirect("Expenses.aspx?ReceiptId=" + rEntity.ReceiptID);
                }
            }
        }