Example #1
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        DataTable       dtMealTemplate = new DataTable();
        SqlDataProvider db             = new SqlDataProvider();

        dtMealTemplate.Columns.Add("Userid", Type.GetType("System.Int32"));
        dtMealTemplate.Columns.Add("Emailid", Type.GetType("System.String"));
        foreach (GridViewRow gvr in grdvwSite.Rows)
        {
            ///DataRow drMT = new DataRow();

            DataRow drMT = dtMealTemplate.NewRow();
            drMT["Userid"]  = gvr.Cells[1].Text;
            drMT["Emailid"] = gvr.Cells[4].Text;

            dtMealTemplate.Rows.Add(drMT);
            CheckBox myCheckBox = (CheckBox)gvr.FindControl("CheckAll");
            if (myCheckBox.Checked == true)
            {
                UserEmail obj1 = new UserEmail();

                objuseremail.Userid  = Convert.ToInt16(drMT["Userid"]);
                objuseremail.Emailid = drMT["Emailid"].ToString();
                objsentuseremail.SentFeedbackmailToUser(objuseremail.Userid, objuseremail.Emailid);
                objuseremail.InsertFeedbackCustomer();
            }
        }
    }