Exemple #1
0
 public void Add(Tehsil tehsil)
 {
     using (DefaultCS db = new DefaultCS())
     {
         db.Tehsils.MergeOption = MergeOption.NoTracking;
         db.Tehsils.AddObject(tehsil);
         db.SaveChanges();
     }
 }
Exemple #2
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();
     }
 }
Exemple #3
0
 /// <summary>
 /// Create a new Tehsil object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="districtId">Initial value of the DistrictId property.</param>
 /// <param name="tehsilName">Initial value of the TehsilName property.</param>
 public static Tehsil CreateTehsil(global::System.Int32 id, global::System.Int32 districtId, global::System.String tehsilName)
 {
     Tehsil tehsil = new Tehsil();
     tehsil.Id = id;
     tehsil.DistrictId = districtId;
     tehsil.TehsilName = tehsilName;
     return tehsil;
 }
Exemple #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Tehsils EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTehsils(Tehsil tehsil)
 {
     base.AddObject("Tehsils", tehsil);
 }