Exemplo n.º 1
0
        protected void lnkPost_Click(object sender, EventArgs e)
        {
            var ViewCommand = (LinkButton)sender;
            var postId      = int.Parse(ViewCommand.CommandArgument);

            Session["PostId"] = postId;
            var postObj = _db.BlogPosts.FirstOrDefault(m => m.PostId == postId);

            if (postObj != null)
            {
                var blogList = _db.BlogPosts.Where(m => m.PostId == postId).ToList();
                if (!blogList.Any())
                {
                    FormView2.DataSource = new List <BlogPost>();
                    FormView2.DataBind();
                }
                FormView2.DataSource = blogList;
                FormView2.DataBind();

                //Displaying the Selected Post Comment
                var commentList = _db.BlogComments.Where(m => m.PostId == postId).ToList();
                if (!commentList.Any())
                {
                    grdComment.DataSource = new List <BlogComment>();
                    grdComment.DataBind();
                }
                grdComment.DataSource = commentList;
                grdComment.DataBind();
            }
        }
Exemplo n.º 2
0
        private void loadBlogPost()
        {
            var blogList = _db.BlogPosts.Where(s => s.Category == 3).OrderByDescending(s => s.PublishedTime).Take(1).ToList();

            if (!blogList.Any())
            {
                FormView2.DataSource = new List <BlogPost>();
                //FormView2.DataSourceID = string.Empty;
                FormView2.DataBind();
            }
            FormView2.DataSource = blogList;
            FormView2.DataBind();
            var postId = blogList[0].PostId;

            Session["PostId"] = postId;



            var commentList = _db.BlogComments.Where(s => s.PostId == postId).OrderByDescending(m => m.Date).Take(5).ToList();

            if (!commentList.Any())
            {
                grdComment.DataSource = new List <BlogPost>();
                grdComment.DataBind();
            }

            grdComment.DataSource = commentList;
            grdComment.DataBind();
        }
        protected void btn_submit(object sender, EventArgs e)
        {
            bll = new LogBLL();
            //Connection.CreateCommand("");
            String AppName     = txt_AppName.Text;
            String environment = ddl_environment.SelectedValue;

            if (RadioButtonList1.SelectedValue == "Error")
            {
                error          = new Error();
                error.AppName  = AppName;
                error.Severity = ddl_severity.SelectedIndex;
                errorlist      = bll.ErrorBLL(error, environment);
                if (errorlist != null)
                {
                    FormView2.DataSource = errorlist;
                    FormView2.DataBind();
                }
            }
            else
            {
                message         = new Message();
                message.AppName = AppName;
                messagelist     = bll.MessageBLL(message, environment);

                if (messagelist != null)
                {
                    // txt_AppName.Text = ((Message)messagelist[0]).Source;
                    FormView1.DataSource = messagelist;//list
                    FormView1.DataBind();
                }
            }
        }
    eticaretDataContext et = new eticaretDataContext(); // data context nesnemizi olusturdur.

    protected void Page_Load(object sender, EventArgs e)
    {
        stokvaryok();// Ürün stok var yok fonksiyonun çağırdık.
        // Veritabanımıza baglandık tabloları birleştirerek çünkü markaAD adlı kolonumuz Urunler tablosunda yoktu.
        //Ona ulasmak içinde Ürünler tablosu ile markalar Tablosunu birleştirdik.
        var urun = (from u in et.Urunlers.Where(v => v.UrunID == Convert.ToInt32(Request.QueryString["id"].ToString()))
                    join u2 in et.Markalars on u.MarkaID equals u2.MarkaID
                    select new { u.UrunID, u.UrunAD, u.UrunDetay, u.UrunFiyat, u.KDV, u.Resim1, u.Resim2, u.Resim3, u.Resim4, u.Resim5, u.Video, u.Taksit, u2.MarkaAD });

        //Ürün Adımızı almak için veritabanımıza bağlandık.
        var urunad = et.Urunlers.Where(v => v.UrunID == int.Parse(Request.QueryString["id"])).FirstOrDefault();

        lblAD.Text = urunad.UrunAD; // Ürün adımızı veritabanından alarak Label'ımıza atadık.



        FormView1.DataSource = urun; // sonucumuzu FormView'umuza attık.
        FormView1.DataBind();

        FormView2.DataSource = urun; // Ürün Resimlerinin gösterimi için FormView2 ile bağlantımızı kurduk.
        FormView2.DataBind();
        FormView3.DataSource = urun;
        FormView3.DataBind();
        FormView4.DataSource = urun;
        FormView4.DataBind();
        FormView5.DataSource = urun;
        FormView5.DataBind();
        FormView6.DataSource = urun;
        FormView6.DataBind();
        yorumgetir();
    }
Exemplo n.º 5
0
        /*private void GetUserInfo1()
         * {
         *  SqlDataSource SqlDataSource1 = new SqlDataSource();
         *  SqlDataSource1.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
         *
         *  SqlDataSource1.SelectCommand = @"SELECT [user_fname], [user_lname], [user_email], [user_ph_num], [user_addr1], [user_addr2], [user_city], [user_state], [user_country], [user_zip] FROM [UserInfo] WHERE [user_id] = @user_id";
         *
         *  SqlDataSource1.SelectParameters.Add("user_id", Session["Id"].ToString());
         *
         *
         *  DataSourceSelectArguments args = new DataSourceSelectArguments();
         *  DataView dv = SqlDataSource1.Select(args) as DataView;
         *  string fname = dv.Table.Rows[0]["user_fname"].ToString();
         *  string lname = dv.Table.Rows[0]["user_lname"].ToString();
         *  customerName = fname + " " + lname;
         *  Session["fullname"] = customerName;
         *  dv.Dispose();
         *
         *
         *  FormView1.DataSource = SqlDataSource1;
         *  FormView1.DataBind();
         *
         *  SqlDataSource1.Dispose();
         *
         * }*/

        private void GetUserInfo2()
        {
            SqlDataSource SqlDataSource1 = new SqlDataSource();

            SqlDataSource1.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

            SqlDataSource1.SelectCommand = @"SELECT [user_fname], [user_lname], [user_email], [user_ph_num], [user_addr1], [user_addr2], [user_city], [user_state], [user_country], [user_zip] FROM [UserInfo] WHERE [user_id] = @user_id";

            SqlDataSource1.SelectParameters.Add("user_id", Session["Id"].ToString());


            DataSourceSelectArguments args = new DataSourceSelectArguments();
            DataView dv    = SqlDataSource1.Select(args) as DataView;
            string   fname = dv.Table.Rows[0]["user_fname"].ToString();
            string   lname = dv.Table.Rows[0]["user_lname"].ToString();

            customerName        = fname + " " + lname;
            Session["fullname"] = customerName;
            dv.Dispose();


            FormView2.DataSource = SqlDataSource1;
            FormView2.DataBind();

            SqlDataSource1.Dispose();
        }
        protected void btnNext_Click(object sender, ImageClickEventArgs e)
        {
            List <int>  list = (List <int>)Session["search"];
            HiddenField ID   = FormView1.FindControl("ID") as HiddenField;
            int         id   = 0;

            if (int.TryParse(ID.Value, out id))
            {
                int index = list.FindIndex(x => x == id);
                if (index == list.Count - 1)
                {
                    index = 0;
                }
                else
                {
                    index = index + 1;
                }

                id = list[index];
                ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
                FormView1.DataSource = table.Rows;
                FormView1.DataBind();

                ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
                FormView2.DataSource = table1.Rows;
                FormView2.DataBind();
                up1.Update();
                up2.Update();
            }
        }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["book_id"] == null)
        {
            Response.Redirect("index.aspx");
        }
        else
        {
            BookBL bookBL = new BookBL();
            FormView1.DataSource = bookBL.product(Request.QueryString["book_id"].ToString());
            FormView1.DataBind();

            string author = ((HyperLink)FormView1.FindControl("HyperLink4")).Text.ToString();
            Label15.Text         = author;
            DataList1.DataSource = bookBL.authorBook(author);
            DataList1.DataBind();

            //書籍內容
            FormView2.DataSource = bookBL.product(Request.QueryString["book_id"].ToString());
            FormView2.DataBind();


            //書籍簡介
            FormView3.DataSource = bookBL.product(Request.QueryString["book_id"].ToString());
            FormView3.DataBind();

            //留言板
            GridView1.DataSource = bookBL.product_message(Request.QueryString["book_id"].ToString());
            GridView1.DataBind();
        }
    }
