protected void Page_Load(object sender, EventArgs e)
        {
            ReferenceId = Convert.ToInt32(Request.QueryString["ReferenceId"]);
            CountryId = Convert.ToInt32(Request.QueryString["CountryId"]);
            CountyId = Convert.ToInt32(Request.QueryString["CountyId"]);
            if (!IsPostBack)
            {
                try
                {
                    ViewState["Column"] = "DEDListId";
                    ViewState["Sortorder"] = "desc";
                    DAL.general objGen = new DAL.general();
                   

                    DataSet ds1 = objGen.getdataset("select County from dbo.County where CountyId=" + CountyId + "");
                    CountyName = Convert.ToString(ds1.Tables[0].Rows[0][0]);
                    lblCounty.Text = "Townland Details For County " + CountyName;
                    DataSet ds = objGen.getdataDEDTtownland(ReferenceId, CountyId, CountryId);
                    Repeater1.DataSource = ds;
                    Repeater1.DataBind();

                }
                catch (Exception ex)
                {
                    
                   
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    string v = Request.QueryString["remembranceid"];
                    DAL.general ojgGenral = new DAL.general();
                    DataSet ds = ojgGenral.getdataset("select * from  remembrancetdl where rid=" + Convert.ToInt32(v) + "");
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["mtype"]) == 1)
                    {
                        showpeive(ds);
                    }
                    else
                    {
                        Response.Redirect("index.aspx");
                    }
                }
                catch (Exception ex)
                {

                    Response.Redirect("index.aspx");
                  
                }
             

             
                binddata();
            }
        }
Beispiel #3
0
 private void bindCounty()
 {
     try
     {
         DAL.general objGen = new DAL.general();
         DataSet ds = objGen.getdataset("select distinct County, CountyId from dbo.County order by County");
         Repeater1.DataSource = ds;
         Repeater1.DataBind();
     }
     catch (Exception ex)
     {
         
         
     }
   
 }
