//Public methode public void Bind(MemberIntrest UserIntrest) { try { switch (UserIntrest.IntrestType) { case 1: L_Intrest.Text = "I am interested in your profile. If you are interested in my profile, please contact me."; break; case 2: L_Intrest.Text = "I have gone through your details and feel we have lot in common. Would sure like to know your opinion on this?"; break; case 3: L_Intrest.Text = "You are someone special I wish to know better. Please contact me at the earliest."; break; case 4: L_Intrest.Text = "We found your profile to be a good match. Please contact us to proceed further."; break; case 5: L_Intrest.Text = "You are the kind of person we were searching for. Please send us your contact details."; break; default: break; } //Intrest From HL_IntrestFrom.Text = UserIntrest.IntrestFrom.ToUpper(); HL_IntrestFrom.NavigateUrl = "../MyProfile/" + UserIntrest.IntrestFrom + ".aspx"; //Date L_Date.Text = UserIntrest.Date; // Index L_No.Text = UserIntrest.Index.ToString(); // Settings For change status if (UserIntrest.mailBox == InternalMessage.MailType.Inbox) { HL_ChangeStatus.Visible = true; HL_ChangeStatus.Attributes.Add("onclick", "newWindow('ChangeIntrestStatus.aspx?&typ=" + UserIntrest.IntrestStatus.ToString() + "&id=" + UserIntrest.IntrestFrom + "','SendMessage','585','275')"); } else { HL_ChangeStatus.Visible = false; } try { HttpCookieCollection objHttpCookieCollection = Request.Cookies; HttpCookie objHttpCookie = objHttpCookieCollection.Get("MatCookie5639sb"); //<<<ForTesting>>>> if (Crypto.DeCrypto(objHttpCookie.Values["UserType"]) == "PaidMember") { HL_Message.Visible = true; HL_Message.Attributes.Add("onclick", "newWindow('SendMessages.aspx?id=" + UserIntrest.IntrestFrom + "','SendMessage','585','300')"); } } catch (Exception) { } this.Visible = true; } catch (Exception) { this.Visible = false; } }
public static MemberIntrest[] GetIntrestList(string MatrimonialID, bool IsInbox, int Start, MemberIntrest.TypeOfIntrest Type) { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * Procedure Name : UserIntrests_Fill * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Type: SELECT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Parameters : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@MatrimonialID varchar(25) * @Flag smallint * @Status * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IntrestsCode * Date * * * * * * * * * * * * * * * * * * * * * * * * * * * */ MemberIntrest[] objAIntrest = new MemberIntrest[10]; using (SqlConnection objConnection = DBConnection.GetSqlConnection()) { try { //Creating Command object SqlCommand objCommand = new SqlCommand("UserIntrests_Fill", objConnection); objCommand.CommandType = CommandType.StoredProcedure; //Adding Parameters objCommand.Parameters.Add(new SqlParameter("@MatrimonialID", SqlDbType.VarChar)); objCommand.Parameters["@MatrimonialID"].Value = MatrimonialID; //Intrest In or Out objCommand.Parameters.Add(new SqlParameter("@Flag", SqlDbType.SmallInt)); if (IsInbox) { objCommand.Parameters["@Flag"].Value = 0; } else { objCommand.Parameters["@Flag"].Value = 1; } //pending ? Approved ? Declined ? objCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.SmallInt)); switch (Type) { case MemberIntrest.TypeOfIntrest.Pending: objCommand.Parameters["@Status"].Value = 1; break; case MemberIntrest.TypeOfIntrest.Approved: objCommand.Parameters["@Status"].Value = 2; break; case MemberIntrest.TypeOfIntrest.Declined: objCommand.Parameters["@Status"].Value = 3; break; } objConnection.Open(); SqlDataReader objReader = objCommand.ExecuteReader(); short i = 0; for (i = 0; i <= Start; i++) { objReader.Read(); } try { for (i = 0; i <= 9; i++) { objAIntrest[i] = new MemberIntrest(); objAIntrest[i].IntrestFrom = objReader["ID"].ToString(); objAIntrest[i].SendingDate = Convert.ToDateTime(objReader["Date"]); objAIntrest[i].IntrestType = Convert.ToSByte(objReader["IntrestsCode"]); objAIntrest[i].IntrestStatus = Convert.ToSByte(objReader["Status"]); objAIntrest[i].IsInBox = IsInbox; objReader.Read(); } } catch (Exception) { objAIntrest[i] = null; } objConnection.Close(); return(objAIntrest); } catch (Exception Ex) { ErrorLog.WriteErrorLog("Test", Ex); objConnection.Close(); return(null); } } }