Пример #1
0
    protected void btn_Click(object sender, EventArgs e)
    {
        bs.fname = fname.Text;
        bs.lname = lastname.Text;

        int q = bs.bs_insert(bs);

        if (q > 0)
        {
            Label1.Text = "Successfully";
        }
        else
        {
            Label1.Text = "Try Again";
        }
    }
Пример #2
0
    protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
    {
        TextBox id = (TextBox)ListView1.InsertItem.FindControl("id");
        TextBox fn = (TextBox)ListView1.InsertItem.FindControl("fn");
        TextBox ln = (TextBox)ListView1.InsertItem.FindControl("ln");

        bs.id    = int.Parse(id.Text);
        bs.fname = fn.Text;
        bs.lname = ln.Text;
        int p = bs.bs_insert(bs);

        if (p > 0)
        {
            Response.Write("Success..");
            ListView1.EditIndex = -1;
            display();
        }
        else
        {
            Response.Write("Failed...");
        }
    }
Пример #3
0
    protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        TextBox id = (TextBox)DetailsView1.Rows[0].FindControl("txt_insert_id");
        TextBox fn = (TextBox)DetailsView1.Rows[1].FindControl("txt_insert_fn");
        TextBox ln = (TextBox)DetailsView1.Rows[2].FindControl("txt_insert_ln");

        bs.id    = int.Parse(id.Text);
        bs.fname = fn.Text;
        bs.lname = ln.Text;
        int p = bs.bs_insert(bs);

        if (p > 0)
        {
            DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
            bind();
            Response.Write("Success..");
        }
        else
        {
            Response.Write("Failed");
        }
    }
Пример #4
0
    protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        TextBox id = (TextBox)FormView1.FindControl("id");
        TextBox fn = (TextBox)FormView1.FindControl("fn");
        TextBox ln = (TextBox)FormView1.FindControl("ln");

        bs.id    = int.Parse(id.Text);
        bs.fname = fn.Text;
        bs.lname = ln.Text;
        int p = bs.bs_insert(bs);

        if (p > 0)
        {
            Response.Write("Success..");
            FormView1.ChangeMode(FormViewMode.ReadOnly);


            bind();
        }
        else
        {
            Response.Write("Failed...");
        }
    }
Пример #5
0
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        bs.fname  = txt_fname.Text;
        bs.gender = RadioButtonList1.Text;

        string str = "";

        for (int i = 0; i < CheckBoxList1.Items.Count; i++)
        {
            if (CheckBoxList1.Items[i].Selected == true)
            {
                if (str == "")
                {
                    str = CheckBoxList1.Items[i].Text;
                }
                else
                {
                    str = str + "," + CheckBoxList1.Items[i].Text;
                }
            }
        }
        bs.hobby = str;

        string str1 = "";

        foreach (ListItem item in ListBox1.Items)
        {
            if (item.Selected == true)
            {
                if (str1 == "")
                {
                    str1 = item.Text;
                }
                else
                {
                    str1 = str1 + "," + item.Text;
                }
            }
        }
        bs.subject = str1;
        bs.state   = DropDownList1.Text;

        if (FileUpload1.HasFile)
        {
            filename = FileUpload1.FileName;
            path     = Server.MapPath("~/image/");
            fulpath  = path + "\\" + filename;
            FileUpload1.SaveAs(fulpath);
            temp = "~/image/" + filename;
        }
        else
        {
            temp = "";
        }
        bs.image = temp;

        int p = bs.bs_insert(bs);

        if (p > 0)
        {
            Response.Write("Successfully...");
        }
        else
        {
            Response.Write("Failed..");
        }
    }