Ejemplo n.º 1
0
        private void btnSearch_ProfileHistory_Click(object sender, EventArgs e)
        {
            try
            {
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.MemberCode = 0;
                Objtbl_MemberMasterProp.ProfileID  = txtProfileId_ProfileHistory.Text; // ProfileID;
                Objtbl_MemberMasterProp.isLogedin  = true;
                Objtbl_MemberMasterProp.LoginCode  = 0;

                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);
                if (dsMemberMaster.Tables[0].Rows.Count > 0)
                {
                    lblBirthYear.Text = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["DateOfBirth"]);
                    lblName.Text      = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["MemberName"]);
                    lblCast.Text      = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["Caste"]);
                }

                int MemberCode = Objtbl_MemberMasterBAL.GetMemberCode(txtProfileId_ProfileHistory.Text);
                LvwDetails.Clear();
                if (rbtnDetails.Checked)
                {
                    strSql  = " Select MM.ProfileID,MM.MemberName,convert(nvarchar,MM.DateofBirth,103) as DateofBirth,MM.MobileNo,MM.MobileNo1,MM.LandlineNo,";
                    strSql += " SM.StateCity,Convert(varchar(4),MM.DateOfBirth,111) as BornYear, Cas.Caste,CASE WHEN MM.Gender = 0 then 'MALE' else 'FEMALE' END AS Gender, ";
                    strSql += " PL.VisitDate";
                    strSql += " from tbl_MemberMaster MM ";
                    strSql += " inner join dbo.tbl_StateCity SM on SM.StateCityCode=MM.StateCity ";
                    strSql += " LEFT OUTER JOIN dbo.tbl_Caste AS Cas ON MM.Caste = Cas.CasteCode  ";
                    strSql += " INNER JOIN tbl_ProfilevisitLog_new PL ON PL.profileid= MM.profileid";
                    strSql += " WHERE MM.isActive IN (1 ,2) and PL.MemberCode = " + MemberCode + " order by PL.VisitDate DESC  ";
                    //strSql += " WHERE MM.isActive IN (1 ,2) and PL.profileid='" + txtProfileId_VisitLog.Text + "' order by PL.VisitDate DESC  ";
                    DataTable dtDetails = objDb.GetDataTable(strSql);
                    if (dtDetails.Rows.Count > 0)
                    {
                        lblTotalCnt.Text = "Total : " + Convert.ToString(dtDetails.Rows.Count);
                        FieldLength      = new int[] { 150, 200, 100, 120, 0, 0, 100, 80, 80, 0, 150 };
                        objGlobal.FillListView(LvwDetails, dtDetails, FieldLength);
                        LvwDetails.CheckBoxes = false;
                    }
                }
                else if (rbtnSummary.Checked)
                {
                    strSql = " SELECT count(*) as Count,Profileid from tbl_ProfilevisitLog_new where MemberCode=" + MemberCode + " group by Profileid order by count(*) desc ";
                    DataTable dtDetails = objDb.GetDataTable(strSql);
                    if (dtDetails.Rows.Count > 0)
                    {
                        lblTotalCnt.Text = "Total : " + Convert.ToString(dtDetails.Rows.Count);
                        FieldLength      = new int[] { 150, 200 };
                        objGlobal.FillListView(LvwDetails, dtDetails, FieldLength);
                        LvwDetails.CheckBoxes = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.MemberCode = 0;
                Objtbl_MemberMasterProp.ProfileID  = txtSearchValue.Text; // ProfileID;
                Objtbl_MemberMasterProp.isLogedin  = true;
                Objtbl_MemberMasterProp.LoginCode  = 0;

                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);
                if (dsMemberMaster.Tables[0].Rows.Count > 0)
                {
                    lblBirthYear.Text = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["DateOfBirth"]);
                    lblName.Text      = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["MemberName"]);
                    lblCast.Text      = Convert.ToString(dsMemberMaster.Tables[0].Rows[0]["Caste"]);

                    //tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                    int MemberCode = Objtbl_MemberMasterBAL.GetMemberCode(txtSearchValue.Text);
                    LvwDetails.Clear();
                    lblTotalCnt.Text = "";
                    strSql           = " select mm.membercode,MM.ProfileID,MM.MemberName,convert(nvarchar,MM.DateofBirth,103) as DateofBirth,MM.MobileNo,MM.MobileNo1,MM.LandlineNo, ";
                    strSql          += " SM.StateCity,Convert(varchar(4),MM.DateOfBirth,111) as BornYear, Cas.Caste,CASE WHEN MM.Gender = 0 then 'MALE' else 'FEMALE' END AS Gender, ";
                    strSql          += " CASE WHEN dbo.isYetMember(mm.MemberCode, 0) <= 0 THEN 'FREE' ELSE 'PAID' END AS Membership";
                    strSql          += " from tbl_BookmarkList bm";
                    strSql          += " inner join tbl_MemberMaster mm on mm.membercode=bm.membercode ";
                    strSql          += " left join dbo.tbl_StateCity SM on SM.StateCityCode=MM.StateCity ";
                    strSql          += " LEFT OUTER JOIN dbo.tbl_Caste AS Cas ON MM.Caste = Cas.CasteCode ";
                    strSql          += " WHERE MM.isActive IN (1 ,2) and bm.BookmarkedProfile like '%" + MemberCode + "%'";
                    DataTable dtDetails = objDb.GetDataTable(strSql);
                    if (dtDetails.Rows.Count > 0)
                    {
                        lblTotalCnt.Text = "Total : " + Convert.ToString(dtDetails.Rows.Count);
                        FieldLength      = new int[] { 0, 120, 200, 100, 120, 0, 0, 100, 80, 80, 80, 80 };
                        objGlobal.FillListView(LvwDetails, dtDetails, FieldLength);
                        LvwDetails.CheckBoxes = false;
                    }
                    else
                    {
                        MessageBox.Show("Data not found", txtSearchValue.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }