예제 #1
0
    protected void submit_btn_Click(object sender, EventArgs e)
    {
        con.Open();
        string imgg = "";

        if (school_img.HasFile)
        {
            imgg = ("~/img/" + school_img.FileName);
            school_img.SaveAs(Server.MapPath("~/img/") + school_img.FileName);

            //SqlCommand cmd = new SqlCommand("dashimage_proc", con);
            //cmd.CommandType = CommandType.StoredProcedure;
            //cmd.Parameters.AddWithValue("@action", "insert");
            //cmd.Parameters.AddWithValue("@pk_id", "");
            //cmd.Parameters.AddWithValue("@image", imgg);
            //cmd.ExecuteNonQuery();
            settingswebref.setting obj = new settingswebref.setting();
            int a = obj.insert(imgg);
            if (a > 0)
            {
                Response.Write("<script>alert('Data Submitted')</script>");
            }
        }

        gridshow();
        blank();
        con.Close();
    }
예제 #2
0
 public void gridshow()
 {
     //SqlDataAdapter da = new SqlDataAdapter("dashimage_event_proc", con);
     //da.SelectCommand.CommandType = CommandType.StoredProcedure;
     //da.SelectCommand.Parameters.AddWithValue("@action", "show");
     //da.SelectCommand.Parameters.AddWithValue("@pk_id", "");
     //DataTable dt = new DataTable();
     //da.Fill(dt);
     settingswebref.setting obj = new settingswebref.setting();
     GridView1.DataSource = obj.show();
     GridView1.DataBind();
 }
예제 #3
0
    protected void btn_delete_Click(object sender, EventArgs e)
    {
        con.Open();
        LinkButton  lnk = (LinkButton)sender;
        GridViewRow row = (GridViewRow)lnk.NamingContainer;
        Label       l1  = (Label)row.FindControl("Lbl_id");

        settingswebref.setting obj = new settingswebref.setting();
        int a = obj.delete(Convert.ToInt32(l1.Text));

        gridshow();
        Response.Write("<script>alert('Data Deleted')</script>");
        con.Close();
    }
예제 #4
0
    protected void btn_delete_Click(object sender, EventArgs e)
    {
        con.Open();
        LinkButton  lnk = (LinkButton)sender;
        GridViewRow row = (GridViewRow)lnk.NamingContainer;
        Label       l1  = (Label)row.FindControl("Lbl_id");

        //SqlCommand cmd = new SqlCommand("school_dlt_proc", con);
        //cmd.CommandType = CommandType.StoredProcedure;
        //cmd.Parameters.AddWithValue("@action", "delete");
        //cmd.Parameters.AddWithValue("@pk_id", l1.Text);
        //cmd.ExecuteNonQuery();
        settingswebref.setting obj = new settingswebref.setting();
        int a = obj.addschooldelete(Convert.ToInt32(l1.Text));

        if (a > 0)
        {
            gridshow();
            Response.Write("<script>alert('Data Deleted')</script>");
            con.Close();
        }
    }
예제 #5
0
    protected void upd_btn_Click(object sender, EventArgs e)
    {
        con.Open();

        string str  = System.IO.Path.GetExtension(school_img.FileName);
        string imgg = "";

        if (school_img.HasFile)
        {
            imgg = ("~/img/" + school_img.FileName);
            school_img.SaveAs(Server.MapPath("~/img/") + school_img.FileName);
        }
        else
        {
            imgg = Image2.ImageUrl;
        }

        //SqlCommand cmd = new SqlCommand("school_proc", con);
        //cmd.CommandType = CommandType.StoredProcedure;
        //cmd.Parameters.AddWithValue("@action", "update");
        //cmd.Parameters.AddWithValue("@pk_id", Label_id.Text);
        //cmd.Parameters.AddWithValue("@school_name", school_txt.Text);
        //cmd.Parameters.AddWithValue("@image", imgg);
        //cmd.ExecuteNonQuery();
        settingswebref.setting obj = new settingswebref.setting();
        int a = obj.addschoolupdate(Convert.ToInt32(Label_id.Text), school_txt.Text, imgg);

        if (a > 0)
        {
            Response.Write("<script>alert('Data Updated')</script>");
            gridshow();
            blank();
        }
        con.Close();
        upd_btn.Visible    = false;
        submit_btn.Visible = true;
        Image2.Visible     = false;
    }