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
    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 #3
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]);
                }
            }
        }
    }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //is it have a ssID
         string strSSID = Request.QueryString["id"];
         if ((strSSID != "") && (strSSID != null))
         {
             //Load Pannel
             SuccessPannel1.Bind(strSSID);
         }
         else
         {
             Response.Redirect("~/Extras/ErrorReport.aspx?id=404");
         }
     }
     else
     {
         //Ok You can Delete
         if (CB_Delete.Checked)
         {
             //Delete
             if (SuccessPannel1.DeleteMe())
             {
                 //Change Settings
                 L_Error.Text           = "SucessStory Deleted";
                 L_Error.Visible        = true;
                 SuccessPannel1.Visible = false;
                 CB_Delete.Visible      = false;
                 B_Delete.Visible       = false;
             }
             else
             {
                 //Error
                 L_Error.Text = "Server Not Resopnding";
             }
         }
         else
         {
             //You have to Check The Check Box
             CB_Delete.ForeColor = System.Drawing.Color.Red;
         }
     }
 }
Beispiel #5
0
    private bool UpLoadImageFile(FileInfo info)
    {
        /*
         * UserSuccessStory_InsertStory
         *
         *  @SStoryID varchar(15) = NULL,
         *  @MatrimonialID varchar(10) = NULL,
         *  @Bride varchar(50) = NULL,
         *  @Groom varchar(50) = NULL,
         *  @WeddingDate smalldatetime = NULL,
         *  @Photo image = NULL
         */


        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
            ///



            using (SqlConnection objConnection = DBConnection.GetSqlConnection())
            {
                SqlCommand objCommand = new SqlCommand("UserSuccessStory_InsertStory", objConnection);
                objCommand.CommandType = CommandType.StoredProcedure;

                /// Inserting parameters

                string strTemp = getSucessID();

                objCommand.Parameters.Add(new SqlParameter("@SStoryID", SqlDbType.VarChar));
                objCommand.Parameters["@SStoryID"].Value = strTemp;


                objCommand.Parameters.Add(new SqlParameter("@SucessStory", SqlDbType.VarChar));
                objCommand.Parameters["@SucessStory"].Value = TB_SucessStory.Text;

                objCommand.Parameters.Add(new SqlParameter("@MatrimonialID", SqlDbType.VarChar));
                objCommand.Parameters["@MatrimonialID"].Value = TB_MatID.Text;


                objCommand.Parameters.Add(new SqlParameter("@Bride", SqlDbType.VarChar));
                objCommand.Parameters["@Bride"].Value = TB_Bride.Text;


                objCommand.Parameters.Add(new SqlParameter("@Groom", SqlDbType.VarChar));
                objCommand.Parameters["@Groom"].Value = TB_Groom.Text;

                /// <<<<<<<<<<<< ForTesting >>>>>>>>>>>>
                objCommand.Parameters.Add(new SqlParameter("@WeddingDate", SqlDbType.SmallDateTime));
                objCommand.Parameters["@WeddingDate"].Value = DateTime.Parse(TB_Date.Text);


                objCommand.Parameters.Add(new SqlParameter("@Photo", SqlDbType.Image));
                objCommand.Parameters["@Photo"].Value = byteContent;

                /// Execute Sql Query

                objConnection.Open();
                objCommand.ExecuteNonQuery();
                objConnection.Close();

                //Setting SuccessPannel
                PN_Success.Visible = true;
                SuccessPannel1.Bind(strTemp);
            }
            return(true);
        }
        catch (Exception)
        {
            // ErrorLog
            return(false);
        }
    }
Beispiel #6
0
 private void LoadStory()
 {
     PN_SubMit.Visible = false;
     PN_SStory.Visible = true;
     SuccessPannel1.Bind(HF_SSID.Value);
 }