コード例 #1
0
    //INSERTS datafields into Database Table
    protected void SubButton_Click(object sender, EventArgs e)
    {
        Call_Database callDB = new Call_Database();

        if (ImageUpload.HasFile)
        {
            if (CheckFileType(ImageUpload.FileName))
            {
                string strPath = "../Images/dbImages/" + ImageUpload.FileName;

                ImageUpload.SaveAs(MapPath(strPath));
            }
        }
        if (NameBox.Text != "" && txtProfile.Text != "")
        {
            string Action = "DonorsINSERT";
            callDB.FormINSERT(Action, NameBox.Text, ImageUpload.FileName, txtProfile.Text, null, null, 0, 0, 0, 0);

            NameBox.Text    = String.Empty;
            txtProfile.Text = String.Empty;
            Call_Database update = new Call_Database();
            RepeaterNum.DataSource = update.dbDonors;
            RepeaterNum.DataBind();
        }
    }
コード例 #2
0
    //DELETE datafields from Database Table
    protected void DeleteLink_Click(object sender, EventArgs e)
    {
        Call_Database deleteEntry = new Call_Database();
        string        Action      = "DonorsDELETE";
        RepeaterItem  item        = (sender as LinkButton).Parent as RepeaterItem;
        int           deleteId    = int.Parse((item.FindControl("idLabel") as Label).Text);

        deleteEntry.Delete(deleteId, Action);
        Call_Database update = new Call_Database();

        RepeaterNum.DataSource = update.dbDonors;
        RepeaterNum.DataBind();
    }
コード例 #3
0
    //UPDATE datafields from Repeater Table
    protected void OnUpdate_Click(object sender, EventArgs e)
    {
        Call_Database updateEntry = new Call_Database();
        RepeaterItem  item        = (sender as LinkButton).Parent as RepeaterItem;
        string        Action      = "DonorsUPDATE";
        int           updateId    = int.Parse((item.FindControl("idLabel") as Label).Text);
        string        EditName    = (item.FindControl("EditName") as TextBox).Text;
        string        EditPhoto   = (item.FindControl("EditPhoto") as TextBox).Text;
        string        EditProfile = (item.FindControl("EditProfile") as TextBox).Text;

        updateEntry.FormUPDATE(Action, EditName, EditPhoto, EditProfile, null, null, updateId, 0, 0, 0);
        Call_Database update = new Call_Database();

        RepeaterNum.DataSource = update.dbDonors;
        RepeaterNum.DataBind();
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strQuery = "";

        if (Request.QueryString["id"] != null)
        {
            strQuery = Request.QueryString["id"].ToString();
        }

        if (!IsPostBack)
        {
            Call_Database PageDB   = new Call_Database();
            Call_Database AlumniDB = new Call_Database();
            RepeaterNum.DataSource = PageDB.dbDonors;
            RepeaterNum.DataBind();
            RepeaterNum2.DataSource = AlumniDB.dbAlumniMap;
            RepeaterNum2.DataBind();
        }
    }