private bool CheckVotingDate(int districtNo, string years) { bool b = false; int status = 0; DataTable dt = new DataTable(); ElectionDateBll obj = new ElectionDateBll(); obj.Years = years; obj.DistrictNo = districtNo; dt = obj.CheckElectionDateValidity(); if (dt.Rows.Count > 0) { status = int.Parse(dt.Rows[0]["status"].ToString()); eDt = DateTime.Parse(dt.Rows[0]["end_date"].ToString()); } if (status > 0) { b = true; } else { b = false; } return(b); }
private bool CheckVotingDate() { electionId = int.Parse(Session["ElecId"].ToString()); bool b = false; int status = 0; DataTable dt = new DataTable(); ElectionDateBll obj = new ElectionDateBll(); //obj.Years = years; //obj.DistrictNo = districtNo; obj.ElectionId = electionId; dt = obj.CheckElectionDateValidity(); if (dt.Rows.Count > 0) { status = int.Parse(dt.Rows[0]["status"].ToString()); eDt = DateTime.Parse(dt.Rows[0]["end_date"].ToString()); elecName = dt.Rows[0]["election_name"].ToString().Trim(); elecDistrict = dt.Rows[0]["district_no"].ToString().Trim(); elecYears = dt.Rows[0]["years"].ToString().Trim(); } if (status > 0) { b = true; } else { b = false; } return(b); }
private void GetVotingDate() { electionId = int.Parse(Session["ElecId"].ToString()); ElectionDateBll obj = new ElectionDateBll(); //obj.DistrictNo = districtNo; //obj.Years = years; obj.Id = electionId; DataTable dt = new DataTable(); //dt = obj.GetElectionDates(); dt = obj.GetElectionDateById(); if (dt.Rows.Count > 0) { string date = ""; DateTime startDate, endDate; startDate = DateTime.Parse(dt.Rows[0]["start_date"].ToString()); endDate = DateTime.Parse(dt.Rows[0]["end_date"].ToString()); string days = dt.Rows[0]["voting_days"].ToString(); date = startDate.ToString("dddd 'the' dd MMMM yyyy") + " to " + endDate.ToString("dddd 'the' dd MMMM yyyy"); lblDate.Text = "Online voting is valid for " + days + " days only.<br /><br />" + "Voting period will start from " + date + " only."; } }
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { if (e.CommandName == "Delete") { string i = e.CommandArgument.ToString(); int id = int.Parse(i.ToString()); ElectionDateBll obj = new ElectionDateBll(); obj.Id = id; if (obj.DeleteElectionDate() > 0) { RadGrid1.DataBind(); } } }