Esempio n. 1
0
    private void FillMemberData()
    {
        try
        {
            int PageCount = 0;
            tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
            Objtbl_MemberMasterProp.MemberCode  = 0;
            Objtbl_MemberMasterProp.PageNo      = 1;
            Objtbl_MemberMasterProp.RecordCount = 1;

            tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
            DataSet             dsData = Objtbl_MemberMasterBAL.Select_Data(Objtbl_MemberMasterProp, ref PageCount);

            DataRow dr = dsData.Tables[0].NewRow();
            dr["MemberName"] = "--- Primary ---";
            dr["MemberCode"] = 0;

            dsData.Tables[0].Rows.InsertAt(dr, 0);

            lblTotalPage.Text = Convert.ToString(PageCount);

            ddlParentCode.DataSource     = dsData.Tables[0];
            ddlParentCode.DataTextField  = "MemberName";
            ddlParentCode.DataValueField = "MemberCode";
            ddlParentCode.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
        public DataSet FillData(string strSearch)
        {
            DataSet dsData = new DataSet();

            try
            {
                int PageCount = 0;
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.MemberCode  = 0;
                Objtbl_MemberMasterProp.PageNo      = Convert.ToInt32(txtCurPage.Text);
                Objtbl_MemberMasterProp.RecordCount = Convert.ToInt32(20);
                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                if (sSearchVal != "" && sSearchType != "")
                {
                    Objtbl_MemberMasterProp.SearchBy  = sSearchType;
                    Objtbl_MemberMasterProp.SearchVal = sSearchVal;
                    dsData = Objtbl_MemberMasterBAL.Search_Data(Objtbl_MemberMasterProp, ref PageCount);
                }
                else
                {
                    dsData = Objtbl_MemberMasterBAL.Select_Data(Objtbl_MemberMasterProp, ref PageCount);
                    lblTotalPageCount.Text = Convert.ToString(PageCount);
                }


                FillGrid(dsData);
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex.Message));
                this.objEventLoging.AppErrlog("Error In AnantMatrimony.frmMemberMaster.FillData() " + ex.ToString());
            }
            return(dsData);
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 public DataSet Search_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp)
 {
     try
     {
         tbl_MemberMasterDAL Objtbl_MemberMasterDAL = new tbl_MemberMasterDAL();
         return(Objtbl_MemberMasterDAL.Search_Data(Objtbl_MemberMasterProp));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 5
0
 public int Delete_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp)
 {
     try
     {
         tbl_MemberMasterDAL Objtbl_MemberMasterDAL = new tbl_MemberMasterDAL();
         return(Objtbl_MemberMasterDAL.Delete_Data(Objtbl_MemberMasterProp));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
0
 public int Delete_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp)
 {
     try
     {
         Database  DB    = DatabaseFactory.CreateDatabase("AppConNagar");
         DbCommand DBCmd = DB.GetStoredProcCommand("Delete_tbl_MemberMaster");
         DB.AddInParameter(DBCmd, "@MemberCode", DbType.Int32, Objtbl_MemberMasterProp.MemberCode);
         return(DB.ExecuteNonQuery(DBCmd));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        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);
            }
        }
Esempio n. 8
0
 public DataSet Search_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp)
 {
     try
     {
         Database  DB    = DatabaseFactory.CreateDatabase("AppConNagar");
         DbCommand DBCmd = DB.GetStoredProcCommand("Search_tbl_MemberMaster");
         DB.AddInParameter(DBCmd, "@SearchBy", DbType.String, Objtbl_MemberMasterProp.SearchBy);
         DB.AddInParameter(DBCmd, "@SearchVal", DbType.String, Objtbl_MemberMasterProp.SearchVal);
         return(DB.ExecuteDataSet(DBCmd));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 9
0
        private void NewRegisteredAccount()
        {
            try
            {
                tbl_MemberMasterProp objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                objtbl_MemberMasterProp.isActive = 0;

                tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsData = objtbl_MemberMasterBAL.Profile_Summary(objtbl_MemberMasterProp);
                lnkNewRegistered.Text = "New/Unapproved Records ( " + Convert.ToString(dsData.Tables[0].Rows[0]["MemCount"]).PadLeft(3, '0') + " )";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 10
0
        private void BlockProfile()
        {
            try
            {
                tbl_MemberMasterProp objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                objtbl_MemberMasterProp.isActive = 4;

                tbl_MemberMasterBAL objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsData = objtbl_MemberMasterBAL.Profile_Summary(objtbl_MemberMasterProp);
                lnkBlockedProfile.Text = "Blocked Profile Records ( " + Convert.ToString(dsData.Tables[0].Rows[0]["MemCount"]).PadLeft(3, '0') + " )";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 11
0
    private void DeleteData(int MemberCode)
    {
        try
        {
            tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
            Objtbl_MemberMasterProp.MemberCode = MemberCode;

            tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
            Objtbl_MemberMasterBAL.Delete_Data(Objtbl_MemberMasterProp);

            FillData();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 12
0
    private void EditData(int MemberCode)
    {
        try
        {
            tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
            Objtbl_MemberMasterProp.MemberCode = MemberCode;

            int PageCount = 0;
            tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
            DataSet             dsData = Objtbl_MemberMasterBAL.Select_Data(Objtbl_MemberMasterProp, ref PageCount);

            txtMemberName.Text           = Convert.ToString(dsData.Tables[0].Rows[0]["MemberName"]);
            txtCurrentAddress.Text       = Convert.ToString(dsData.Tables[0].Rows[0]["CurrentAddress"]);
            ddlCountryCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["CountryCode"]);
            FillStateCode(Convert.ToInt32(ddlCountryCode.SelectedValue));
            ddlStateCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["StateCode"]);
            FillCityCode(Convert.ToInt32(ddlStateCode.SelectedValue));
            ddlCityCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["CityCode"]);
            txtPermanentAddress.Text  = Convert.ToString(dsData.Tables[0].Rows[0]["PermanentAddress"]);
            txtContactNo.Text         = Convert.ToString(dsData.Tables[0].Rows[0]["ContactNo"]);
            txtEmailID.Text           = Convert.ToString(dsData.Tables[0].Rows[0]["EmailID"]);
            txtDOB.Text = Convert.ToString(dsData.Tables[0].Rows[0]["DOB"]);
            ddlQualificationCode.SelectedValue    = Convert.ToString(dsData.Tables[0].Rows[0]["QualificationCode"]);
            ddlOccupationCode.SelectedIndex       = Convert.ToInt32(dsData.Tables[0].Rows[0]["OccupationCode"]);
            ddlMaritalStatus.SelectedIndex        = Convert.ToInt32(dsData.Tables[0].Rows[0]["MaritalStatusCode"]);
            ddlGender.SelectedIndex               = Convert.ToInt32(dsData.Tables[0].Rows[0]["Gender"]);
            ddlNativePlace.SelectedIndex          = Convert.ToInt32(dsData.Tables[0].Rows[0]["NativePlaceCode"]);
            ddlNationality.SelectedIndex          = Convert.ToInt32(dsData.Tables[0].Rows[0]["NationalityCode"]);
            ddlPhysicallyChallanged.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["PhysicalChallangedCode"]);
            ddlRelationshipCode.SelectedIndex     = Convert.ToInt32(dsData.Tables[0].Rows[0]["RelationshipCode"]);
            ddlParentCode.SelectedValue           = Convert.ToString(dsData.Tables[0].Rows[0]["ParentCode"]);

            tdUploadedFile.Visible = true;
            imgPhotos.ImageUrl     = "~/MembersPhotos/" + Convert.ToString(dsData.Tables[0].Rows[0]["PhotoPath"]).Split('.')[0] + ".jpg";


            ViewState["PhotoPath"] = Convert.ToString(dsData.Tables[0].Rows[0]["PhotoPath"]);

            ViewState["EditCode"] = MemberCode;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 13
0
 public DataSet Select_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp, ref int TotalCount)
 {
     try
     {
         Database  DB    = DatabaseFactory.CreateDatabase("AppConNagar");
         DbCommand DBCmd = DB.GetStoredProcCommand("Select_tbl_MemberMaster");
         DB.AddInParameter(DBCmd, "@MemberCode", DbType.Int32, Objtbl_MemberMasterProp.MemberCode);
         DB.AddInParameter(DBCmd, "@PageNo", DbType.Int32, Objtbl_MemberMasterProp.PageNo);
         DB.AddInParameter(DBCmd, "@RecordCount", DbType.Int32, Objtbl_MemberMasterProp.RecordCount);
         DB.AddOutParameter(DBCmd, "@TotalCount", DbType.Int32, 18);
         DataSet dsData = DB.ExecuteDataSet(DBCmd);
         TotalCount = Convert.ToInt32(DBCmd.Parameters["@TotalCount"].Value);
         return(dsData);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 14
0
    private void FillData()
    {
        try
        {
            int PageCount = 0;
            tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
            Objtbl_MemberMasterProp.MemberCode  = 0;
            Objtbl_MemberMasterProp.PageNo      = Convert.ToInt32(1);
            Objtbl_MemberMasterProp.RecordCount = Convert.ToInt32(20);

            tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
            DataSet             dsData = Objtbl_MemberMasterBAL.Select_Data(Objtbl_MemberMasterProp, ref PageCount);

            rptData.DataSource = dsData.Tables[0];
            rptData.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 15
0
        public int InsertUpdate_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp)
        {
            try
            {
                Database  DB    = DatabaseFactory.CreateDatabase("AppConNagar");
                DbCommand DBCmd = DB.GetStoredProcCommand("InsertUpdate_tbl_MemberMaster");
                DB.AddInParameter(DBCmd, "@MemberCode", DbType.Int32, Objtbl_MemberMasterProp.MemberCode);
                DB.AddInParameter(DBCmd, "@MemberName", DbType.String, Objtbl_MemberMasterProp.MemberName);
                DB.AddInParameter(DBCmd, "@CurrentAddress", DbType.String, Objtbl_MemberMasterProp.CurrentAddress);
                DB.AddInParameter(DBCmd, "@CountryCode", DbType.Int32, Objtbl_MemberMasterProp.CountryCode);
                DB.AddInParameter(DBCmd, "@StateCode", DbType.Int32, Objtbl_MemberMasterProp.StateCode);
                DB.AddInParameter(DBCmd, "@CityCode", DbType.Int32, Objtbl_MemberMasterProp.CityCode);
                DB.AddInParameter(DBCmd, "@PermanentAddress", DbType.String, Objtbl_MemberMasterProp.PermanentAddress);
                DB.AddInParameter(DBCmd, "@ContactNo", DbType.String, Objtbl_MemberMasterProp.ContactNo);
                DB.AddInParameter(DBCmd, "@EmailID", DbType.String, Objtbl_MemberMasterProp.EmailID);
                DB.AddInParameter(DBCmd, "@Password", DbType.String, Objtbl_MemberMasterProp.Password);
                DB.AddInParameter(DBCmd, "@DOB", DbType.DateTime, Objtbl_MemberMasterProp.DOB);
                DB.AddInParameter(DBCmd, "@QualificationCode", DbType.Int32, Objtbl_MemberMasterProp.QualificationCode);
                DB.AddInParameter(DBCmd, "@OccupationCode", DbType.Int32, Objtbl_MemberMasterProp.OccupationCode);
                DB.AddInParameter(DBCmd, "@MaritalStatusCode", DbType.Int32, Objtbl_MemberMasterProp.MaritalStatusCode);
                DB.AddInParameter(DBCmd, "@Gender", DbType.Boolean, Objtbl_MemberMasterProp.Gender);
                DB.AddInParameter(DBCmd, "@NativePlaceCode", DbType.Int32, Objtbl_MemberMasterProp.NativePlaceCode);
                DB.AddInParameter(DBCmd, "@NationalityCode", DbType.Int32, Objtbl_MemberMasterProp.NationalityCode);
                DB.AddInParameter(DBCmd, "@PhysicalChallangedCode", DbType.Int32, Objtbl_MemberMasterProp.PhysicalChallangedCode);
                DB.AddInParameter(DBCmd, "@ParentCode", DbType.Int32, Objtbl_MemberMasterProp.ParentCode);
                DB.AddInParameter(DBCmd, "@RelationshipCode", DbType.Int32, Objtbl_MemberMasterProp.RelationshipCode);
                DB.AddInParameter(DBCmd, "@PhotoPath", DbType.String, Objtbl_MemberMasterProp.PhotoPath);

                DB.AddOutParameter(DBCmd, "@RetVal", DbType.Int32, 18);

                DB.ExecuteNonQuery(DBCmd);
                return(Convert.ToInt32(DBCmd.Parameters["@RetVal"].Value));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 16
0
 public DataSet Select_Data(tbl_MemberMasterProp Objtbl_MemberMasterProp, ref int PageCount)
 {
     try
     {
         if (Objtbl_MemberMasterProp.MemberCode != 0)
         {
             Objtbl_MemberMasterProp.PageNo      = 1;
             Objtbl_MemberMasterProp.RecordCount = 1;
         }
         int RecordCount = 0;
         tbl_MemberMasterDAL Objtbl_MemberMasterDAL = new tbl_MemberMasterDAL();
         DataSet             dsData = Objtbl_MemberMasterDAL.Select_Data(Objtbl_MemberMasterProp, ref RecordCount);
         double Page = Convert.ToDouble(RecordCount) / Convert.ToDouble(Objtbl_MemberMasterProp.RecordCount);
         if (dsData.Tables[0].Rows.Count > 0)
         {
             string[] PageDecimal = Page.ToString().Split('.');
             if (PageDecimal.Length > 1 && Convert.ToInt32(PageDecimal[1]) > 0)
             {
                 PageCount = Convert.ToInt32(Page.ToString().Split('.')[0]) + 1;
             }
             else
             {
                 PageCount = Convert.ToInt32(Page);
             }
         }
         else
         {
             PageCount = 0;
         }
         return(dsData);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public DataSet SeaarchData(string sSearchBy, string sSearchVal)
        {
            DataSet ds = new DataSet();

            try
            {
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.SearchBy  = sSearchBy;
                Objtbl_MemberMasterProp.SearchVal = sSearchVal;

                Objtbl_MemberMasterProp.PageNo      = 1;
                Objtbl_MemberMasterProp.RecordCount = 10000;

                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                int PageCount = 0;
                ds = Objtbl_MemberMasterBAL.Search_Data(Objtbl_MemberMasterProp, ref PageCount);
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex.Message));
                this.objEventLoging.AppErrlog("Error In AnantMatrimony.frmMemberMaster.SeaarchData() " + ex.ToString());
            }
            return(ds);
        }
Esempio n. 18
0
    //private void FillMemberCode(int MemberCode)
    //{
    //    try
    //    {
    //        tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
    //        Objtbl_MemberMasterProp.MemberCode = MemberCode;

    //        int PageCount = 0;
    //        tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
    //        DataSet dsData = Objtbl_MemberMasterBAL.Select_Data(Objtbl_MemberMasterProp, ref PageCount);

    //        txtMemberName.Text = Convert.ToString(dsData.Tables[0].Rows[0]["MemberName"]);
    //        txtCurrentAddress.Text = Convert.ToString(dsData.Tables[0].Rows[0]["CurrentAddress"]);
    //        ddlCountryCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["CountryCode"]);
    //        ddlStateCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["StateCode"]);
    //        ddlCityCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["CityCode"]);
    //        txtPermanentAddress.Text = Convert.ToString(dsData.Tables[0].Rows[0]["PermanentAddress"]);
    //        txtContactNo.Text = Convert.ToString(dsData.Tables[0].Rows[0]["ContactNo"]);
    //        txtEmailID.Text = Convert.ToString(dsData.Tables[0].Rows[0]["EmailID"]);
    //        txtDOB.Text = Convert.ToString(dsData.Tables[0].Rows[0]["DOB"]);
    //        ddlQualificationCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["QualificationCode"]);
    //        ddlOccupationCode.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["OccupationCode"]);
    //        ddlMaritalStatus.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["MaritalStatusCode"]);
    //        ddlGender.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["Gender"]);
    //        ddlNativePlace.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["NativePlaceCode"]);
    //        ddlNationality.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["NationalityCode"]);
    //        ddlPhysicallyChallanged.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["PhysicallyChallangedCode"]);
    //        ddlRelationshipCode.SelectedIndex = Convert.ToInt32(dsData.Tables[0].Rows[0]["RelationshipCode"]);
    //        ddlParentCode.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["ParentCode"]);

    //        Objtbl_MemberMasterProp.PhotoPath = sFilename;

    //        ViewState["EditCode"] = MemberCode;
    //    }
    //    catch (Exception ex)
    //    {
    //        throw ex;
    //    }
    //}

    #endregion

    #region "--------------- Buttons Events ---------------"

    protected void imgbtnSave_Click(object sender, ImageClickEventArgs e)
    {
        string sSavePath = "";
        string sFilename = "";

        try
        {
            if (chkDeleteFilePath.Checked == false)
            {
                // Set constant values
                sSavePath = "../MembersPhotos/";

                // If file field isn’t empty
                if (flFilePath.PostedFile != null && flFilePath.PostedFile.ContentLength > 0)
                {
                    // Check file size (mustn’t be 0)
                    HttpPostedFile myFile   = flFilePath.PostedFile;
                    int            nFileLen = myFile.ContentLength;
                    if (nFileLen == 0)
                    {
                        ShowGuidMessage(0, new Exception("No file was uploaded."));
                        return;
                    }

                    // Check file extension (must be JPG or pdf)
                    if (System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpg")
                    {
                        ShowGuidMessage(0, new Exception("The file must have an extension of JPG or pdf"));
                        return;
                    }

                    // Read file into a data stream
                    byte[] myData = new Byte[nFileLen];
                    myFile.InputStream.Read(myData, 0, nFileLen);

                    // Make sure a duplicate file doesn’t exist.  If it does, keep on appending an
                    // incremental numeric until it is unique
                    sFilename = System.IO.Path.GetFileName(myFile.FileName);
                    int file_append = 0;
                    while (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename)))
                    {
                        file_append++;
                        sFilename = System.IO.Path.GetFileNameWithoutExtension(myFile.FileName)
                                    + file_append.ToString() + System.IO.Path.GetExtension(myFile.FileName).ToLower();
                    }

                    // Save the stream to disk
                    System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename),
                                                                            System.IO.FileMode.Create);
                    newFile.Write(myData, 0, myData.Length);
                    newFile.Close();

                    // Check whether the file is really a JPEG by opening it
                    System.Drawing.Image.GetThumbnailImageAbort myCallBack =
                        new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
                    Bitmap myBitmap;
                    try
                    {
                        myBitmap = new Bitmap(Server.MapPath(sSavePath + sFilename));

                        tdUploadedFile.Visible   = true;
                        tdUploadedFile.InnerHtml = "<a href=\"..\\" + sSavePath + sFilename + ">Download Attachment</a>";

                        // Displaying success information
                        //tdError.InnerText = "File uploaded successfully!";

                        // Destroy objects
                        myBitmap.Dispose();
                    }
                    catch
                    {
                        // The file wasn't a valid jpg file
                        System.IO.File.Delete(Server.MapPath(sSavePath + sFilename));
                        ShowGuidMessage(0, new Exception("The file wasn't a valid jpg file"));
                        return;
                    }
                }
            }

            if (sFilename == "" && Convert.ToInt32(ViewState["EditCode"]) > 0)
            {
                sFilename = Convert.ToString(ViewState["PhotoPath"]);
            }
            else if (sFilename == "" && Convert.ToInt32(ViewState["EditCode"]) <= 0)
            {
                sFilename = "noimage.jpg";
            }
            else if (chkDeleteFilePath.Checked == true)
            {
                if (Convert.ToInt32(ViewState["EditCode"]) > 0)
                {
                    System.IO.File.Delete(Server.MapPath(sSavePath + Convert.ToString(ViewState["PhotoPath"])));
                }
                sFilename = "noimage.jpg";
            }
            tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
            Objtbl_MemberMasterProp.MemberCode       = Convert.ToInt32(ViewState["EditCode"]);
            Objtbl_MemberMasterProp.MemberName       = txtMemberName.Text;
            Objtbl_MemberMasterProp.CurrentAddress   = txtCurrentAddress.Text;
            Objtbl_MemberMasterProp.CountryCode      = Convert.ToInt32(ddlCountryCode.SelectedValue);
            Objtbl_MemberMasterProp.StateCode        = Convert.ToInt32(ddlStateCode.SelectedValue);
            Objtbl_MemberMasterProp.CityCode         = Convert.ToInt32(ddlCityCode.SelectedValue);
            Objtbl_MemberMasterProp.PermanentAddress = txtPermanentAddress.Text;
            Objtbl_MemberMasterProp.ContactNo        = txtContactNo.Text;
            Objtbl_MemberMasterProp.EmailID          = txtEmailID.Text;
            Objtbl_MemberMasterProp.Password         = "******";
            Objtbl_MemberMasterProp.DOB = new DateTime(Convert.ToInt32(txtDOB.Text.Split('/')[2]), Convert.ToInt32(txtDOB.Text.Split('/')[1]), Convert.ToInt32(txtDOB.Text.Split('/')[0]));
            Objtbl_MemberMasterProp.QualificationCode      = Convert.ToInt32(ddlQualificationCode.SelectedValue);
            Objtbl_MemberMasterProp.OccupationCode         = Convert.ToInt32(ddlOccupationCode.Text);
            Objtbl_MemberMasterProp.MaritalStatusCode      = Convert.ToInt32(ddlMaritalStatus.SelectedIndex);
            Objtbl_MemberMasterProp.Gender                 = Convert.ToBoolean(ddlGender.SelectedIndex);
            Objtbl_MemberMasterProp.NativePlaceCode        = Convert.ToInt32(ddlNativePlace.SelectedValue);
            Objtbl_MemberMasterProp.NationalityCode        = Convert.ToInt32(ddlNationality.SelectedValue);
            Objtbl_MemberMasterProp.PhysicalChallangedCode = Convert.ToInt32(ddlPhysicallyChallanged.SelectedIndex);
            Objtbl_MemberMasterProp.RelationshipCode       = Convert.ToInt32(ddlRelationshipCode.SelectedIndex);
            Objtbl_MemberMasterProp.ParentCode             = Convert.ToInt32(ddlParentCode.SelectedValue);
            Objtbl_MemberMasterProp.PhotoPath              = sFilename;

            tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
            Objtbl_MemberMasterBAL.InsertUpdate_Data(Objtbl_MemberMasterProp);
            ShowGuidMessage(1, null);
            mdlPopupNewEntry.Hide();
            FillData();
        }
        catch (Exception ex)
        {
            ShowGuidMessage(0, ex); //MessageBox.Show(ex.Message);
        }
    }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                string strCode = "";
                if (txtProfileId.Text == "")
                {
                    MessageBox.Show("Please Enter Profile Id", "Profile Id Validation", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtProfileId.Focus();
                    return;
                }
                if (txtProfileId.Text != "")
                {
                    string    strSQl = "select * from tbl_Membermaster where ProfileId='" + txtProfileId.Text.Trim() + "' ";
                    DataTable dt     = objDb.GetDataTable(strSQl);
                    if (dt.Rows.Count > 0)
                    {
                        strCode = Convert.ToString(dt.Rows[0]["MemberCode"]);
                    }
                    else
                    {
                        MessageBox.Show("Please Enter valid Profile Id", "Valid Profile Id", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtProfileId.Focus();
                        return;
                    }
                }
                tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                Objtbl_MemberMasterProp.MemberCode = Convert.ToInt32(strCode);
                Objtbl_MemberMasterProp.ProfileID  = ""; // ProfileID;
                Objtbl_MemberMasterProp.isLogedin  = true;
                Objtbl_MemberMasterProp.LoginCode  = 0;

                tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);

                dsMemberMaster.Tables[0].TableName = "dsMemberMaster";

                tbl_SibblingDetailsProp Objtbl_SibblingDetailsProp = new tbl_SibblingDetailsProp();
                Objtbl_SibblingDetailsProp.MemberCode = Convert.ToInt32(dsMemberMaster.Tables[0].Rows[0]["MemberCode"]);

                tbl_SibblingDetailsBAL Objtbl_SibblingDetailsBAL = new tbl_SibblingDetailsBAL();
                DataSet dsSibbling = Objtbl_SibblingDetailsBAL.Select_Data(Objtbl_SibblingDetailsProp);
                dsSibbling.Tables[0].TableName = "dsSibblingDtl";

                tbl_MemberPhotosBAL  objtbl_MemberPhotosBAL  = new tbl_MemberPhotosBAL();
                tbl_MemberPhotosProp objtbl_MemberPhotosProp = new tbl_MemberPhotosProp();
                objtbl_MemberPhotosProp.MemberCode = Convert.ToInt32(strCode);
                DataSet dsMemberPhotos = objtbl_MemberPhotosBAL.Select_Data(objtbl_MemberPhotosProp);
                dsMemberPhotos.Tables[0].TableName = "dsMemberPhotos";

                // dsMemberMaster.Tables.Add(dsSibbling.Tables[0]);
                //dsMemberMaster.Tables.Add(dsMemberPhotos.Tables[0]);
                frmReportViewer objReportViewer = new frmReportViewer();
                ReportDocument  cryRpt          = new ReportDocument();
                string          strPath         = Application.StartupPath + @"\REPORTS\MemberMaster.rpt";
                cryRpt.Load(strPath);
                DataSet dstest = new DataSet();

                dstest.Tables.Add(dsMemberMaster.Tables[0].Copy());
                //dstest.Tables.Add(dsMemberPhotos.Tables[0].Copy());
                cryRpt.Subreports["Sibbling"].SetDataSource(dsSibbling.Tables[0]);
                //cryRpt.Subreports["MemberPhotos"].SetDataSource(dsMemberPhotos.Tables[0]);

                cryRpt.SetDataSource(dstest);

                objReportViewer.RptViewer.ReportSource = cryRpt;
                objReportViewer.RptViewer.Refresh();
                objReportViewer.ShowDialog();
                objReportViewer.Focus();
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                MessageBox.Show(Convert.ToString(ex.Message));
                this.objEventLoging.AppErrlog("Error In AnantMatrimony.rfrmQuickReport.btnSearch_Click() " + ex.ToString());
            }
        }
        private void dgvDetails_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                int    intRowNo  = e.RowIndex;
                string strCode   = Convert.ToString(dgvDetails[(int)CI.MemberCode, e.RowIndex].Value);
                string ProfileId = Convert.ToString(dgvDetails[(int)CI.ProfileId, e.RowIndex].Value);

                if (e.ColumnIndex == (int)CI.Edit)
                {
                    this.objEventLoging.AppClickLog("Search", "Edit", ProfileId, strCode, "");
                    //Global.strMemberCode = strCode;
                    frmMemberMaster objMember = new frmMemberMaster();
                    if (Convert.ToString(dgvDetails[(int)CI.Status, e.RowIndex].Value) == "Active")
                    {
                        frmMemberMaster.isActiveStatus = 1;
                    }
                    else if (Convert.ToString(dgvDetails[(int)CI.Status, e.RowIndex].Value) == "Updated")
                    {
                        frmMemberMaster.isActiveStatus = 2;
                    }
                    frmMemberMaster.strMemberCode = strCode;
                    objMember.ShowDialog();
                    txtCurPage.Text = "1";
                    FillData("");
                    ddlSearchBy.SelectedIndex = 0;
                    txtSearchValue.Text       = "";
                }
                else if (e.ColumnIndex == (int)CI.Print)
                {
                    this.objEventLoging.AppClickLog("Search", "Print", ProfileId, strCode, "");
                    //DataTable dsData = new DataTable();
                    //int PageCount = 0;
                    //string strSql = "select MemberCode,ProfileID,ProfileCreatedBy,MemberName,Gender,DateofBirth,TimeofBirth,BirthPlace,MaritalStatus ";
                    //strSql += " from tbl_membermaster where MemberCode=" + strCode;
                    //dsData = objDb.GetDataTable(strSql);

                    tbl_MemberMasterProp Objtbl_MemberMasterProp = new tbl_MemberMasterProp();
                    Objtbl_MemberMasterProp.MemberCode = 0;
                    Objtbl_MemberMasterProp.ProfileID  = ProfileId; // ProfileID;
                    Objtbl_MemberMasterProp.isLogedin  = true;
                    Objtbl_MemberMasterProp.LoginCode  = 0;

                    tbl_MemberMasterBAL Objtbl_MemberMasterBAL = new tbl_MemberMasterBAL();
                    DataSet             dsMemberMaster         = Objtbl_MemberMasterBAL.Load_MemberDetails(Objtbl_MemberMasterProp);

                    dsMemberMaster.Tables[0].TableName = "dsMemberMaster";

                    tbl_SibblingDetailsProp Objtbl_SibblingDetailsProp = new tbl_SibblingDetailsProp();
                    Objtbl_SibblingDetailsProp.MemberCode = Convert.ToInt32(dsMemberMaster.Tables[0].Rows[0]["MemberCode"]);

                    tbl_SibblingDetailsBAL Objtbl_SibblingDetailsBAL = new tbl_SibblingDetailsBAL();
                    DataSet dsSibbling = Objtbl_SibblingDetailsBAL.Select_Data(Objtbl_SibblingDetailsProp);
                    dsSibbling.Tables[0].TableName = "dsSibblingDtl";


                    tbl_MemberPhotosBAL  objtbl_MemberPhotosBAL  = new tbl_MemberPhotosBAL();
                    tbl_MemberPhotosProp objtbl_MemberPhotosProp = new tbl_MemberPhotosProp();
                    objtbl_MemberPhotosProp.MemberCode = Convert.ToInt32(strCode);
                    DataSet dsMemberPhotos = objtbl_MemberPhotosBAL.Select_Data(objtbl_MemberPhotosProp);
                    dsMemberPhotos.Tables[0].TableName = "dsMemberPhotos";

                    // dsMemberMaster.Tables.Add(dsSibbling.Tables[0]);
                    //dsMemberMaster.Tables.Add(dsMemberPhotos.Tables[0]);
                    frmReportViewer objReportViewer = new frmReportViewer();
                    ReportDocument  cryRpt          = new ReportDocument();
                    string          strPath         = Application.StartupPath + @"\REPORTS\MemberMaster.rpt";
                    cryRpt.Load(strPath);
                    DataSet dstest = new DataSet();

                    dstest.Tables.Add(dsMemberMaster.Tables[0].Copy());
                    //dstest.Tables.Add(dsMemberPhotos.Tables[0].Copy());
                    cryRpt.Subreports["Sibbling"].SetDataSource(dsSibbling.Tables[0]);
                    //cryRpt.Subreports["MemberPhotos"].SetDataSource(dsMemberPhotos.Tables[0]);

                    cryRpt.SetDataSource(dstest);

                    objReportViewer.RptViewer.ReportSource = cryRpt;
                    objReportViewer.RptViewer.Refresh();
                    objReportViewer.ShowDialog();
                    objReportViewer.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }