protected void BindTehsil(int id, DropDownList ddl) { using (DefaultCS db = new DefaultCS()) { ddl.DataSource = db.Tehsils.Where(i => i.DistrictId == id).ToList(); ddl.DataBind(); } }
protected void BindForm() { string str; int num = Convert.ToInt32(base.Server.HtmlEncode(base.Request.QueryString["Code"])); DefaultCS defaultC = new DefaultCS(); try { defaultC.ForestAreas.MergeOption = MergeOption.NoTracking; var variable = ( from b in defaultC.ForestAreas orderby b.ForestName select new { Block = b.Block.BlockName, BlockId = b.BlockId, Division = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.DIV_ENAME, Circle = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.mCIRCLE.CIRCLE_ENAME, Zone = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.mCIRCLE.mWING.DESCRIPTION, VillageId = b.VillageId, VillageName = b.Village.VillageName, ForestName = b.ForestName, ForestType = b.ForestType, Id = b.Id, } into i where i.Id == (long)num select i).First(); this.ViewState["blockId"] = variable.BlockId.ToString(); this.ViewState["block"] = variable.Block.ToString(); this.lblZone.Text = variable.Zone; this.lblCircle.Text = variable.Circle; this.lblDivision.Text = variable.Division; this.lblBlcok.Text = variable.Block; this.lblVillage.Text = variable.VillageName; Label label = this.lblForestType; if (variable.ForestType == "R") { str = "Reserved"; } else if (variable.ForestType == "U") { str = "Protected"; } else { str = (variable.ForestType == "C" ? "Cadastral" : "Other"); } label.Text = str; } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
protected void BindForm() { string str; int num = Convert.ToInt32(base.Server.HtmlEncode(base.Request.QueryString["Code"])); DefaultCS defaultC = new DefaultCS(); try { defaultC.ForestAreas.MergeOption = MergeOption.NoTracking; var variable = ( from b in defaultC.ForestAreas orderby b.ForestName select new { Block = b.Block.BlockName, Division = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.DIV_ENAME, Circle = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.mCIRCLE.CIRCLE_ENAME, Zone = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.mCIRCLE.mWING.DESCRIPTION, BlockId = b.BlockId, VillageId = b.VillageId, VillageName = b.Village.VillageName, ForestName = b.ForestName, ForestType = b.ForestType, Id = b.Id, NotificationNo = b.NotificationNo, NotificationType = b.NotificationType, GazetteDate = b.GazetteDate, GazetteNo = b.GazetteNo, GazetteAuthority = b.GazetteAuthority, GazetteTitle = b.GazetteTitle, PagesInHindi = b.PagesInHindi, PagesInEnglish = b.PagesInEnglish } into i where i.Id == (long)num select i).First(); this.lblZone.Text = variable.Zone; this.lblCircle.Text = variable.Circle; this.lblDivision.Text = variable.Division; this.lblBlcok.Text = variable.Block; this.lblVillage.Text = variable.VillageName; Label label = this.lblForestType; if (variable.ForestType == "R") { str = "Reserved"; } else if (variable.ForestType == "U") { str = "Protected"; } else { str = (variable.ForestType == "C" ? "Cadastral" : "Other"); } label.Text = str; this.lblNotificationNumber.Text = variable.NotificationNo; this.lblNotificationType.Text = variable.NotificationType; string str1 = ""; if (variable.GazetteDate.HasValue) { DateTime dateTime = DateTime.Parse(variable.GazetteDate.ToString()); str1 = dateTime.ToString("dd/MM/yyyy"); } this.lnkViewGazette.Text = string.Concat(variable.NotificationNo, " on ", str1); this.lnkViewGazette.NavigateUrl = string.Concat("ViewGazetteNotificationDetail.aspx?Code=", base.Request["Code"]); this.BindVillage(variable.BlockId.Value); this.BindKhasara(variable.BlockId.Value); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
protected void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.Districts.MergeOption = MergeOption.NoTracking; var query = from data in context.Districts orderby data.DistrictName select data; GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.mRAs.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.mRAs orderby data.RANGE_ID,data.RANGEASST_ENAME select new { data.RASST_ID, data.Mobileno, data.Phoneno, data.Std, data.RANGEASST_ENAME, data.faxno, data.mRANGE.RANGE_ENAME }; //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.Blocks.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.Blocks orderby data.SectionId,data.BlockName select new { data.Id, data.MobileNo, data.OfficerName, data.PhoneNo, data.STD, data.BlockName, data.FaxNo, data.mBEAT.BEAT_ENAME }; //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
protected void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.Tehsils.MergeOption = MergeOption.NoTracking; var query = from data in context.Villages orderby data.VillageName select new { data.Id, data.VillageName, data.Tehsil.TehsilName, data.Tehsil.DistrictId, data.TehsilId, data.Tehsil.District.DistrictName }; GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.mWINGs.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.mWINGs orderby data.DESCRIPTION select data; //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.mCIRCLEs.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.mCIRCLEs orderby data.WING_ID,data.CIRCLE_ENAME select new { data.CIRCLE_ID, data.Mobileno, data.officername, data.Phoneno, data.Std, data.CIRCLE_ENAME, data.faxno, data.mWING.DESCRIPTION }; //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.mSUBDIVs.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.mSUBDIVs orderby data.DIV_ID, data.SUBDIV_ENAME select new { data.SUBDIV_ID, data.Mobileno, data.officername, data.Phoneno, data.Std, data.SUBDIV_ENAME, data.faxno, data.mDIVISION.DIV_ENAME }; //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
public void BindGrid() { using (DefaultCS context = new DefaultCS()) { context.mDIVISIONs.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = from data in context.mDIVISIONs orderby data.CIRCLE_ID, data.DIV_ENAME select new { data.DIV_ID, data.Mobileno, data.officername, data.Phoneno, data.Std, data.DIV_ENAME, data.faxno, data.mCIRCLE.CIRCLE_ENAME, data.NoOfInstrument }; if (((MAPS.LoginMaster)Session["User"]).DistrictId != null) { int divId = (int)((MAPS.LoginMaster)Session["User"]).DistrictId; GridView1.DataSource = query.Where(i => i.DIV_ID == divId).ToList(); } else { GridView1.DataSource = query.ToList(); } GridView1.DataBind(); } }
protected void BindKhasara(int blockID) { DefaultCS defaultC = new DefaultCS(); try { defaultC.KhasaraDetails.MergeOption = MergeOption.NoTracking; var khasaraDetails = from data in defaultC.KhasaraDetails orderby data.Id where data.BlockId == (int?)blockID select new { Id = data.Id, KhasaraNo = data.KhasaraNo, data.KhatauniNo, OwnerName = data.OwnerName, AreainAcres = data.AreainAcres, VillageName = data.Village.VillageName, data.AmalDaramadDate, data.AmalDaramadNo }; totalArea = khasaraDetails.Sum(i => i.AreainAcres) ?? 0; amalDaramadArea = khasaraDetails.Where(i => i.AmalDaramadNo != null).Sum(i => i.AreainAcres) ?? 0; this.gvKhasara.DataSource = khasaraDetails.ToList(); this.gvKhasara.DataBind(); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
protected void BindForm() { int num = Convert.ToInt32(base.Server.HtmlEncode(base.Request.QueryString["Code"])); DefaultCS defaultC = new DefaultCS(); try { defaultC.ForestAreas.MergeOption = MergeOption.NoTracking; var variable = ( from b in defaultC.ForestAreas orderby b.ForestName select new { VillageId = b.VillageId, VillageName = b.Village.VillageName, ForestName = b.ForestName, ForestType = b.ForestType, Id = b.Id, NotificationNo = b.NotificationNo, NotificationType = b.NotificationType, GazetteDate = b.GazetteDate, GazetteNo = b.GazetteNo, GazetteAuthority = b.GazetteAuthority, GazetteTitle = b.GazetteTitle, PagesInHindi = b.PagesInHindi, PagesInEnglish = b.PagesInEnglish } into i where i.Id == (long)num select i).First(); this.lblNotificationNumber.Text = variable.NotificationNo; this.lblNotificationType.Text = variable.NotificationType; if (variable.GazetteDate.HasValue) { Label str = this.lblGazetteDate; DateTime dateTime = DateTime.Parse(variable.GazetteDate.ToString()); str.Text = dateTime.ToString("dd/MM/yyyy"); } this.lblGazetteNo.Text = variable.GazetteNo; this.lblGazetteAuthority.Text = variable.GazetteAuthority; this.lblGazetteTitle.Text = variable.GazetteTitle; if (variable.PagesInEnglish.HasValue) { this.lblEnglishPage.Text = variable.PagesInEnglish.ToString(); } if (variable.PagesInHindi.HasValue) { this.lblHindiPage.Text = variable.PagesInHindi.ToString(); } int.Parse(variable.VillageId.ToString()); this.dtItems = (DataTable)this.ViewState["dtItems"]; this.dtItems.Rows.Clear(); List<GazetteDetail> list = ( from i in defaultC.GazetteDetails where i.ForestAreaId == (long)num select i).ToList<GazetteDetail>(); if (list.Count > 0) { foreach (GazetteDetail gazetteDetail in list) { DataRow id = this.dtItems.NewRow(); id["Id"] = gazetteDetail.Id; id["Language"] = gazetteDetail.Language; id["PageNumber"] = gazetteDetail.PageNo; id["Photo"] = gazetteDetail.Photo; id["Status"] = "U"; this.dtItems.Rows.Add(id); } this.dtItems.AcceptChanges(); this.ViewState["dtItems"] = this.dtItems; this.BindGrid(); } } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
public void BindGrid() { using (DefaultCS db = new DefaultCS()) { string forestType = null; long? zoneId = null, circleId = null, divisionId = null, subDivisionId = null, rangeId = null, sectionId = null, beatId = null, blockId = null, districtId = null, tehsilId = null, villageId = null; if (ddlZone.SelectedIndex > 0) zoneId = Convert.ToInt64(ddlZone.SelectedValue); if (ddlCircle.SelectedIndex > 0) circleId = Convert.ToInt64(ddlCircle.SelectedValue); if (ddlDivision.SelectedIndex > 0) divisionId = Convert.ToInt64(ddlDivision.SelectedValue); if (ddlSubDivision.SelectedIndex > 0) subDivisionId = Convert.ToInt64(ddlSubDivision.SelectedValue); if (ddlRange.SelectedIndex > 0) rangeId = Convert.ToInt64(ddlRange.SelectedValue); if (ddlSection.SelectedIndex > 0) sectionId = Convert.ToInt64(ddlSection.SelectedValue); if (ddlBeat.SelectedIndex > 0) beatId = Convert.ToInt64(ddlBeat.SelectedValue); if (ddlBlock.SelectedIndex > 0) blockId = Convert.ToInt64(ddlBlock.SelectedValue); if (ddlDistrict.SelectedIndex > 0) districtId = Convert.ToInt64(ddlDistrict.SelectedValue); if (ddlTehsil.SelectedIndex > 0) tehsilId = Convert.ToInt64(ddlTehsil.SelectedValue); if (ddlVillage.SelectedIndex > 0) villageId = Convert.ToInt64(ddlVillage.SelectedValue); if (ddlForestType.SelectedIndex > 0) forestType = ddlForestType.SelectedValue; db.ForestAreas.MergeOption = System.Data.Objects.MergeOption.NoTracking; var query = (from b in db.ForestAreas where b.ForestType != "R" orderby b.ForestName select new { b.BlockId, BeatId = b.Block.SectionId, SectionId = b.Block.mBEAT.RASST_ID, RangeId = b.Block.mBEAT.mRA.RANGE_ID, SubDivisionId = b.Block.mBEAT.mRA.mRANGE.SUBDIV_ID, DivisionId = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.DIV_ID, CircleId = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.CIRCLE_ID, ZoneId = b.Block.mBEAT.mRA.mRANGE.mSUBDIV.mDIVISION.mCIRCLE.WING_ID, b.VillageId, b.Village.TehsilId, b.Village.Tehsil.DistrictId, b.ForestName, b.ForestType, b.Id, b.NumberOfPillars, b.Village.VillageName, //AreaCalculated = (b.AreaCalculated ?? 0) / (decimal)4046.86,//--- Convert to acre from sq. metere b.AreaInGazette, b.Block.BlockName }).ToList().Select(i => new { i.BlockId, i.BeatId, i.SectionId, i.RangeId, i.DivisionId, i.SubDivisionId, i.CircleId, i.ZoneId, i.VillageId, i.TehsilId, i.DistrictId, //AreaCalculated = Math.Round(i.AreaCalculated, 2), i.AreaInGazette, i.BlockName, i.ForestName, i.ForestType, i.Id, i.NumberOfPillars, i.VillageName }); if (zoneId != null) { query = query.Where(i => i.ZoneId == zoneId); } if (circleId != null) { query = query.Where(i => i.CircleId == circleId); } if (divisionId != null) { query = query.Where(i => i.DivisionId == divisionId); } if (subDivisionId != null) { query = query.Where(i => i.SubDivisionId == subDivisionId); } if (rangeId != null) { query = query.Where(i => i.RangeId == rangeId); } if (sectionId != null) { query = query.Where(i => i.SectionId == sectionId); } if (beatId != null) { query = query.Where(i => i.BeatId == beatId); } if (blockId != null) { query = query.Where(i => i.BlockId == blockId); } if (districtId != null) { query = query.Where(i => i.DistrictId == districtId); } if (tehsilId != null) { query = query.Where(i => i.TehsilId == tehsilId); } if (villageId != null) { query = query.Where(i => i.VillageId == villageId); } if (forestType != null) { query = query.Where(i => i.ForestType == forestType); } //totalArea = (decimal)query.Sum(i => i.AreaCalculated); total = query.Count(); //Bind Data to Gridview GridView1.DataSource = query.ToList(); GridView1.DataBind(); } }
protected void BindVillage(int blockID) { DefaultCS defaultC = new DefaultCS(); try { defaultC.Villages.MergeOption = MergeOption.NoTracking; var villages = from data in defaultC.Villages orderby data.Id where data.BlockId == (int?)blockID select new { Id = data.Id, VillageName = data.VillageName }; this.gvVillage.DataSource = villages.ToList(); this.gvVillage.DataBind(); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
private void BindGrid() { int num = Convert.ToInt32(base.Server.HtmlEncode(base.Request.QueryString["Code"])); DefaultCS defaultC = new DefaultCS(); try { defaultC.CadastralPoints.MergeOption = MergeOption.NoTracking; var list = from c in defaultC.CadastralPoints where c.ForestAreaId == num select new { c.Id, c.Latitude, c.Longitude, c.PillarNo }; this.GridView2.DataSource = list.ToList(); this.GridView2.DataBind(); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }