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);
            }
        }
Ejemplo n.º 2
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            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);
            }
            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();

        }
Ejemplo n.º 3
0
        public void insertdata()
        {
            string regin;

            if (drlistRegionCounty.Text != "")
            {
                regin = drlistRegionCounty.Text;
            }
            else
            {
                regin = txtregion.Text;
            }
            BAL.remembrance objRemebmrance = new BAL.remembrance();
            objRemebmrance.country = DropDownList1.Text;
            objRemebmrance.regionCounty = regin;
            objRemebmrance.townCity = txtcitytown.Text;
            objRemebmrance.address = txtaddress.Text.Replace(Environment.NewLine, "<br />");
            
            objRemebmrance.message = CKEditorControl1.Text;
            objRemebmrance.name = txtname.Text;
            objRemebmrance.number = txtphone.Text;
            objRemebmrance.email = txtemail.Text;
            objRemebmrance.active = 0;
            objRemebmrance.img3 = mi;
            objRemebmrance.capa = txtcap3.Text;
            if (HiddenPageOfType.Value.ToString() == "1")
            {

                objRemebmrance.type = 0;

                if (HiddenPersonofSex.Value.ToString() == "1")
                {
                    objRemebmrance.cattype = "M";
                    objRemebmrance.name1 = txtfistname.Text;
                    objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
                    objRemebmrance.img1 = fpi;
                    objRemebmrance.img2 = "2.jpg";
                    objRemebmrance.Surname1 = txtsurname.Text;
                    objRemebmrance.capm = txtcap1.Text;
                }
                else
                {
                    objRemebmrance.cattype = "F";

                    objRemebmrance.name2 = txtfemale.Text;
                    objRemebmrance.middlename = txtmaiden.Text;
                    objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
                    objRemebmrance.img2 = spi;
                    objRemebmrance.img1 = "1.jpg";
                    objRemebmrance.capf = txtcap2.Text;
                    objRemebmrance.Surname1 = TextFemaleSurname.Text;
                }

            }
            else
            {
                objRemebmrance.Surname1 = txtsurname.Text;
                objRemebmrance.type = 1;
                objRemebmrance.cattype = "N";
                objRemebmrance.name1 = txtfistname.Text;
                objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
                objRemebmrance.img1 = fpi;
                objRemebmrance.name2 = txtfemale.Text;
                objRemebmrance.middlename = txtmaiden.Text;
                objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
                objRemebmrance.img2 = spi;
                objRemebmrance.capm = txtcap1.Text;
                objRemebmrance.capf = txtcap2.Text;
            }

            DAL.general objGeneral = new DAL.general();

            bool f = objGeneral.insertremembrance(objRemebmrance);
            if (f)
            {

                string body = "A new Remembrance Graden page has been created on bmdnotices.com.<br> <a href='http://bmdnotices.com/AdminBMD/login.aspx' target='_blank'>Approve here</a></p>";
                DAL.general objGener = new DAL.general();
                objGener.Send_Mail("*****@*****.**", "Remembrance garden add page", body, "");


                string mbody = "<p align='left'>Dear Sir/Madam,<br><br> Thank you for creating a Page in the Remembrance Garden Book.<br> Your Page will be reviewed within 24 hours.<br>You will receive an email notification once the Page is published. <br><br><br> Thank You, <br>BMDnotices Team</p>";
                objGener.Send_Mail(txtemail.Text, "BMDnotices Remembrance Garden Page", mbody, "");
                Response.Redirect("thankyoupost.aspx");
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true);
            }


        }
Ejemplo n.º 4
0
        public void update()
        {
            string regin;

            if (drlistRegionCounty.Text != "")
            {
                regin = drlistRegionCounty.Text;
            }
            else
            {
                regin = txtregion.Text;
            }
            BAL.remembrance objRemebmrance = new BAL.remembrance();
            objRemebmrance.rid =  Convert.ToInt32(QueryString);
            objRemebmrance.country = DropDownList1.Text;
            objRemebmrance.regionCounty = regin;
            objRemebmrance.townCity = txtcitytown.Text;
            objRemebmrance.address = txtaddress.Text.Replace(Environment.NewLine, "<br />");
            objRemebmrance.Surname1 = txtsurname.Text;
          
            objRemebmrance.name = txtname.Text;
            objRemebmrance.number = txtphone.Text;
            objRemebmrance.email = txtemail.Text;
            if (RadioButtonList1.SelectedIndex.ToString() == "0")
            {

                objRemebmrance.type = 0;

                if (RadioButtonList2.SelectedIndex.ToString() == "0")
                {
                    objRemebmrance.cattype = "M";
                    objRemebmrance.name1 = txtfistname.Text;
                    objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
                  

                }
                else
                {
                    objRemebmrance.cattype = "F";

                    objRemebmrance.name2 = txtfemale.Text;
                    objRemebmrance.middlename = txtmaiden.Text;
                    objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
                  
                }

            }
            else
            {

                objRemebmrance.type = 1;
                objRemebmrance.cattype = "N";
                objRemebmrance.name1 = txtfistname.Text;
                objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
              
                objRemebmrance.name2 = txtfemale.Text;
                objRemebmrance.middlename = txtmaiden.Text;
                objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
               
            }

            DAL.general objGeneral = new DAL.general();

            bool f = objGeneral.updateremembrance(objRemebmrance);
            if (f)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true);
            }
          


        }