Exemplo n.º 8
0
        /// <summary>
        /// Event when user select upload picture button. It uploads the picture file to the
        /// App_Data directory and writes the file name for the File Name text box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UploadArtistImageButton_Click(object sender, EventArgs e)
        {
            FileUpload FileUploadArtistImage = FormView2.FindControl("FileUploadArtistImage") as FileUpload;

            if (FileUploadArtistImage.HasFile)
            {
                try
                {
                    string filename = Path.GetFileName(FileUploadArtistImage.FileName);
                    FileUploadArtistImage.SaveAs(Server.MapPath("~/Images/") + filename);
                    lblErrorArtist.Text = "Artist Image Upload status: File uploaded!";
                    SiteDL.UpdateArtistImagePath(filename);
                    FormView2.DataBind();
                }
                catch (Exception ex)
                {
                    lblErrorArtist.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
                }
            }
            else
            {
                lblErrorArtist.Text = "Could not find file";
            }
            upPayPal.Update();
        }
Exemplo n.º 9
0
        private void ProcessPicture(int id)
        {
            ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
            FormView1.DataSource = table.Rows;
            FormView1.DataBind();

            ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
            FormView2.DataSource = table1.Rows;
            FormView2.DataBind();
        }
Exemplo n.º 10
0
 protected void ListView1_ItemCanceling(object sender, ListViewCancelEventArgs e)
 {
     FormView1.DataSourceID = "";
     FormView1.DataSource   = null;
     FormView1.DataBind();
     FormView2.DataSourceID = "";
     FormView2.DataSource   = null;
     FormView2.DataBind();
     ListView2.DataSourceID = "";
     ListView2.DataSource   = null;
     ListView2.DataBind();
 }
Exemplo n.º 11
0
 protected void droplist_SelectedIndexChanged1(object sender, EventArgs e)
 {
     FormView1.DataSourceID = "";
     FormView1.DataSource   = null;
     FormView1.DataBind();
     FormView2.DataSourceID = "";
     FormView2.DataSource   = null;
     FormView2.DataBind();
     ListView2.DataSourceID = "";
     ListView2.DataSource   = null;
     ListView2.DataBind();
 }
    public void oku()
    {
        // OKU ya tıklandıgında hangi siparişe gideceğinin kontrolunu yaptık ve formview 'a bilgileri getirdik.
        var siparisoku = et.Siparis.Where(v => v.ID == int.Parse(Request.QueryString["id"]));

        FormView1.DataSource = siparisoku;
        FormView1.DataBind();

        var ssiparisoku = et.Sepet_Siparis.Where(v => v.ID == int.Parse(Request.QueryString["id"]));

        FormView2.DataSource = ssiparisoku;
        FormView2.DataBind();
        btnOnayla.Visible = true;
    }
