private void GetClub(int id) { DistrictClub dc = new DistrictClub(); DataTable dt = new DataTable(); dc.Id = id; dt = dc.GetClubById(); //dc.RiClubNo = id; //dt = dc.GetClubByClubId(); if (dt.Rows.Count > 0) { ddlDistNo.SelectedItem.Text = dt.Rows[0]["district_no"].ToString(); txtTitle.Text = dt.Rows[0]["club_name"].ToString(); txtClubNo.Text = dt.Rows[0]["ri_club_no"].ToString(); DDLClubName.SelectedItem.Text = dt.Rows[0]["sponsored_club"].ToString(); charterDate.SelectedDate = DateTime.Parse(dt.Rows[0]["charter_date"].ToString()); DDLDay.SelectedItem.Text = dt.Rows[0]["meeting_day"].ToString(); meetingTime.SelectedDate = DateTime.Parse(dt.Rows[0]["meeting_time"].ToString()); txtVenue1.Text = dt.Rows[0]["venue1"].ToString(); txtVenue2.Text = dt.Rows[0]["venue2"].ToString(); txtLandmark.Text = dt.Rows[0]["landmark"].ToString(); txtCity.Text = dt.Rows[0]["city"].ToString(); txtPin.Text = dt.Rows[0]["pin"].ToString(); txtState.Text = dt.Rows[0]["state"].ToString(); txtCountry.Text = dt.Rows[0]["country"].ToString(); txtLatitude.Text = dt.Rows[0]["gps_latitude"].ToString(); txtLongitude.Text = dt.Rows[0]["gps_longitude"].ToString(); txtWebsite.Text = dt.Rows[0]["website"].ToString(); string strImgLogo = dt.Rows[0]["club_logo"].ToString(); if (strImgLogo != "") { Session["ImageLogo"] = strImgLogo; imgLogo.Visible = true; imgLogo.ImageUrl = "../ClubsLogo/" + strImgLogo; } string strImgMap = dt.Rows[0]["location_map"].ToString(); if (strImgMap != "") { Session["ImageMap"] = strImgMap; imgMap.Visible = true; imgMap.ImageUrl = "../ClubsLogo/" + strImgMap; } DDLMem1.SelectedItem.Text = dt.Rows[0]["ds"].ToString(); DDLMem2.SelectedItem.Text = dt.Rows[0]["ag"].ToString(); DDLMem3.SelectedItem.Text = dt.Rows[0]["at"].ToString(); DDLMem4.SelectedItem.Text = dt.Rows[0]["gc"].ToString(); txtPHF.Text = dt.Rows[0]["phf"].ToString(); txtTRFSM.Text = dt.Rows[0]["trfsm"].ToString(); txtMD.Text = dt.Rows[0]["md"].ToString(); txtPHSM.Text = dt.Rows[0]["phsm"].ToString(); txtArchKlump.Text = dt.Rows[0]["arch_klump"].ToString(); try { installationDate.SelectedDate = DateTime.Parse(dt.Rows[0]["installation_date"].ToString()); } catch { } //try //{ // installationTime.SelectedDate = DateTime.Parse(dt.Rows[0]["installation_time"].ToString()); //} //catch { } string strTime = dt.Rows[0]["installation_time"].ToString(); if (strTime == "Morning") { rbtnTime.SelectedIndex = 0; } if (strTime == "Afternoon") { rbtnTime.SelectedIndex = 1; } if (strTime == "Evening") { rbtnTime.SelectedIndex = 2; } txtChiefGuest.Text = dt.Rows[0]["installation_chief_guest"].ToString(); txtInstallationVenue.Text = dt.Rows[0]["installation_venue"].ToString(); try { ocvDate.SelectedDate = DateTime.Parse(dt.Rows[0]["ocv_date"].ToString()); } catch { } try { ocvTime.SelectedDate = DateTime.Parse(dt.Rows[0]["ocv_time"].ToString()); } catch { } string strTrfStatus = dt.Rows[0]["club_trf_status"].ToString(); if (strTrfStatus == "N/A") { rbtnClubTrfStatus.SelectedIndex = 0; } if (strTrfStatus == "100% PHFSM Club") { rbtnClubTrfStatus.SelectedIndex = 1; } if (strTrfStatus == "100% PHF Club") { rbtnClubTrfStatus.SelectedIndex = 2; } if (strTrfStatus == "100% EREY Club") { rbtnClubTrfStatus.SelectedIndex = 3; } if (strTrfStatus == "100% MD Club") { rbtnClubTrfStatus.SelectedIndex = 4; } txtFlagshipProject.Text = dt.Rows[0]["flagship_text"].ToString(); string strFlagshipImg = dt.Rows[0]["flagship_image"].ToString(); if (strFlagshipImg != "") { Session["FlagshipImg"] = strFlagshipImg; imgFlagship.Visible = true; imgFlagship.ImageUrl = "../ProjectFlagship/" + strFlagshipImg; } } }
private void GetClubDetails(int id) { try { DistrictClub obj = new DistrictClub(); obj.Id = id; DataTable dt = new DataTable(); dt = obj.GetClubById(); if (dt.Rows.Count > 0) { // Club Details lblClubName.Text = dt.Rows[0]["club_name"].ToString(); lblClubNo.Text = dt.Rows[0]["ri_club_No"].ToString(); DateTime chrterdate = DateTime.Parse(dt.Rows[0]["charter_date"].ToString()); lblCharterDate.Text = chrterdate.ToString("dd-MMMM-yyyy"); lblMeetingDay.Text = dt.Rows[0]["meeting_day"].ToString(); // lblMeetingTime.Text = dt.Rows[0]["meeting_time"].ToString(); try { DateTime meetingTime = DateTime.Parse(dt.Rows[0]["meeting_time"].ToString()); lblMeetingTime.Text = meetingTime.ToString("hh:mm tt"); } catch { lblMeetingTime.Text = "-"; } lblVenue.Text = dt.Rows[0]["venue1"].ToString() + " " + dt.Rows[0]["venue2"].ToString() + " " + dt.Rows[0]["city"].ToString(); lblDS.Text = dt.Rows[0]["ds"].ToString(); lblAT.Text = dt.Rows[0]["at"].ToString(); lblAG.Text = dt.Rows[0]["ag"].ToString(); lblFlagship.Text = dt.Rows[0]["flagship_text"].ToString(); string strFlagship = dt.Rows[0]["flagship_image"].ToString(); if (strFlagship != "") { imgFlagship.Visible = true; imgFlagship.ImageUrl = "../ProjectFlagship/" + strFlagship; } else { imgFlagship.Visible = false; } DateTime instDate = DateTime.Parse(dt.Rows[0]["installation_date"].ToString()); lblInstallation.Text = instDate.ToString("dd-MMMM-yyyy"); DateTime ocvDate = DateTime.Parse(dt.Rows[0]["ocv_date"].ToString()); lblOcv.Text = ocvDate.ToString("dd-MMMM-yyyy"); //string gps = dt.Rows[0]["gps_latitude"].ToString(); //if (gps != "") //{ // lblGPS.Text = "Latitude : " + dt.Rows[0]["gps_latitude"].ToString() + " " + "Longitude : " + dt.Rows[0]["gps_longitude"].ToString(); //} //else //{ // lblGPS.Text = ""; //} //lblInstTime.Text = dt.Rows[0]["installation_time"].ToString(); //lblInstChiefGuest.Text = dt.Rows[0]["installation_chief_guest"].ToString(); //lblInstVenue.Text = dt.Rows[0]["installation_venue"].ToString(); //lblOcvTime.Text = dt.Rows[0]["ocv_time"].ToString(); //lblTrfStatus.Text = dt.Rows[0]["club_trf_status"].ToString(); //string strLogo = dt.Rows[0]["club_logo"].ToString(); //if(strLogo!="") //{ // imgLogo.Visible = true; // imgLogo.ImageUrl = "../ClubsLogo/" + strLogo; //} //else //{ // imgLogo.Visible = false; //} //string strLocationMap = dt.Rows[0]["location_map"].ToString(); //if (strLocationMap != "") //{ // imgMap.Visible = true; // imgMap.ImageUrl = "../ClubsLogo/" + strLocationMap; //} //else //{ // imgMap.Visible = false; //} } } catch { } }
protected void btnSendDistrictDirectoryData_Click(object sender, EventArgs e) { int clubId = 0; string email = "-"; string clubName = "-"; string clubNo = "-"; string charterDate = "-"; string mettingDay = "-"; string strMeetingTime = "-"; string venue = "-"; string ds = "-"; string at = "-"; string ag = "-"; string flagshipText = "-"; string strFlagship = ""; int members = 0; int womenMembers = 0; int iw, rotract, interact, srCitizen, rcc = 0; foreach (GridDataItem item in RadGrid1.MasterTableView.Items) { try { CheckBox chkbox = (CheckBox)item.FindControl("chkActive"); Label lblClubId = (Label)item.FindControl("lblClubId"); Label lblEmail = (Label)item.FindControl("lblEmail"); if (chkbox.Checked) { clubId = Int32.Parse(lblClubId.Text.ToString()); //GetClubDetails(clubId); iw = GetIw(clubId); rotract = GetRotaract(clubId); interact = GetInteract(clubId); srCitizen = GetSrCitizen(clubId); rcc = GetRcc(clubId); //GetBodDetails(clubId); BindGridview(clubId); BindPresident(clubId); BindSecretary(clubId); DataTable dt = new DataTable(); DBconnection obj = new DBconnection(); obj.SetCommandSP = "z_GetMaleFemaleMembersByClubId"; obj.AddParam("@club_id", clubId); dt = obj.ExecuteTable(); if (dt.Rows.Count > 0) { members = int.Parse(dt.Rows[0]["Total"].ToString()); womenMembers = int.Parse(dt.Rows[0]["WomenMembers"].ToString()); } try { DistrictClub obj1 = new DistrictClub(); obj1.Id = clubId; DataTable dt1 = new DataTable(); dt1 = obj1.GetClubById(); if (dt1.Rows.Count > 0) { // Club Details clubName = dt1.Rows[0]["club_name"].ToString(); clubNo = dt1.Rows[0]["ri_club_No"].ToString(); DateTime chrterdate = DateTime.Parse(dt1.Rows[0]["charter_date"].ToString()); charterDate = chrterdate.ToString("dd-MMMM-yyyy"); mettingDay = dt1.Rows[0]["meeting_day"].ToString(); try { DateTime meetingTime = DateTime.Parse(dt1.Rows[0]["meeting_time"].ToString()); strMeetingTime = meetingTime.ToString("hh:mm tt"); } catch { strMeetingTime = "-"; } venue = dt1.Rows[0]["venue1"].ToString() + " " + dt1.Rows[0]["venue2"].ToString() + " " + dt1.Rows[0]["city"].ToString(); ds = dt1.Rows[0]["ds"].ToString(); at = dt1.Rows[0]["at"].ToString(); ag = dt1.Rows[0]["ag"].ToString(); flagshipText = dt1.Rows[0]["flagship_text"].ToString(); strFlagship = dt1.Rows[0]["flagship_image"].ToString(); //if (strFlagship != "") //{ // imgFlagship.Visible = true; // imgFlagship.ImageUrl = "../ClubsLogo/" + strFlagship; //} //else //{ // imgFlagship.Visible = false; //} } } catch { } email = lblEmail.Text.ToString(); if (email != "") { try { SendMailtoDistDirectory(email, clubId, clubName, clubNo, charterDate, members, womenMembers, iw, rotract, interact, srCitizen, rcc, venue, mettingDay, strMeetingTime, ds, at, ag, flagshipText, strFlagship); } catch { } } } chkbox.Checked = false; } catch { } } }