コード例 #1
0
        protected void submit_Click(object sender, EventArgs e)
        {
            carrentalEntities db = new carrentalEntities();
            feedback          f  = new feedback();

            f.carno       = cno.Text.ToString();
            f.cid         = Int32.Parse(cid.Text);
            f.rating      = DropDownList1.SelectedItem.Text;
            f.description = review.Text;
            db.feedbacks.Add(f);
            db.SaveChanges();
            Response.Redirect("customerprofile.aspx");
        }
コード例 #2
0
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label1.Visible   = true;
            TextBox1.Visible = true;
            GridViewRow       row = GridView1.SelectedRow;
            carrentalEntities db  = new carrentalEntities();
            feedback          f   = new feedback();
            int      feedbackid   = Int32.Parse(row.Cells[3].Text);
            feedback cc           = db.feedbacks.Where(x => x.fid == feedbackid).FirstOrDefault <feedback>();


            TextBox1.Text = cc.description;
        }