public Int64? InsertArea1(ForestArea forestArea, CadastralPoint[] cadastralPoints) { using (var db = new DefaultCS()) { try { if (cadastralPoints != null) { EntityCollection<CadastralPoint> cp = new EntityCollection<CadastralPoint>(); foreach (var cpp in cadastralPoints) { cp.Add(cpp); } forestArea.CadastralPoints1 = cp; } forestArea.CreatedDate = DateTime.Now; db.ForestAreas.AddObject(forestArea); db.SaveChanges(); return forestArea.Id; } catch (Exception ex) { return null; } } }
protected void BindGrid() { DefaultCS defaultC = new DefaultCS(); try { int num = Convert.ToInt32(base.Request["vCode"]); defaultC.KhasaraDetails.MergeOption = MergeOption.NoTracking; var khasaraDetails = from data in defaultC.KhasaraDetails where data.VillageId == (int?)num orderby data.Id select new { Id = data.Id, KhasaraNo = data.KhasaraNo, data.KhatauniNo, BlockId = data.BlockId, VillageId = data.VillageId, OwnerName = data.OwnerName, AreainAcres = data.AreainAcres, data.AmalDaramadNo, data.AmalDaramadDate }; this.GridView1.DataSource = khasaraDetails.ToList(); this.GridView1.DataBind(); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
public void Update(KhasaraDetail khasaraDetail) { DefaultCS defaultC = new DefaultCS(); try { KhasaraDetail khasaraNo = ( from i in defaultC.KhasaraDetails where i.Id == khasaraDetail.Id select i).First<KhasaraDetail>(); khasaraNo.KhasaraNo = khasaraDetail.KhasaraNo; khasaraNo.KhatauniNo = khasaraDetail.KhatauniNo; khasaraNo.OwnerName = khasaraDetail.OwnerName; khasaraNo.AreainAcres = khasaraDetail.AreainAcres; khasaraNo.BlockId = khasaraDetail.BlockId; khasaraNo.VillageId = khasaraDetail.VillageId; khasaraNo.AmalDaramadDate = khasaraDetail.AmalDaramadDate; khasaraNo.AmalDaramadNo = khasaraDetail.AmalDaramadNo; defaultC.SaveChanges(); } finally { if (defaultC != null) { ((IDisposable)defaultC).Dispose(); } } }
public List<Village> GetAll(int id) { using (DefaultCS db = new DefaultCS()) { db.Villages.MergeOption = MergeOption.NoTracking; return db.Villages.Where(i => i.TehsilId == id).ToList(); } }
public List<mDIVISION> GetAll(int id) { using (DefaultCS db = new DefaultCS()) { db.mDIVISIONs.MergeOption = MergeOption.NoTracking; return db.mDIVISIONs.Where(i => i.CIRCLE_ID == id).ToList(); } }
public List<mRA> GetAll(int id) { using (DefaultCS db = new DefaultCS()) { db.mRAs.MergeOption = MergeOption.NoTracking; return db.mRAs.Where(i => i.RANGE_ID == id).ToList(); } }
public List<Block> GetAllByRange(long id) { using (DefaultCS db = new DefaultCS()) { db.Blocks.MergeOption = MergeOption.NoTracking; return db.Blocks.Where(i => i.RangeId == id).ToList(); } }
public List<Tehsil> GetAll(int id) { using (DefaultCS db = new DefaultCS()) { db.Tehsils.MergeOption = MergeOption.NoTracking; return db.Tehsils.Where(i => i.DistrictId == id).ToList(); } }
public List<mSUBDIV> GetAll(int id) { using (DefaultCS db = new DefaultCS()) { db.mSUBDIVs.MergeOption = MergeOption.NoTracking; return db.mSUBDIVs.Where(i => i.DIV_ID == id).ToList(); } }
public List<mWING> GetAll() { using (DefaultCS db = new DefaultCS()) { db.mWINGs.MergeOption = MergeOption.NoTracking; return db.mWINGs.ToList(); } }
public mWING Get(int id) { using (DefaultCS db = new DefaultCS()) { db.mWINGs.MergeOption = MergeOption.NoTracking; return db.mWINGs.Where(i => i.WING_ID == id).First(); } }
public mCIRCLE Get(int id) { using (DefaultCS db = new DefaultCS()) { db.mCIRCLEs.MergeOption = MergeOption.NoTracking; return db.mCIRCLEs.Where(i => i.CIRCLE_ID == id).First(); } }
public List<mBEAT> GetAll(long id) { using (DefaultCS db = new DefaultCS()) { db.mBEATs.MergeOption = MergeOption.NoTracking; return db.mBEATs.Where(i => i.RASST_ID == id).ToList(); } }
public List<District> GetAll() { using (DefaultCS db = new DefaultCS()) { db.Districts.MergeOption = MergeOption.NoTracking; return db.Districts.ToList(); } }
public static string InsertCoordinates(ForestCoordinate forestCoordinates) { using (var db = new DefaultCS()) { db.ForestCoordinates.AddObject(forestCoordinates); db.SaveChanges(); } return "true"; }
public void Add(mWING zone) { using (DefaultCS db = new DefaultCS()) { db.mWINGs.MergeOption = MergeOption.NoTracking; db.mWINGs.AddObject(zone); db.SaveChanges(); } }
public void Add(mSUBDIV division) { using (DefaultCS db = new DefaultCS()) { db.mSUBDIVs.MergeOption = MergeOption.NoTracking; db.mSUBDIVs.AddObject(division); db.SaveChanges(); } }
public void Create(LoginMaster loginMaster) { using (DefaultCS db = new DefaultCS()) { db.LoginMasters.MergeOption = MergeOption.NoTracking; db.LoginMasters.AddObject(loginMaster); db.SaveChanges(); } }
public void Delete(int id) { using (DefaultCS db = new DefaultCS()) { var d = db.mCIRCLEs.Where(i => i.CIRCLE_ID == id).First(); db.mCIRCLEs.DeleteObject(d); db.SaveChanges(); } }
public void Add(Tehsil tehsil) { using (DefaultCS db = new DefaultCS()) { db.Tehsils.MergeOption = MergeOption.NoTracking; db.Tehsils.AddObject(tehsil); db.SaveChanges(); } }
public void Delete(long id) { using (DefaultCS db = new DefaultCS()) { var d = db.mBEATs.Where(i => i.BEAT_ID == id).First(); db.mBEATs.DeleteObject(d); db.SaveChanges(); } }
public void Update(District district) { using (DefaultCS db = new DefaultCS()) { var d = db.Districts.Where(i => i.Id == district.Id).First(); d.DistrictName = district.DistrictName; db.SaveChanges(); } }
public void Add(District district) { using (DefaultCS db = new DefaultCS()) { db.Districts.MergeOption = MergeOption.NoTracking; db.Districts.AddObject(district); db.SaveChanges(); } }
public void Add(Block block) { using (DefaultCS db = new DefaultCS()) { db.Blocks.MergeOption = MergeOption.NoTracking; db.Blocks.AddObject(block); db.SaveChanges(); } }
public void Delete(int id) { using (DefaultCS db = new DefaultCS()) { var d = db.Tehsils.Where(i => i.Id == id).First(); db.Tehsils.DeleteObject(d); db.SaveChanges(); } }
public void Add(mRA section) { using (DefaultCS db = new DefaultCS()) { db.mRAs.MergeOption = MergeOption.NoTracking; db.mRAs.AddObject(section); db.SaveChanges(); } }
public void Add(mCIRCLE circle) { using (DefaultCS db = new DefaultCS()) { db.mCIRCLEs.MergeOption = MergeOption.NoTracking; db.mCIRCLEs.AddObject(circle); db.SaveChanges(); } }
public mSUBDIV Get(int id) { using (DefaultCS db = new DefaultCS()) { db.mSUBDIVs.MergeOption = MergeOption.NoTracking; db.mDIVISIONs.MergeOption = MergeOption.NoTracking; return db.mSUBDIVs.Include("mDIVISION").Include("mDIVISION.mCIRCLE").Where(i => i.DIV_ID == id).First(); } }
public static Int64 InsertArea(ForestArea forestArea) { using (var db = new DefaultCS()) { db.ForestAreas.AddObject(forestArea); db.SaveChanges(); } return forestArea.Id; }
public void Add(Village village) { using (DefaultCS db = new DefaultCS()) { db.Villages.MergeOption = MergeOption.NoTracking; db.Villages.AddObject(village); db.SaveChanges(); } }