Beispiel #1
0
    //Browsing the last
    protected void LB_Previous_Click(object sender, EventArgs e)
    {
        LB_Next_1.Enabled = true;
        LB_Next_2.Enabled = true;

        //Getting values
        int intStart = int.Parse(HF_Start.Value);
        int intCount = int.Parse(HF_Count.Value);

        intStart -= 7;
        // End of record?
        if (intStart < 7)
        {
            LB_Previous_1.Enabled = false;
            LB_Previous_2.Enabled = false;
        }
        //Update Start Pointer
        HF_Start.Value = (intStart).ToString();
        //Getting SSList

        string[] strAList = MatrimonialSuccessStoryManager.GetSuccessStoryList(intStart);
        //Fill Countrol
        if (strAList != null)
        {
            SuccessPannel1.Bind(strAList[0]);
            SuccessPannel2.Bind(strAList[1]);
            SuccessPannel3.Bind(strAList[2]);
            SuccessPannel4.Bind(strAList[3]);
            SuccessPannel5.Bind(strAList[4]);
            SuccessPannel6.Bind(strAList[5]);
            SuccessPannel7.Bind(strAList[6]);
        }
    }
Beispiel #2
0
    private bool UpLoadImageFile(FileInfo info)
    {
        try
        {
            ///
            /// striming image
            ///
            byte[]     byteContent   = new byte[info.Length];
            FileStream objFileStream = info.OpenRead();
            objFileStream.Read(byteContent, 0, byteContent.Length);
            objFileStream.Close();

            ///
            /// Processing image
            ///

            byteContent = EditImage.GetThumbNail(byteContent, 124, 90, true);



            byteContent = EditImage.SetWatermark(byteContent, WebConfig.GetValues("FName"), 50, true, 36);

            ///
            /// DataBase operation starts
            ///
            HF_SSID.Value = getSucessID();
            //DateTime dateTemp = DateTime.Parse(DDL_dobMonth.SelectedIndex.ToString() + "/" + DDL_dobDay.SelectedValue + "/" + DDL_dobYear.SelectedValue);
            return(MatrimonialSuccessStoryManager.AddSuccessStory(HF_SSID.Value, TB_SucessStory.Text, L_MatID.Text, TB_Bride.Text, TB_Groom.Text, DateTime.Parse(DDL_dobMonth.SelectedIndex.ToString() + "/" + DDL_dobDay.SelectedValue + "/" + DDL_dobYear.SelectedValue), byteContent));
        }
        catch (Exception ex)
        {
            return(false);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Check Which Form To load

            //is it have a ssID
            string strType = Request.QueryString["id"];
            if ((strType != "") && (strType != null))
            {
                //Make all Controls invisible
                PN_Delete.Visible    = false;
                PN_CheckAnon.Visible = false;
                PN_NoRecords.Visible = false;

                //Setting Controls
                switch (strType)
                {
                case "1":
                    LoadCheckList();
                    this.Title = "Check Abuse Success Stories";
                    break;

                case "2":
                    L_Label.Text      = "DELETE";
                    this.Title        = "Delete Success Story";
                    PN_Delete.Visible = true;
                    break;

                default:
                    LoadCheckList();
                    this.Title = "Check Abuse Success Stories";
                    break;
                }
            }
            else
            {
                LoadCheckList();
                this.Title = "Check Abuse Success Stories";
            }
        }
        else //Search
        {
            //Does The ID Has A SS
            string SSID = MatrimonialSuccessStoryManager.GetSStoryID(TB_ID.Text, RB_MatID.Checked);

            if (SSID != null)
            {
                //Yes It Have
                Response.Redirect("DelSuccessStory.aspx?id=" + SSID);
            }
            else
            {
                //No Matching
                PN_NoRecords.Visible = true;
            }
        }
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            try
            {
                HttpCookieCollection objHttpCookieCollection = Request.Cookies;
                HttpCookie           objHttpCookie           = objHttpCookieCollection.Get("MatCookie5639sb");

                L_MatID.Text = Crypto.DeCrypto(objHttpCookie.Values["MatrimonialID"]);

                string strSSID = MatrimonialSuccessStoryManager.GetSuccessID(L_MatID.Text);

                if (strSSID != null)
                {
                    PN_SStory.Visible = true;
                    PN_SubMit.Visible = false;
                    SuccessPannel1.Bind(strSSID);
                }
                else
                {
                    PN_SStory.Visible = false;
                    PN_SubMit.Visible = true;

                    txtCount.Text = TB_SucessStory.MaxLength.ToString();

                    TB_SucessStory.Attributes.Add("onKeyUp", "javascript:document.getElementById('" + txtCount.ClientID +
                                                  "').setAttribute('value', (" + TB_SucessStory.MaxLength +
                                                  " - parseInt(document.getElementById('" + TB_SucessStory.ClientID +
                                                  "').getAttribute('value').length)));");

                    int intYear = DateTime.Now.Year - 2;

                    for (int i = 0; i <= 4; ++i)
                    {
                        DDL_dobYear.Items.Add((intYear + i).ToString());
                    }
                }
            }
            catch (Exception)
            { }
        }   //if
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // Adding meta Discription
            HtmlMeta objMeta = new HtmlMeta();
            objMeta.Name    = "Description";
            objMeta.Content = WebConfig.GetValues("MetaDiscription");
            this.Header.Controls.Add(objMeta);

            // Adding meta KeyWords
            objMeta         = new HtmlMeta();
            objMeta.Name    = "keywords";
            objMeta.Content = WebConfig.GetValues("MetaKeword");
            this.Header.Controls.Add(objMeta);

            // <<<<<<<ForTesting>>>>>>>>>>>>>

            int intCount = MatrimonialSuccessStoryManager.GetSStoryCount();
            if (intCount > 0)
            {
                if (intCount < 7)
                {
                    LB_Next_1.Enabled = false;
                    LB_Next_2.Enabled = false;
                }
                HF_Start.Value = "0";
                HF_Count.Value = (intCount).ToString();

                string[] strAList = MatrimonialSuccessStoryManager.GetSuccessStoryList(0);

                if (strAList != null)
                {
                    SuccessPannel1.Bind(strAList[0]);
                    SuccessPannel2.Bind(strAList[1]);
                    SuccessPannel3.Bind(strAList[2]);
                    SuccessPannel4.Bind(strAList[3]);
                    SuccessPannel5.Bind(strAList[4]);
                    SuccessPannel6.Bind(strAList[5]);
                    SuccessPannel7.Bind(strAList[6]);
                }
            }
        }
    }
 public bool DeleteMe()
 {
     return(MatrimonialSuccessStoryManager.DeleteSStory(HF_StoryID.Value));
 }
    private void LoadCheckList()
    {
        //MAKE CONTROLS VISIBLE
        L_Label.Text         = "MANAGE";
        PN_CheckAnon.Visible = true;

        //LOAD CONTROLS

        //Getting List OF Abuse Success Storys in the data base
        DataTable objDataTableAbuseList = MatrimonialSuccessStoryManager.AbuseSStoryList();

        // >1
        if (objDataTableAbuseList != null)
        {
            // Load Table Row For Each Element in the list
            string strMessage = "";
            foreach (DataRow objDataRowList in objDataTableAbuseList.Rows)
            {
                //Get SSList
                DataTable objDataTableStory = MatrimonialSuccessStoryManager.GetSStory(objDataRowList["SStoryID"].ToString(), false);
                //>1

                strMessage = objDataRowList["Message"].ToString();

                if (objDataTableStory != null)
                {
                    LiteralControl objLiteralControl;
                    TableCell      objTableCell;

                    string   strTemp;
                    DateTime dateTemp;

                    //Loading Coloum Contans
                    foreach (DataRow objDataRowStory in objDataTableStory.Rows)
                    {
                        TableRow objTableRow = new TableRow();
                        Table_View.Rows.Add(objTableRow);

                        //Coloum 1
                        objLiteralControl = new LiteralControl(objDataRowStory["SStoryID"].ToString());
                        objTableCell      = new TableCell();
                        objTableCell.Controls.Add(objLiteralControl);
                        objTableRow.Cells.Add(objTableCell);

                        //Coloum 2
                        objLiteralControl = new LiteralControl(objDataRowStory["MatrimonialID"].ToString());
                        objTableCell      = new TableCell();
                        objTableCell.Controls.Add(objLiteralControl);
                        objTableRow.Cells.Add(objTableCell);

                        //Coloum 3
                        objLiteralControl = new LiteralControl(strMessage);
                        objTableCell      = new TableCell();
                        objTableCell.Controls.Add(objLiteralControl);
                        objTableRow.Cells.Add(objTableCell);


                        // Link To Delete The SStory
                        HyperLink newHyperLink = new HyperLink();
                        newHyperLink.NavigateUrl = "DelSuccessStory.aspx?id=" + objDataRowStory["SStoryID"].ToString();
                        newHyperLink.ImageUrl    = "~/Resources/btnSelect.gif";
                        //Coloum 6
                        objTableCell = new TableCell();
                        objTableCell.Controls.Add(newHyperLink);
                        objTableCell.HorizontalAlign = HorizontalAlign.Center;
                        objTableCell.VerticalAlign   = VerticalAlign.Middle;
                        objTableRow.Cells.Add(objTableCell);
                    }
                }
            }
        }
        else
        {
            //NoStorys Are Present In the list
            PN_CheckAnon.Visible = false;
            PN_NoRecords.Visible = true;
        }
    }