Beispiel #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;
         }
     }
 }
Beispiel #2
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();
     }
 }
Beispiel #3
0
 public void Add(Village village)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Villages.MergeOption = MergeOption.NoTracking;
         db.Villages.AddObject(village);
         db.SaveChanges();
     }
 }
Beispiel #4
0
 public void Add(District district)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Districts.MergeOption = MergeOption.NoTracking;
         db.Districts.AddObject(district);
         db.SaveChanges();
     }
 }
Beispiel #5
0
 public static Int64 InsertArea(ForestArea forestArea)
 {
     using (var db = new DefaultCS())
     {
         db.ForestAreas.AddObject(forestArea);
         db.SaveChanges();
     }
     return forestArea.Id;
 }
Beispiel #6
0
 public void Add(mSUBDIV division)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mSUBDIVs.MergeOption = MergeOption.NoTracking;
         db.mSUBDIVs.AddObject(division);
         db.SaveChanges();
     }
 }
Beispiel #7
0
 public void Add(mRA section)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mRAs.MergeOption = MergeOption.NoTracking;
         db.mRAs.AddObject(section);
         db.SaveChanges();
     }
 }
Beispiel #8
0
 public void Add(Tehsil tehsil)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Tehsils.MergeOption = MergeOption.NoTracking;
         db.Tehsils.AddObject(tehsil);
         db.SaveChanges();
     }
 }
Beispiel #9
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();
     }
 }
Beispiel #10
0
 public static string InsertCoordinates(ForestCoordinate forestCoordinates)
 {
     using (var db = new DefaultCS())
     {
         db.ForestCoordinates.AddObject(forestCoordinates);
         db.SaveChanges();
     }
     return "true";
 }
Beispiel #11
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();
     }
 }
Beispiel #12
0
 public void Add(mWING zone)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mWINGs.MergeOption = MergeOption.NoTracking;
         db.mWINGs.AddObject(zone);
         db.SaveChanges();
     }
 }
Beispiel #13
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();
     }
 }
Beispiel #14
0
 public void Add(mCIRCLE circle)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.mCIRCLEs.MergeOption = MergeOption.NoTracking;
         db.mCIRCLEs.AddObject(circle);
         db.SaveChanges();
     }
 }
Beispiel #15
0
 public void Add(Block block)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Blocks.MergeOption = MergeOption.NoTracking;
         db.Blocks.AddObject(block);
         db.SaveChanges();
     }
 }
Beispiel #16
0
 public void Create(LoginMaster loginMaster)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.LoginMasters.MergeOption = MergeOption.NoTracking;
         db.LoginMasters.AddObject(loginMaster);
         db.SaveChanges();
     }
 }
Beispiel #17
0
        public void Update(mWING zone)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mWINGs.Where(i => i.WING_ID == zone.WING_ID).First();
                d.DESCRIPTION = zone.DESCRIPTION;

                db.SaveChanges();
            }
        }
Beispiel #18
0
 public void Update(Tehsil tehsil)
 {
     using (DefaultCS db = new DefaultCS())
     {
         var d = db.Tehsils.Where(i => i.Id == tehsil.Id).First();
         d.TehsilName = tehsil.TehsilName;
         d.DistrictId = tehsil.DistrictId;
         db.SaveChanges();
     }
 }
Beispiel #19
0
 public void Update(Village village)
 {
     using (DefaultCS db = new DefaultCS())
     {
         var d = db.Villages.Where(i => i.Id == village.Id).First();
         d.VillageName = village.VillageName;
         d.TehsilId = village.TehsilId;
         db.SaveChanges();
     }
 }
Beispiel #20
0
        //public void ChangePassord(string userid, string password, string newpassword)
        //{
        //    var Emp = GetUser(userid, password);

        //    if (Emp != null)
        //    {
        //        UpdateUser(userid, newpassword);
        //    }
        //}

        public void UpdateUser(string userId, string password)
        {
            using (var db = new DefaultCS())
            {
                var newLogin = db.LoginMasters.Where(s => s.UserId == userId).FirstOrDefault();
                if (newLogin != null)
                {
                    newLogin.UserId = userId;
                    newLogin.Password = password;
                    db.SaveChanges();
                }
            }
        }
Beispiel #21
0
        public void Update(mRANGE range)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mRANGEs.Where(i => i.RANGE_ID == range.RANGE_ID).First();
                d.RANGE_ENAME = range.RANGE_ENAME;
                d.SUBDIV_ID = range.SUBDIV_ID;
                d.officername = range.officername;
                d.Std = range.Std;
                d.Phoneno = range.Phoneno;
                d.faxno = range.faxno;
                d.Mobileno = range.Mobileno;

                db.SaveChanges();
            }
        }
Beispiel #22
0
 public void Add(KhasaraDetail khasaraDetail)
 {
     DefaultCS defaultC = new DefaultCS();
     try
     {
         defaultC.KhasaraDetails.MergeOption = MergeOption.NoTracking;
         defaultC.KhasaraDetails.AddObject(khasaraDetail);
         defaultC.SaveChanges();
     }
     finally
     {
         if (defaultC != null)
         {
             ((IDisposable)defaultC).Dispose();
         }
     }
 }