Beispiel #4
0
        public void binddata(string v)
        {
            string sql = " select firstname, surname, rem_message, messagedate,case isnull(flowername,'') when '' then '' else '<img alt='''' src=''/remembrance-garden-book/images/' + flowername + '''>' end flowername from remembrancemessage where idrm = " + Convert.ToInt32(v) + "  order by messagedate desc";
            DAL.general objGen = new DAL.general();
            DataSet ds = objGen.getdataset(sql);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Repeater1.DataSource = ds;
                Repeater1.DataBind();
               
            }
            else
            {
               
            }

        }
        public void binddata()
        {
            try
            {

           
            DAL.general ojgGenral = new DAL.general();
            DataSet ds = ojgGenral.getdataset("select top 5 case when cid ='' then '' else desname +' '+ dessurname end as name,cid,CONVERT(VARCHAR(11),rdate,106) as rdate,SUBSTRING(pmess, 1, 70)+'...' AS mess  from inmemorialcardtdl where active='1' order by  rdate,cid DESC");
            Repeater1.DataSource = ds;
            Repeater1.DataBind();
            }
            catch (Exception) 
            {

                throw;
            }
        }
        public void binddata()
        {
            DAL.general objGen = new DAL.general();
            DataSet ds = objGen.getdataset("Select * from remembrancetdl WHERE rid=" + Convert.ToInt32(QueryString) + " AND mtype='1'");
            CKEditorControl1.Text = Convert.ToString(ds.Tables[0].Rows[0]["message"]);
            if (Convert.ToInt16(ds.Tables[0].Rows[0]["type"]) == 1)
            {
                all();
                Image1.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img1"]);
                Image2.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                Image3.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img3"]);
                txtcap1.Text = Convert.ToString(ds.Tables[0].Rows[0]["capm"]);
                txtcap2.Text = Convert.ToString(ds.Tables[0].Rows[0]["capf"]);
                txtcap3.Text = Convert.ToString(ds.Tables[0].Rows[0]["capa"]);
            }
            else
            {
                if (Convert.ToString(ds.Tables[0].Rows[0]["cattype"]) == "M")
                {
                    mail();
                    Image1.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img1"]);
                    Image3.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img3"]);
                    txtcap1.Text = Convert.ToString(ds.Tables[0].Rows[0]["capm"]);
                    //txtcap2.Text = Convert.ToString(ds.Tables[0].Rows[0]["capf"]);
                    txtcap3.Text = Convert.ToString(ds.Tables[0].Rows[0]["capa"]);
                }
                else
                {
                    femail();
                    string k = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                    Image2.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                    Image3.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img3"]);
                   // txtcap1.Text = Convert.ToString(ds.Tables[0].Rows[0]["capm"]);
                    txtcap2.Text = Convert.ToString(ds.Tables[0].Rows[0]["capf"]);
                    txtcap3.Text = Convert.ToString(ds.Tables[0].Rows[0]["capa"]);
 
                }
            
            }
        }
        public void binddata()
        {
            DAL.general objGen = new DAL.general();

            DataSet ds = objGen.getdataset("Select * from remembrancetdl WHERE rid=" + Convert.ToInt32(QueryString) + " AND mtype='0'");
            DropDownList1.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["country"]);
            drlistRegionCounty.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
            txtregion.Text = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
            txtcitytown.Text = Convert.ToString(ds.Tables[0].Rows[0]["townCity"]);
            txtaddress.Text = Convert.ToString(ds.Tables[0].Rows[0]["message"]);
            txtsurname.Text = Convert.ToString(ds.Tables[0].Rows[0]["Surname1"]);
            txtfistname.Text = Convert.ToString(ds.Tables[0].Rows[0]["name1"]);
            txtfemale.Text = Convert.ToString(ds.Tables[0].Rows[0]["name2"]);
            txtmaiden.Text = Convert.ToString(ds.Tables[0].Rows[0]["middlename"]);
            txtFirstnameofdeceased.Text = Convert.ToString(ds.Tables[0].Rows[0]["name1"]);
            txtname.Text = Convert.ToString(ds.Tables[0].Rows[0]["name"]);
            txtemail.Text = Convert.ToString(ds.Tables[0].Rows[0]["email"]);
            txtphone.Text = Convert.ToString(ds.Tables[0].Rows[0]["number"]);
            txtDeathDate.Text = Convert.ToString(ds.Tables[0].Rows[0]["deathdate1"]);
            

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    string v = Request.QueryString["cid"];
                    DAL.general ojgGenral = new DAL.general();
                    DataSet ds = ojgGenral.getdataset("select * from  inmemorialcardtdl where cid=" + Convert.ToInt32(v) + "");

                    showdata(ds);

                }
                catch (Exception ex)
                {

                    Response.Redirect("inmemorial-card.aspx");

                }

            }

        }
        public void binddata()
        {
            DAL.general objGen = new DAL.general();

            ds = objGen.getdataset("Select * from inmemorialcardtdl WHERE cid=" + Convert.ToInt32(QueryString));
            if (ds.Tables[0].Rows.Count > 0)
            {
               
                img = Convert.ToString(ds.Tables[0].Rows[0]["img"]);
                Image1.ImageUrl = "~/remembrance-garden-book/images/immemimg/" + Convert.ToString(ds.Tables[0].Rows[0]["img"]);
                txtname.Text = Convert.ToString(ds.Tables[0].Rows[0]["name"]);
                txtemail.Text = Convert.ToString(ds.Tables[0].Rows[0]["email"]);
                DropDownList1.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["country"]);
                drlistRegionCounty.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
                txtregion.Text = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
                txtcitytown.Text = Convert.ToString(ds.Tables[0].Rows[0]["townCity"]);

                txtdecname.Text = Convert.ToString(ds.Tables[0].Rows[0]["desname"]);
                txtdecsurname.Text = Convert.ToString(ds.Tables[0].Rows[0]["dessurname"]);
                txtemaildes.Text = Convert.ToString(ds.Tables[0].Rows[0]["desemail"]);
                CKEditorControl1.Text = Convert.ToString(ds.Tables[0].Rows[0]["mess"]);
            }

        }
        private void bindData()
        {
            string country, region, city, name, maidenname, surname, femalename, id, Query = null;
            string OrderBy = null;
            country = Request["country"];
            region = Request["region"];
            city = Request["city"];
            name = Request["name"];
            maidenname = Request["desname"];
            surname = Request["dessurname"];
           
            id = Request["id"];



            Query = "select cid , isnull(country,'') country, isnull(regionCounty,'') regionCounty, isnull(townCity,'') townCity,  isnull(name,'') name,isnull(desname,'') desname,isnull(dessurname,'') dessurname  from inmemorialcardtdl  where active='1' ";
            OrderBy = " order by dessurname, desname,regionCounty,townCity, name";
            if (country != "" && country != null)
            {
                Query = Query + " and country = '" + country + "'";
            }
            if (region != "" && region != null)
            {
                Query = Query + " and regionCounty = '" + region + "'";
            }
            if (city != "" && city != null)
            {
                Query = Query + " and townCity = '" + city + "'";
            }

            if (name != "" && name != null)
            {
                try
                {
                    Query = Query + " and name like '%" + name.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (surname != "" && surname != null)
            {
                try
                {
                    Query = Query + " and dessurname like '%" + surname.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (maidenname != "" && maidenname != null)
            {
                try
                {
                    Query = Query + " and desname like '%" + maidenname.Replace("'", "''") + "%'";
                }
                catch (Exception)
                {


                }

            }


           
            if (id != "" && id != null)
            {
                try
                {
                    Query = Query + " and cid  ='" + id.Replace("'", "''") + "'";

                }
                catch (Exception ex)
                {


                }

            }

            Query = Query + OrderBy;//+ " order by desname,dessurname,name";o


            DAL.general gn = new DAL.general();
            DataSet ds = gn.getdataset(Query);
            if (ds.Tables[0].Rows.Count > 0)
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();

            }
            else
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();

                ScriptManager.RegisterClientScriptBlock(this, GetType(), "NO Data", "worn();", true);
            }
        }
        private void bindData()
        {
            string country, region, city, name, maidenname, surname, femalename, id, Query = null;
            country = Request["country"];
            region = Request["region"];
            city = Request["city"];
            name = Request["name"];
            maidenname = Request["maidenname"];
            surname = Request["surname"];
            femalename = Request["femalename"];
            id = Request["id"];



            Query = "select rid ,CASE  WHEN active = 0 then 'Pending' else 'Approved'  end as rend, isnull(country,'') country, isnull(regionCounty,'') regionCounty, isnull(townCity,'') townCity,isnull(deathdate1,'') deathdate1, isnull(message,'') message, isnull(name2,'') name2,isnull(name1,'') name1,isnull(Surname1,'') Surname1, isnull(middlename,'') middlename  from remembrancetdl where  mtype=0 ";
            if (country != "" && country != null)
            {
                Query = Query + " and country = '" + country + "'";
            }
            if (region != "" && region != null)
            {
                Query = Query + " and regionCounty = '" + region + "'";
            }
            if (city != "" && region != null)
            {
                Query = Query + " and townCity = '" + city + "'";
            }

            if (name != "" && name != null)
            {
                try
                {
                    Query = Query + " and name1 like '%" + name.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (surname != "" && surname != null)
            {
                try
                {
                    Query = Query + " and Surname1 like '%" + surname.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (maidenname != "" && maidenname != null)
            {
                try
                {
                    Query = Query + " and middlename like '%" + maidenname.Replace("'", "''") + "%'";
                }
                catch (Exception)
                {


                }

            }


            if (femalename != "" && femalename != null)
            {
                try
                {
                    Query = Query + " and name2 like '%" + femalename.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }
            if (id != "" && id != null)
            {
                try
                {
                    Query = Query + " and rid  ='" + id.Replace("'", "''") + "'";

                }
                catch (Exception ex)
                {


                }

            }

            Query = Query + " order by Surname1,name1,middlename,name2";


            DAL.general gn = new DAL.general();
            DataSet ds = gn.getdataset(Query);
            if (ds.Tables[0].Rows.Count > 0)
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();

            }
            else
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();

                ScriptManager.RegisterClientScriptBlock(this, GetType(), "NO Data", "worn();", true);
            }
        }
Beispiel #12
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {

            string s = e.CommandName;
            if (e.CommandName == "Approved")
            {
                BAL.remembrance objrem = new BAL.remembrance();
                objrem.rid =Convert.ToInt32( e.CommandArgument);
                objrem.active = 0;
                DAL.general objGen = new DAL.general();
                objGen.updateremembrancestatus(objrem);

            }
            else if (e.CommandName == "Pending")
            {
                BAL.remembrance objrem = new BAL.remembrance();
                objrem.rid = Convert.ToInt32(e.CommandArgument);
                objrem.active = 1;
                DAL.general objGen = new DAL.general();
               bool f= objGen.updateremembrancestatus(objrem);
               DataSet ds = objGen.getdataset("select * from remembrancetdl where rid=" + Convert.ToInt32(e.CommandArgument) + "");
                if(f)
                {
                    try
                    {
                         string link="<a href='http://bmdnotices.com/remembrance-garden-book/viewremembrance.aspx?remembranceid="+Convert.ToString(e.CommandArgument) + "'>View the Page:</a>";
                         string mail = "<p align='left'>Dear Sir/Madam,<br><br> Your Remembrance Garden Page has now been approved and is ready for you to view on bmdnotices.com website.<br>Please feel free to start adding messages, tributes or in memorials directly on that Page.<br> You can also share this Page with your family and friends and encourage them to post their own tributes there. Should you, at any stage, wish to change the wording of the Page you created, please contact us be email and will we be happy to make these changes for you. <br> " + link + " <br><br><br> Thank You,  <br> BMDnotices Team";
                         objGen.Send_Mail(Convert.ToString(ds.Tables[0].Rows[0]["email"]), "BMDnotices Remembrance Garden Page Approved", mail, "");

                    }
                    catch (Exception)
                    {
                        
                     
                    }
                }
            }
            else if (e.CommandName == "Delete")
            {
                BAL.remembrance objrem = new BAL.remembrance();
                objrem.rid = Convert.ToInt32(e.CommandArgument);
               
                DAL.general objGen = new DAL.general();
                objGen.deleteremembrancestatus(objrem);
                objGen.deletetribut(Convert.ToInt32(e.CommandArgument));
            }
            else
            {
                if (e.CommandName == ViewState["Column"].ToString())
                {
                    if (ViewState["Sortorder"].ToString() == "ASC")
                        ViewState["Sortorder"] = "DESC";
                    else
                        ViewState["Sortorder"] = "ASC";
                }
                else
                {
                    ViewState["Column"] = e.CommandName;
                    ViewState["Sortorder"] = "ASC";
                }
            }
           
            bindData1();
        }
        public void binddata()
        {
            string sql = " select firstname, surname, rem_message, messagedate,case isnull(flowername,'') when '' then '' else '<img alt='''' src=''/remembrance-garden-book/images/' + flowername + '''>' end flowername from remembrancemessage where remembranceid = '" + Request.QueryString["remembranceid"] + "' and onlineStatus = '1' order by messagedate desc";
            DAL.general objGen = new DAL.general();
            DataSet ds= objGen.getdataset(sql);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Repeater1.DataSource = ds;
                Repeater1.DataBind();
                Messages = "Messages";
            }
            else
            {
                Messages = "";
            }

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.general objGen = new DAL.general();
            DataSet ds = objGen.getdataset("Select * from remembrancetdl WHERE rid=" + Convert.ToInt32(QueryString) + " AND mtype='1'");
            BAL.remembrance objRemebmrance = new BAL.remembrance();
            objRemebmrance.rid = Convert.ToInt32(QueryString);
            objRemebmrance.message = CKEditorControl1.Text;

            if (FileUpload3.HasFile)
            {
                string path = Path.GetFileName(FileUpload3.FileName);
                string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();


                mi = mm + path;
                FileUpload3.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + mi);
            }
            else
            {
                mi = Convert.ToString(ds.Tables[0].Rows[0]["img3"]);
            }
            objRemebmrance.img3 = mi;
            objRemebmrance.capa = txtcap3.Text;
            if (Convert.ToInt16(ds.Tables[0].Rows[0]["type"]) == 1)
            {
                if (FileUpload1.HasFile)
                {
                    string path = Path.GetFileName(FileUpload1.FileName);
                    string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                    fpi = mm + path;
                    FileUpload1.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + fpi);
                }
                else
                {
                    fpi = Convert.ToString(ds.Tables[0].Rows[0]["img1"]);

                }
                if (FileUpload2.HasFile)
                {
                    string path = Path.GetFileName(FileUpload2.FileName);
                    string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                    spi = mm + path;
                    FileUpload2.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + spi);
                }
                else
                {
                    spi = Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                }
                
                objRemebmrance.img1 = fpi;
                objRemebmrance.img2 = spi;
                objRemebmrance.capm = txtcap1.Text;
                objRemebmrance.capf = txtcap2.Text;
               
            }
            else
            {
                
                if (Convert.ToString(ds.Tables[0].Rows[0]["cattype"]) == "M")
                {
                    if (FileUpload1.HasFile)
                    {
                        string path = Path.GetFileName(FileUpload1.FileName);
                        string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                        fpi = mm + path;
                        FileUpload1.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + fpi);
                    }
                    else
                    {
                        fpi = Convert.ToString(ds.Tables[0].Rows[0]["img1"]);

                    }
                    objRemebmrance.img1 = fpi;
                    objRemebmrance.img2 = "2.jpg";
                    objRemebmrance.capm = txtcap1.Text;
                }
                else
                {
                    if (FileUpload2.HasFile)
                    {
                        string path = Path.GetFileName(FileUpload2.FileName);
                        string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                        spi = mm + path;
                        FileUpload2.SaveAs(Server.MapPath("~/remembrance-garden-book/images/img/") + spi);
                    }
                    else
                    {
                        spi = Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                    }
                    objRemebmrance.img1 = "1.jpg";
                    objRemebmrance.img2 = spi;
                    objRemebmrance.capf = txtcap2.Text;
                }
            }
            bool f = objGen.updateremembrancemess(objRemebmrance);
            if (f)
            {
                binddata();
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true);
            }
        }
 private void view()
 {
     DAL.general ojgGenral = new DAL.general();
     DataSet ds = ojgGenral.getdataset("select * from  remembrancetdl order by  adate DESC");
     CKEditorControl1.Text = Convert.ToString(ds.Tables[0].Rows[0]["message"]);
 }
        private void bindData()
        {
            string country, region, city, name, maidenname, surname, femalename, id, Query = null;
            string OrderBy = null;
            country = Request["country"];
            region = Request["region"];
            city = Request["city"];
            name = Request["name"];
            maidenname = Request["maidenname"];
            surname = Request["surname"];
            femalename = Request["femalename"];
            id = Request["id"];


            //Change order of fields to: 
            //
            // Maiden Name, 
            //Female First Name, 
            //Place of Death: 
            // Country, Region / County, Town / City, Page Number
            //
            //name1  = male name
            //name2 = female name
            //middlename = mainden name
            //

            Query = "select rid ,CASE  WHEN mtype = 0 then 'viewremembranceold.aspx?remembranceid='+ CONVERT(varchar(10), rid) else 'viewremembrance.aspx?remembranceid='+ CONVERT(varchar(10), rid)  end as rend, isnull(country,'') country, isnull(regionCounty,'') regionCounty, isnull(townCity,'') townCity,isnull(deathdate1,'') deathdate1, isnull(message,'') message, isnull(name2,'') name2,isnull(name1,'') name1,isnull(Surname1,'') Surname1, isnull(middlename,'') middlename  from remembrancetdl where active=1 ";
            OrderBy = " Order By Surname1,name1,middlename, name2,country, regionCounty,townCity";
            if (country != "" && country != null)
            {
                Query = Query + " and country = '" + country + "'";
            }
            if (region != "" && region != null)
            {
                Query = Query + " and regionCounty = '" + region + "'";
            }
            if (city != "" && region != null)
            {
                Query = Query + " and townCity = '" + city + "'";
            }

            if (name != "" && name != null)
            {
                try
                {
                    Query = Query + " and name1 like '%" + name.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (surname != "" && surname != null)
            {
                try
                {
                    Query = Query + " and Surname1 like '%" + surname.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }

            if (maidenname != "" && maidenname != null)
            {
                try
                {
                    Query = Query + " and middlename like '%" + maidenname.Replace("'", "''") + "%'";
                }
                catch (Exception)
                {


                }

            }


            if (femalename != "" && femalename != null)
            {
                try
                {
                    Query = Query + " and name2 like '%" + femalename.Replace("'", "''") + "%'";
                }
                catch (Exception ex)
                {


                }

            }
            if (id != "" && id != null)
            {
                try
                {
                    Query = Query + " and rid  ='" + id.Replace("'", "''") + "'";
                      
                }
                catch (Exception ex)
                {


                }

            }

            //Query = Query + " order by Surname1,name1,middlename,name2 ";
            Query = Query + OrderBy;

            DAL.general gn = new DAL.general();
            DataSet ds = gn.getdataset(Query);
            if (ds.Tables[0].Rows.Count > 0)
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();
                
            }
            else
            {
                DataView dvData = new DataView(ds.Tables[0]);
                dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
                Repeater1.DataSource = ds;
                Repeater1.DataBind();
                
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "NO Data", "worn();", true);
            }
        }
        public void binddata()
        {
            DAL.general objGen=new DAL.general();

            DataSet ds = objGen.getdataset("Select * from remembrancetdl WHERE rid=" + Convert.ToInt32(QueryString) + " AND mtype='1'");

            if(Convert.ToInt16( ds.Tables[0].Rows[0]["type"])==1)
            {
               RadioButtonList1.SelectedIndex=1;
               RadioButtonList2.Visible = false;
               allcheck();
            }
            else
            {
                  RadioButtonList1.SelectedIndex=0;
                  if (Convert.ToString(ds.Tables[0].Rows[0]["cattype"]) == "M")
                  {
                      RadioButtonList2.SelectedIndex = 0;
                      malechaeck();
                  }
                  else
                  {
                      RadioButtonList2.SelectedIndex = 1;
                      femailchaeck();
                  }
            }


            DropDownList1.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["country"]);
            drlistRegionCounty.SelectedValue = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
            txtregion.Text = Convert.ToString(ds.Tables[0].Rows[0]["regionCounty"]);
            txtcitytown.Text = Convert.ToString(ds.Tables[0].Rows[0]["townCity"]); 
            txtaddress.Text = Convert.ToString(ds.Tables[0].Rows[0]["address"]).Replace("<br />", Environment.NewLine);
            txtsurname.Text = Convert.ToString(ds.Tables[0].Rows[0]["Surname1"]);
            txtfistname.Text = Convert.ToString(ds.Tables[0].Rows[0]["name1"]);
            txtfemale.Text = Convert.ToString(ds.Tables[0].Rows[0]["name2"]);
            txtmaiden.Text = Convert.ToString(ds.Tables[0].Rows[0]["middlename"]);

            txtname.Text = Convert.ToString(ds.Tables[0].Rows[0]["name"]);
            txtemail.Text = Convert.ToString(ds.Tables[0].Rows[0]["email"]);
            txtphone.Text = Convert.ToString(ds.Tables[0].Rows[0]["number"]); 
            try
            {
                string date1=Convert.ToString(ds.Tables[0].Rows[0]["deathdate1"]);
                if (date1 != null && date1 != "")
                {
                    string[] words = date1.Split(' ');
                    ddlday1.Text = Convert.ToString(words[0]);
                    ddlmonth1.Text = Convert.ToString(words[1]);
                    ddlyear1.Text = Convert.ToString(words[2]);
                }
            }
            catch (Exception ex)
            {
                
               
            }
            try
            {
                string date2 = Convert.ToString(ds.Tables[0].Rows[0]["deathdate2"]);
                if (date2 != null && date2 != "")
                {
                    string[] words2 = date2.Split(' ');

                    string k = Convert.ToString(words2[0]);
                    string m = Convert.ToString(words2[1]);
                    string v = Convert.ToString(words2[2]);

                    ddlday2.SelectedValue = k;
                    ddlmonth2.Text = m;
                    ddlyear2.SelectedValue = v;
                }
               
            }
            catch (Exception ex)
            {


            }
        }
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
              if (e.CommandName == "Approved")
            {
                BAL.inmemorial objrem = new BAL.inmemorial();
                objrem.cid =Convert.ToInt32( e.CommandArgument);
                objrem.active = 0;
                DAL.general objGen = new DAL.general();
                objGen.updateinmomoriyamstatus(objrem);

            }
              else if (e.CommandName == "Pending")
              {
                  BAL.inmemorial objrem = new BAL.inmemorial();
                  objrem.cid = Convert.ToInt32(e.CommandArgument);
                  objrem.active = 1;
                  DAL.general objGen = new DAL.general();
                bool f=  objGen.updateinmomoriyamstatus(objrem);
                DataSet ds = objGen.getdataset("select * from inmemorialcardtdl where cid=" + Convert.ToInt32(e.CommandArgument) + "");
                if(f)
                {
                    try
                    {
                        string link= "http://bmdnotices.com/remembrance-garden-book/viewinmemoriam.aspx?cid=" + Convert.ToString(e.CommandArgument);
                        string postNewInMemoriumLink = " <a href='http://www.bmdnotices.com/remembrance-garden-book/Post-inmemorial-card.aspx'>click here</a>.";


                        string mail = "<p align='left'>Dear Sir/Madam,<br><br>The In Memoriam Notice you created has now been approved and is ready for you to view on bmdnotices.com website.<br>You are welcome to send as many In Memoriams as you like.<br>Please note that you can also add your messages, tributes and in memoriams to existing Pages in our Remembrance Garden Book. <br>If you would like to create such a Page, please"+postNewInMemoriumLink +"<br>You can view your In Memoriam Notice here: " + link + "<br><br><br> Thank You, <br>BMDnotices Team</p>";
                   //     string mail = "<p align='left'>Dear Sir / Madam,<br><br>Your Card has now been approved and is ready for you to view on bmdnotices.com website.<br>You are welcome to send as many Cards as you like.<br>Please note that you can also add your messages, tributes and in memorials to existing Pages in our Remembrance Garden Book. <br>If you would like to create such a Page, please clik here.<br> You can view your Card here:" + link + "<br><br><br> Thank You, <br>BMDnotices Team";
                        objGen.Send_Mail(Convert.ToString(ds.Tables[0].Rows[0]["email"]), "BMDnotices In Memoriam Approved", mail, "");


                        string body = infoBody1(Convert.ToString(ds.Tables[0].Rows[0]["name"]), "", Convert.ToString(ds.Tables[0].Rows[0]["desname"]), Convert.ToString(ds.Tables[0].Rows[0]["dessurname"]), Convert.ToString(ds.Tables[0].Rows[0]["mess"]), Convert.ToString(ds.Tables[0].Rows[0]["img"]));
                        string[] words = Convert.ToString(ds.Tables[0].Rows[0]["desemail"]).Split(',');
                        foreach (string word in words)
                        {
                            objGen.Send_Mail(word, "BMDnotices In Memoriam Notice has been shared with you", body, "");
                        }

                    }
                    catch (Exception)
                    {
                        
                     
                    }
                }
              }
              else if (e.CommandName == "Delete")
              {
                  BAL.inmemorial objrem = new BAL.inmemorial();
                  objrem.cid = Convert.ToInt32(e.CommandArgument);
                  
                  DAL.general objGen = new DAL.general();
                  objGen.deleteinmomoriyamstatus(objrem);
              }
              else
              {
                  if (e.CommandName == ViewState["Column"].ToString())
                  {
                      if (ViewState["Sortorder"].ToString() == "ASC")
                          ViewState["Sortorder"] = "DESC";
                      else
                          ViewState["Sortorder"] = "ASC";
                  }
                  else
                  {
                      ViewState["Column"] = e.CommandName;
                      ViewState["Sortorder"] = "ASC";
                  }
              }
            bindData1();
        }