Ejemplo n.º 5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string regin;
            mi = null;
            fpi = null;
            spi = null;
            if (drlistRegionCounty.Text != "")
            {
                regin = drlistRegionCounty.Text;
            }
            else
            {
                regin = txtregion.Text;
            }
            BAL.remembrance objRemebmrance = new BAL.remembrance();
            objRemebmrance.country = DropDownList1.Text;
            objRemebmrance.regionCounty = regin;
            objRemebmrance.townCity = txtcitytown.Text;
            objRemebmrance.address = txtaddress.Text.Replace(Environment.NewLine, "<br />");
            objRemebmrance.Surname1 = txtsurname.Text;
            objRemebmrance.message = CKEditorControl1.Text;
            objRemebmrance.name = txtname.Text;
            objRemebmrance.number = txtphone.Text;
            objRemebmrance.email = txtemail.Text;
            objRemebmrance.active = 1;



            try
            {
                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);
                }

            }
            catch (Exception ex)
            {


            }

            objRemebmrance.img3 = mi;
            objRemebmrance.capa = txtcap3.Text;


            if (RadioButtonList1.SelectedIndex.ToString() == "0")
            {

                objRemebmrance.type = 0;

                if (RadioButtonList2.SelectedIndex.ToString() == "0")
                { try
                    {
                    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 = "1.jpg";
                    }
                    }
                catch (Exception ex)
                {


                }
                    objRemebmrance.cattype = "M";
                    objRemebmrance.name1 = txtfistname.Text;
                    objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
                    objRemebmrance.img1 = fpi;
                    objRemebmrance.img2 = "2.jpg";

                    objRemebmrance.capm = txtcap1.Text;
                }
                else
                {

                    try
                    {
                        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 = "2.jpg";
                        }
                    }
                    catch (Exception ex)
                    {


                    }
                    objRemebmrance.cattype = "F";

                    objRemebmrance.name2 = txtfemale.Text;
                    objRemebmrance.middlename = txtmaiden.Text;
                    objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
                    objRemebmrance.img2 = spi;
                    objRemebmrance.img1 = "1.jpg";

                    objRemebmrance.capf = txtcap2.Text;
                }

            }
            else
            {
                try
                {
                    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 = "1.jpg";

                    }
                }
                catch (Exception ex)
                {


                }
                try
                {
                    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 = "2.jpg";
                    }
                }
                catch (Exception ex)
                {


                }
               

                objRemebmrance.type = 1;
                objRemebmrance.cattype = "N";
                objRemebmrance.name1 = txtfistname.Text;
                objRemebmrance.deathdate1 = Convert.ToString(ddlday1.SelectedValue.ToString() + " " + ddlmonth1.SelectedValue.ToString() + " " + ddlyear1.SelectedValue.ToString());
                objRemebmrance.img1 = fpi;
                objRemebmrance.name2 = txtfemale.Text;
                objRemebmrance.middlename = txtmaiden.Text;
                objRemebmrance.deathdate2 = Convert.ToString(ddlday2.SelectedValue.ToString() + " " + ddlmonth2.SelectedValue.ToString() + " " + ddlyear2.SelectedValue.ToString());
                objRemebmrance.img2 = spi;

                objRemebmrance.capm = txtcap1.Text;
                objRemebmrance.capf = txtcap2.Text;
               
            }

            DAL.general objGeneral = new DAL.general();

            bool f = objGeneral.insertremembrance(objRemebmrance);
            if (f)
            {

                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true);
            }

        }
Ejemplo n.º 6
0
        public void update()
        {
            string regin;

            if (drlistRegionCounty.Text != "")
            {
                regin = drlistRegionCounty.Text;
            }
            else
            {
                regin = txtregion.Text;
            }
            BAL.remembrance objRemebmrance = new BAL.remembrance();
            objRemebmrance.rid = Convert.ToInt32(QueryString);
            objRemebmrance.country = DropDownList1.Text;
            objRemebmrance.regionCounty = regin;
            objRemebmrance.townCity = txtcitytown.Text;
            objRemebmrance.message = txtaddress.Text;
            objRemebmrance.name = txtname.Text;
            objRemebmrance.Surname1 = txtsurname.Text;
            objRemebmrance.number = txtphone.Text;
            objRemebmrance.email = txtemail.Text;
            objRemebmrance.name1 = txtfistname.Text;
            objRemebmrance.name2 = txtfemale.Text;
            objRemebmrance.middlename = txtmaiden.Text;
            objRemebmrance.deathdate1 = txtDeathDate.Text;

            DAL.general objGeneral = new DAL.general();

            bool f = objGeneral.updateremembrance(objRemebmrance);
            if (f)
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true);
            }


        }
Ejemplo n.º 7
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();
        }