Beispiel #23
0
        public void Update(mCIRCLE circle)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mCIRCLEs.Where(i => i.CIRCLE_ID == circle.CIRCLE_ID).First();
                d.CIRCLE_ENAME = circle.CIRCLE_ENAME;
                d.WING_ID = circle.WING_ID;
                d.officername = circle.officername;
                d.Std = circle.Std;
                d.Phoneno = circle.Phoneno;
                d.faxno = circle.faxno;
                d.Mobileno = circle.Mobileno;
                d.Lastupdatedon = circle.Lastupdatedon;

                db.SaveChanges();
            }
        }
Beispiel #24
0
        public void Update(mRA section)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mRAs.Where(i => i.RASST_ID == section.RASST_ID).First();
                d.RANGEASST_ENAME = section.RANGEASST_ENAME;
                d.RANGE_ID = section.RANGE_ID;
                //d.OfficerName = section.OfficerName;
                d.Std = section.Std;
                d.Phoneno = section.Phoneno;
                d.faxno = section.faxno;
                d.Mobileno = section.Mobileno;
                d.UpdateOn = section.UpdateOn;

                db.SaveChanges();
            }
        }
Beispiel #25
0
        public void Update(Block block)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.Blocks.Where(i => i.Id == block.Id).First();
                d.BlockName = block.BlockName;
                d.SectionId = block.SectionId;
                d.OfficerName = block.OfficerName;
                d.STD = block.STD;
                d.PhoneNo = block.PhoneNo;
                d.FaxNo = block.FaxNo;
                d.MobileNo = block.MobileNo;
                d.UpdatedBy = block.UpdatedBy;
                d.UpdatedDate = block.UpdatedDate;

                db.SaveChanges();
            }
        }
Beispiel #26
0
        public void Update(mSUBDIV subDivision)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mSUBDIVs.Where(i => i.SUBDIV_ID == subDivision.SUBDIV_ID).First();
                d.SUBDIV_ENAME = subDivision.SUBDIV_ENAME;
                d.DIV_ID = subDivision.DIV_ID;
                d.officername = subDivision.officername;
                d.Std = subDivision.Std;
                d.Phoneno = subDivision.Phoneno;
                d.faxno = subDivision.faxno;
                d.Mobileno = subDivision.Mobileno;
                d.UpdateOn = subDivision.UpdateOn;
                d.Lastupdatedon = subDivision.Lastupdatedon;

                db.SaveChanges();
            }
        }
Beispiel #27
0
 public void Delete(int id)
 {
     DefaultCS defaultC = new DefaultCS();
     try
     {
         KhasaraDetail khasaraDetail = (
             from i in defaultC.KhasaraDetails
             where i.Id == id
             select i).First<KhasaraDetail>();
         defaultC.KhasaraDetails.DeleteObject(khasaraDetail);
         defaultC.SaveChanges();
     }
     finally
     {
         if (defaultC != null)
         {
             ((IDisposable)defaultC).Dispose();
         }
     }
 }
Beispiel #28
0
        public void Update(mDIVISION division)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.mDIVISIONs.Where(i => i.DIV_ID == division.DIV_ID).First();
                d.DIV_ENAME = division.DIV_ENAME;
                d.CIRCLE_ID = division.CIRCLE_ID;
                d.officername = division.officername;
                d.Std = division.Std;
                d.Phoneno = division.Phoneno;
                d.faxno = division.faxno;
                d.Mobileno = division.Mobileno;
                d.Lastupdatedon = division.Lastupdatedon;

                d.InstrumentModel = division.InstrumentModel;
                d.NoOfInstrument = division.NoOfInstrument;

                db.SaveChanges();
            }
        }
Beispiel #29
0
        public void Delete(int id)
        {
            using (DefaultCS db = new DefaultCS())
            {
                var d = db.ForestAreas.Where(i => i.Id == id).First();

                var c = db.ForestCoordinates.Where(i => i.ForestAreaId == id).ToList();
                c.ForEach(i =>
                {
                    db.ForestCoordinates.DeleteObject(i);
                });
                var b = db.GazetteDetails.Where(i => i.ForestAreaId == id).ToList();
                b.ForEach(i =>
                {
                    db.GazetteDetails.DeleteObject(i);
                });

                db.ForestAreas.DeleteObject(d);
                db.SaveChanges();
            }
        }
Beispiel #30
0
        public void Update(ForestArea forestArea, EntityCollection<GazetteDetail> gd)
        {
            IFormatProvider provider = new System.Globalization.CultureInfo("en-GB", true);

            using (var db = new DefaultCS())
            {
                try
                {
                    var fUpdate = db.ForestAreas.Where(i => i.Id == forestArea.Id).First();

                    var arrGD = db.GazetteDetails.Where(i => i.ForestAreaId == forestArea.Id).ToList();

                    if (arrGD.Count > 0)
                    {
                        arrGD.ForEach(i => { db.GazetteDetails.DeleteObject(i); });
                    }

                    foreach (var fcc in gd)
                    {
                        db.GazetteDetails.AddObject(fcc);
                    }
                    fUpdate.NotificationNo = forestArea.NotificationNo;
                    fUpdate.NotificationType = forestArea.NotificationType;
                    fUpdate.GazetteAuthority = forestArea.GazetteAuthority;
                    fUpdate.GazetteNo = forestArea.GazetteNo;

                    fUpdate.GazetteTitle = forestArea.GazetteTitle;
                    fUpdate.PagesInEnglish = forestArea.PagesInEnglish;
                    fUpdate.PagesInHindi = forestArea.PagesInHindi;

                    fUpdate.GazetteDate = forestArea.GazetteDate;

                    db.SaveChanges();
                }
                catch (Exception ex)
                {
                }
            }
        }