Beispiel #19
0
        public void setImgtxt()
        {
            DAL.general ojgGenral = new DAL.general();
            DataSet ds = ojgGenral.getdataset("select * from  remembrancetdl where mtype='1' and active='1' order by  adate DESC");

            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[0]["cattype"]) == "F")
                {
                  
                    Image1.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img2"]);
                    Image1.Width = 60;
                    Image1.Height = 80;
                    Label1.Text = Convert.ToString(ds.Tables[0].Rows[0]["name2"]) ;
                    Hyperlink1.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[0]["rid"]) + "";
 
                }
                else
                {
                    Image1.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[0]["img1"]);
                    Image1.Width = 60;
                    Image1.Height = 80;
                    Label1.Text = Convert.ToString(ds.Tables[0].Rows[0]["name1"]) ;
                    Hyperlink1.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[0]["rid"]) + "";
 
 
                }

            }
            catch (Exception ex)
            {
                
               
            }
            //2
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[1]["cattype"]) == "F")
                {

                    Image2.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[1]["img2"]);
                    Image2.Width = 60;
                    Image2.Height = 80;
                    Label2.Text = Convert.ToString(ds.Tables[0].Rows[1]["name2"]) ;
                    Hyperlink2.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[1]["rid"]) + "";

                }
                else
                {
                    Image2.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[1]["img1"]);
                    Image2.Width = 60;
                    Image2.Height = 80;
                    Label2.Text = Convert.ToString(ds.Tables[0].Rows[1]["name1"]) ;
                    Hyperlink2.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[1]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {

               
            }
            //3
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[2]["cattype"]) == "F")
                {

                    Image3.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[2]["img2"]);
                    Image3.Width = 60;
                    Image3.Height = 80;
                    Label3.Text = Convert.ToString(ds.Tables[0].Rows[2]["name2"]);
                    Hyperlink3.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[2]["rid"]) + "";

                }
                else
                {
                    Image3.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[2]["img1"]);
                    Image3.Width = 60;
                    Image3.Height = 80;
                    Label3.Text = Convert.ToString(ds.Tables[0].Rows[2]["name1"]) ;
                    Hyperlink3.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[2]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //4
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[3]["cattype"]) == "F")
                {

                    Image4.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[3]["img2"]);
                    Image4.Width = 60;
                    Image4.Height = 80;
                    Label4.Text = Convert.ToString(ds.Tables[0].Rows[3]["name2"]) ;
                    Hyperlink4.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[3]["rid"]) + "";

                }
                else
                {
                    Image4.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[3]["img1"]);
                    Image4.Width = 60;
                    Image4.Height = 80;
                    Label4.Text = Convert.ToString(ds.Tables[0].Rows[3]["name1"]) ;
                    Hyperlink4.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[3]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //5
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[4]["cattype"]) == "F")
                {

                    Image5.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[4]["img2"]);
                    Image5.Width = 60;
                    Image5.Height = 80;
                    Label5.Text = Convert.ToString(ds.Tables[0].Rows[4]["name2"]) ;
                    Hyperlink5.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[4]["rid"]) + "";

                }
                else
                {
                    Image5.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[4]["img1"]);
                    Image5.Width = 60;
                    Image5.Height = 80;
                    Label5.Text = Convert.ToString(ds.Tables[0].Rows[4]["name1"]) ;
                    Hyperlink5.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[4]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //6
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[5]["cattype"]) == "F")
                {

                    Image6.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[5]["img2"]);
                    Image6.Width = 60;
                    Image6.Height = 80;
                    Label6.Text = Convert.ToString(ds.Tables[0].Rows[5]["name2"]) ;
                    Hyperlink6.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[5]["rid"]) + "";

                }
                else
                {
                    Image6.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[5]["img1"]);
                    Image6.Width = 60;
                    Image6.Height = 80;
                    Label6.Text = Convert.ToString(ds.Tables[0].Rows[5]["name1"]) ;
                    Hyperlink6.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[5]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //7
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[6]["cattype"]) == "F")
                {

                    Image7.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[6]["img2"]);
                    Image7.Width = 60;
                    Image7.Height = 80;
                    Label7.Text = Convert.ToString(ds.Tables[0].Rows[6]["name2"]) ;
                    Hyperlink7.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[6]["rid"]) + "";

                }
                else
                {
                    Image7.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[6]["img1"]);
                    Image7.Width = 60;
                    Image7.Height = 80;
                    Label7.Text = Convert.ToString(ds.Tables[0].Rows[6]["name1"]) ;
                    Hyperlink7.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[6]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //8
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[7]["cattype"]) == "F")
                {

                    Image8.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[7]["img2"]);
                    Image8.Width = 60;
                    Image8.Height = 80;
                    Label8.Text = Convert.ToString(ds.Tables[0].Rows[7]["name2"]);
                    Hyperlink8.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[7]["rid"]) + "";

                }
                else
                {
                    Image8.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[7]["img1"]);
                    Image8.Width = 60;
                    Image8.Height = 80;
                    Label8.Text = Convert.ToString(ds.Tables[0].Rows[7]["name1"]);
                    Hyperlink8.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[7]["rid"]) + "";


                }

            }
            catch (Exception ex)
            {


            }
            //9
            try
            {
                if (Convert.ToString(ds.Tables[0].Rows[8]["cattype"]) == "F")
                {

                    Image9.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[8]["img2"]);
                    Image9.Width = 60;
                    Image9.Height = 80;
                    Label9.Text = Convert.ToString(ds.Tables[0].Rows[8]["name2"]) ;
                    Hyperlink9.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[8]["rid"]) + "";

                }
                else
                {
                    Image9.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[8]["img1"]);
                    Image9.Width = 60;
                    Image9.Height = 80;
                    Label9.Text = Convert.ToString(ds.Tables[0].Rows[8]["name1"]) ;
                    Hyperlink9.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[8]["rid"]) + "";


                }
            }
            catch (Exception ex)
            {


            }
                //10
                try
                {
                    if (Convert.ToString(ds.Tables[0].Rows[9]["cattype"]) == "F")
                    {

                        Image10.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[9]["img2"]);
                        Image10.Width = 60;
                        Image10.Height = 80;
                        Label10.Text = Convert.ToString(ds.Tables[0].Rows[9]["name2"]) ;
                        Hyperlink10.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[9]["rid"]) + "";

                    }
                    else
                    {
                        Image10.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[9]["img1"]);
                        Image10.Width = 60;
                        Image10.Height = 80;
                        Label10.Text = Convert.ToString(ds.Tables[0].Rows[9]["name1"]) ;
                        Hyperlink10.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[9]["rid"]) + "";


                    }

                }
                catch (Exception ex)
                {


                }
                //11
               
                try
                {
                    if (Convert.ToString(ds.Tables[0].Rows[10]["cattype"]) == "F")
                    {

                        Image11.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[10]["img2"]);
                        Image11.Width = 60;
                        Image11.Height = 80;
                        Label11.Text = Convert.ToString(ds.Tables[0].Rows[10]["name2"]) ;
                        Hyperlink11.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[10]["rid"]) + "";

                    }
                    else
                    {
                        Image11.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[10]["img1"]);
                        Image11.Width = 60;
                        Image11.Height = 80;
                        Label11.Text = Convert.ToString(ds.Tables[0].Rows[10]["name1"]) ;
                        Hyperlink11.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[10]["rid"]) + "";


                    }

                }
                catch (Exception ex)
                {


                }
                //12
                try
                {
                    if (Convert.ToString(ds.Tables[0].Rows[11]["cattype"]) == "F")
                    {

                        Image12.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[11]["img2"]);
                        Image12.Width = 60;
                        Image12.Height = 80;
                        Label12.Text = Convert.ToString(ds.Tables[0].Rows[11]["name2"]) ;
                        Hyperlink12.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[11]["rid"]) + "";

                    }
                    else
                    {
                        Image12.ImageUrl = "~/remembrance-garden-book/images/img/" + Convert.ToString(ds.Tables[0].Rows[11]["img1"]);
                        Image12.Width = 60;
                        Image12.Height = 80;
                        Label12.Text = Convert.ToString(ds.Tables[0].Rows[11]["name1"]) ;
                        Hyperlink12.NavigateUrl = "~/remembrance-garden-book/viewremembrance.aspx?remembranceid=" + Convert.ToUInt32(ds.Tables[0].Rows[11]["rid"]) + "";


                    }

                }
                catch (Exception ex)
                {


                }

            
            


            
        }