Exemple #1
0
 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;
         }
     }
 }
Exemple #2
0
 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();
         }
     }
 }
Exemple #3
0
 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();
         }
     }
 }
Exemple #4
0
 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();
     }
 }
Exemple #5
0
 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();
     }
 }
Exemple #6
0
 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();
     }
 }
Exemple #7
0
 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();
     }
 }
Exemple #8
0
 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();
     }
 }
Exemple #9
0
 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();
     }
 }
Exemple #10
0
 public List<mWING> GetAll()
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mWINGs.MergeOption = MergeOption.NoTracking;
         return db.mWINGs.ToList();
     }
 }
Exemple #11
0
 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();
     }
 }
Exemple #12
0
 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();
     }
 }
Exemple #13
0
 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();
     }
 }
Exemple #14
0
 public List<District> GetAll()
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Districts.MergeOption = MergeOption.NoTracking;
         return db.Districts.ToList();
     }
 }
Exemple #15
0
 public static string InsertCoordinates(ForestCoordinate forestCoordinates)
 {
     using (var db = new DefaultCS())
     {
         db.ForestCoordinates.AddObject(forestCoordinates);
         db.SaveChanges();
     }
     return "true";
 }
Exemple #16
0
 public void Add(mWING zone)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mWINGs.MergeOption = MergeOption.NoTracking;
         db.mWINGs.AddObject(zone);
         db.SaveChanges();
     }
 }
Exemple #17
0
 public void Add(mSUBDIV division)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mSUBDIVs.MergeOption = MergeOption.NoTracking;
         db.mSUBDIVs.AddObject(division);
         db.SaveChanges();
     }
 }
Exemple #18
0
 public void Create(LoginMaster loginMaster)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.LoginMasters.MergeOption = MergeOption.NoTracking;
         db.LoginMasters.AddObject(loginMaster);
         db.SaveChanges();
     }
 }
Exemple #19
0
 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();
     }
 }
Exemple #20
0
 public void Add(Tehsil tehsil)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Tehsils.MergeOption = MergeOption.NoTracking;
         db.Tehsils.AddObject(tehsil);
         db.SaveChanges();
     }
 }
Exemple #21
0
 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();
     }
 }
Exemple #22
0
 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();
     }
 }
Exemple #23
0
 public void Add(District district)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Districts.MergeOption = MergeOption.NoTracking;
         db.Districts.AddObject(district);
         db.SaveChanges();
     }
 }
Exemple #24
0
 public void Add(Block block)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Blocks.MergeOption = MergeOption.NoTracking;
         db.Blocks.AddObject(block);
         db.SaveChanges();
     }
 }
Exemple #25
0
 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();
     }
 }
Exemple #26
0
 public void Add(mRA section)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mRAs.MergeOption = MergeOption.NoTracking;
         db.mRAs.AddObject(section);
         db.SaveChanges();
     }
 }
Exemple #27
0
 public void Add(mCIRCLE circle)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mCIRCLEs.MergeOption = MergeOption.NoTracking;
         db.mCIRCLEs.AddObject(circle);
         db.SaveChanges();
     }
 }
Exemple #28
0
 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();
     }
 }
Exemple #29
0
 public static Int64 InsertArea(ForestArea forestArea)
 {
     using (var db = new DefaultCS())
     {
         db.ForestAreas.AddObject(forestArea);
         db.SaveChanges();
     }
     return forestArea.Id;
 }
Exemple #30
0
 public void Add(Village village)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Villages.MergeOption = MergeOption.NoTracking;
         db.Villages.AddObject(village);
         db.SaveChanges();
     }
 }