Exemplo n.º 13
0
    /***************************/
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        //AccessDataSource ads = new AccessDataSource();
        //ads.DataFile = "~/date/blog_Data.mdb";
        Sql_StringChar sql_String = new Sql_StringChar();  //动态数据源

        sql_String.ConnectionString = sql_String.sql_char; //连接字符串
        sql_String.SelectCommand    = "select * from blogMessages ";
        DataView dv   = (DataView)sql_String.Select(DataSourceSelectArguments.Empty);
        string   b_id = e.Keys[0].ToString();

        sql_String.DeleteCommand = "delete from blogComments  where blog_id=?";//删除留言
        sql_String.DeleteParameters.Add("blog_id", b_id);



        Sql_StringChar sql_String3 = new Sql_StringChar();                                             //动态数据源

        sql_String3.ConnectionString = sql_String3.sql_char;                                           //连接字符串
        sql_String3.SelectCommand    = "select ca_id,blog_id from blogMessages where blog_id=" + b_id; //通过文章id查询分类id,绑定到一个隐藏控件。
        DataView dv3 = (DataView)sql_String3.Select(DataSourceSelectArguments.Empty);

        FormView2.DataSource = sql_String3;
        FormView2.DataBind();
        Label  cid  = (Label)FormView2.FindControl("ca_id");//获得隐藏控件里的控件值,即是分类id。
        string c_id = cid.Text;
        //AccessDataSource ads2 = new AccessDataSource();
        //ads2.DataFile = "~/date/blog_Data.mdb";
        Sql_StringChar sql_String2 = new Sql_StringChar();   //动态数据源

        sql_String2.ConnectionString = sql_String2.sql_char; //连接字符串
        sql_String2.SelectCommand    = "select * from blogCategory ";
        DataView dv2 = (DataView)sql_String2.Select(DataSourceSelectArguments.Empty);

        sql_String2.UpdateCommand = "update blogCategory set ca_num=ca_num-1 where ca_id='" + c_id + "'";//更新文章分类数目
        sql_String2.Update();

        Sql_StringChar sql_String4 = new Sql_StringChar();   //动态数据源

        sql_String4.ConnectionString = sql_String4.sql_char; //连接字符串
        sql_String4.SelectCommand    = "select * from blogMessages ";
        DataView dv1   = (DataView)sql_String4.Select(DataSourceSelectArguments.Empty);
        string   b_id1 = e.Keys[0].ToString();

        sql_String4.DeleteCommand = "delete from blogMessages  where blog_id='" + b_id1 + "'";//删除文章
        //sql_String4.DeleteParameters.Add("blog_id", b_id1);
        sql_String4.Delete();
    }
        protected void search_btn_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            SqlCommand cmd = new SqlCommand();

            con.Open();
            cmd.Connection  = con;
            cmd.CommandText = "select firstname,lastname,dob,gender,country,state,address,city,pincode,email,mobileno,username from Employee where employeeid=@value";
            cmd.Parameters.AddWithValue("@value", search.Text.ToString());
            FormView1.Visible = false;

            //FormView1.DataSourceID = "SqlDataSource2";
            FormView2.DataSource = cmd.ExecuteReader();
            FormView2.DataBind();
        }
Exemplo n.º 15
0
        protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataKey dk = GridView2.SelectedDataKey;
            int     a  = 0;

            FormView2.PageIndex = 0;
            FormView2.DataBind();
            while (FormView2.DataKey.Value.ToString() != dk.Value.ToString() &&
                   a < FormView2.PageCount)
            {
                if (a + 1 < FormView2.PageCount)
                {
                    FormView2.PageIndex++;
                    FormView2.DataBind();
                }
            }
        }
 protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ListBox1.Items.Count > 0)
     {
         da = new SqlDataAdapter("select bname from tbl_login where uid=" + Convert.ToInt32(Session["uid"].ToString()) + " ", con);
         ds = new DataSet();
         da.Fill(ds, "tbl_sc1");
         if (ds.Tables.Count > 0 && ds.Tables["tbl_sc1"].Rows.Count > 0)
         {
             da = new SqlDataAdapter("select tc.cid,tc.duration,tc.fee from tbl_courses tc inner join tbl_branches tb on tc.bid=tb.bid where tb.bname='" + ds.Tables["tbl_sc1"].Rows[0][0].ToString() + "' and tc.cname='" + ListBox1.SelectedItem.ToString() + "'  ", con);
             da.Fill(ds, "tbl_course");
             if (ds.Tables.Count > 0 && ds.Tables["tbl_course"].Rows.Count > 0)
             {
                 FormView2.DataSource = ds.Tables["tbl_course"].DefaultView;
                 FormView2.DataBind();
             }
         }
     }
 }
Exemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        BookBL bl = new BookBL();

        GridView1.DataSource = bl.new_Message();
        GridView1.DataBind();

        DataList1.DataSource = bl.chinese_Book("1");
        DataList1.DataBind();

        DataList2.DataSource = bl.chinese_Book("2");
        DataList2.DataBind();


        FormView2.DataSource = bl.chinese_Book("1");
        FormView2.DataBind();

        FormView5.DataSource = bl.chinese_Book("2");
        FormView5.DataBind();

        FormView7.DataSource = bl.chinese_Book("3");
        FormView7.DataBind();


        FormView1.DataSource = bl.everyday_Book();
        FormView1.DataBind();


        FormView4.DataSource = bl.book_top1("1");
        FormView4.DataBind();

        FormView3.DataSource = bl.book_top1("2");
        FormView3.DataBind();

        FormView6.DataSource = bl.book_top1("3");
        FormView6.DataBind();

        bl.book_Hit("1", HyperLink19, HyperLink20, HyperLink21, HyperLink22, HyperLink23, HyperLink24, HyperLink25, HyperLink26, HyperLink27);
        bl.book_Hit("2", HyperLink28, HyperLink29, HyperLink30, HyperLink31, HyperLink32, HyperLink33, HyperLink34, HyperLink35, HyperLink36);
        bl.book_Hit("3", HyperLink38, HyperLink39, HyperLink40, HyperLink41, HyperLink42, HyperLink43, HyperLink44, HyperLink45, HyperLink46);
    }
Exemplo n.º 18
0
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (String.Equals(e.CommandName, "dosomething"))
        {
            ListViewDataItem dataItem = (ListViewDataItem)e.Item;
            int    findMe             = dataItem.DisplayIndex;
            var    route = (Label)dataItem.FindControl("MaDonHangLabel");
            string a     = route.Text;

            SqlConnection sqlConn = new SqlConnection(connString);
            sqlConn.Open();
            DataTable      dataTable = new DataTable();
            SqlDataAdapter adapter   = new SqlDataAdapter("SELECT * FROM DonHang Where MaDonHang= '" + a + "'", sqlConn);
            adapter.Fill(dataTable);
            FormView1.DataSourceID = "";
            FormView1.DataSource   = dataTable;
            FormView1.DataBind();


            DataTable      dataTable2 = new DataTable();
            SqlDataAdapter adapter2   = new SqlDataAdapter(" SELECT  TenSanPham, Gia,SoLuong  , Gia*SoLuong as 'ThanhTien',Anh " + " FROM  DonHang inner join ChiTietDonHang  on DonHang.MaDonHang = ChiTietDonHang.MaDonHang inner join SanPham on ChiTietDonHang.MaSanPham = SanPham.MaSanPham where DonHang.MaDonHang ='" + a + "'", sqlConn);
            adapter2.Fill(dataTable2);
            ListView2.DataSourceID = "";
            ListView2.DataSource   = dataTable2;
            ListView2.DataBind();


            DataTable      dataTable3 = new DataTable();
            SqlDataAdapter adapter3   = new SqlDataAdapter("  SELECT  Sum( Gia*SoLuong) as 'ThanhTien' FROM  DonHang inner join ChiTietDonHang on DonHang.MaDonHang = ChiTietDonHang.MaDonHang inner join SanPham on ChiTietDonHang.MaSanPham = SanPham.MaSanPham where DonHang.MaDonHang = '" + a + "'", sqlConn);
            adapter3.Fill(dataTable3);
            FormView2.DataSourceID = "";
            FormView2.DataSource   = dataTable3;
            FormView2.DataBind();
            sqlConn.Close();
        }
    }
Exemplo n.º 19
0
        protected void LocationViewDDL_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Queries Relevant to home page, fetching event info student info and more
            String sqlQuery =
                "Select * from Location where LocationID = " +
                LocationViewDDL.SelectedItem.Value;
            String sqlQuery1 =
                "SELECT StaffID, FirstName + ' ' + LastName as Name from Staff " +
                "where LocationID = " + LocationViewDDL.SelectedItem.Value;
            String sqlQuery3 =
                "select * from Event where LocationID = " +
                LocationViewDDL.SelectedItem.Value;
            String sqlQuery2 =
                "select StaffID, FirstName + ' ' + LastName as Name from Staff where Type = 'Admin' and LocationID = " +
                LocationViewDDL.SelectedItem.Value;

            //Get connection string from web.config file
            string strcon = ConfigurationManager.ConnectionStrings["CARESconnection"].ConnectionString;
            //create new sqlconnection and connection to database by using connection string from web.config file
            SqlConnection con = new SqlConnection(strcon);

            con.Open();
            SqlDataAdapter sqlAdapter  = new SqlDataAdapter(sqlQuery, con);
            SqlDataAdapter sqlAdapter1 = new SqlDataAdapter(sqlQuery1, con);
            SqlDataAdapter sqlAdapter2 = new SqlDataAdapter(sqlQuery2, con);
            SqlDataAdapter sqlAdapter3 = new SqlDataAdapter(sqlQuery3, con);

            var items = new List <string>();

            using (SqlCommand command = new SqlCommand(sqlQuery2, con))
            {
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        //Read info into List
                        items.Add(reader.GetString(1));
                    }
                }
            }

            Repeater1.DataSource = items;
            Repeater1.DataBind();
            //Fill table with data
            DataTable dt = new DataTable();

            sqlAdapter1.Fill(dt);

            if (dt.Rows.Count > 0)
            {
                WorkerListLabel.Text = "Employees At This Location: ";

                WorkerListBox.DataSource     = dt;
                WorkerListBox.DataValueField = "StaffID";

                WorkerListBox.DataTextField = "Name";
                WorkerListBox.DataBind();
            }
            DataTable dt2 = new DataTable();

            sqlAdapter3.Fill(dt2);

            if (dt2.Rows.Count > 0)
            {
                EventListBox.DataSource     = dt2;
                EventListBox.DataValueField = "EventID";
                EventListBox.DataTextField  = "EventName";
                EventListBox.DataBind();
            }
            DataSet ds = new DataSet();

            sqlAdapter.Fill(ds);

            FormView2.DataSource = ds;
            FormView2.DataBind();
            con.Close();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal1();", true);
        }
 private void FormView2ContinuePaging()
 {
     FormView2.DataSource = messagelist;
     FormView2.DataBind();
 }
Exemplo n.º 21
0
        protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
        {
            GridViewRow row = GridView1.SelectedRow;
            string      a   = row.Cells[0].Text;

            Session["cid"] = Convert.ToInt32(a);
            try
            {
                SqlConnection con = new SqlConnection();
                con.ConnectionString = @"Data Source=DESKTOP-R083DVH\SQLEXPRESS;Initial Catalog=police;Integrated Security=True";
                int        cid;
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = con;
                SqlDataAdapter dataAdapter = new SqlDataAdapter();
                string         img;
                DataSet        ds = new DataSet();
                cmd.CommandText = "select * from complaint where cid=@cid";
                cmd.Parameters.AddWithValue("@cid", Convert.ToInt32(a));
                dataAdapter.SelectCommand = cmd;
                con.Open();
                dataAdapter.Fill(ds, "complaint");
                cid = Convert.ToInt32(ds.Tables[0].Rows[0]["id"]);
                img = ds.Tables[0].Rows[0]["cevd1"].ToString();
                labelcase.Visible    = true;
                FormView1.Visible    = true;
                FormView1.DataSource = ds;
                FormView1.DataBind();
                con.Close();

                if (img.Equals("null"))
                {
                    imagelink.Visible = false;
                    labelimginfo.Text = "No evidence for complaint";
                }
                else
                {
                    imagelink.Visible = true;
                    string range     = @"\";
                    int    lastindex = img.LastIndexOf(range);
                    string imgloc    = img.Substring(lastindex + 1);
                    Image1.Visible    = true;
                    labelimginfo.Text = "Evidence Found";
                    Image1.ImageUrl   = "~/assets/civilian/evidence/" + imgloc;
                }
                cmd.CommandText = "select cfname,clname,gender,phone from jass where Id=@clid";
                cmd.Parameters.AddWithValue("@clid", cid);
                DataSet        ds1 = new DataSet();
                SqlDataAdapter ad  = new SqlDataAdapter();
                ad.SelectCommand = cmd;
                con.Open();
                ad.Fill(ds1);
                LabelCivilian.Visible = true;
                FormView2.DataSource  = ds1;
                FormView2.DataBind();
                con.Close();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// Do not why it is necessary, but most rebind the picture. Probably the picture handler
 /// control does not support viewstate.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
      FormView2.DataBind();
 }