Пример #1
0
        public static bool Add(BusinessObjects.Village villageBO)
        {
            VillageDA V       = new VillageDA();
            var       village = new Village
            {
                Name       = villageBO.Name,
                DistrictId = villageBO.DistrictId,
                Block      = villageBO.Block
            };

            V.context.Villages.Add(village);
            int affectedRows = V.context.SaveChanges();

            V.context.Dispose();

            if (affectedRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
 public static bool Delete(Village info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("delete from Villages where Id='{0}'", info.Id)));
 }
Пример #3
0
 public static bool Update(Village info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("update Villages set CityId='{0}',Name='{1}', PinCode='{2}' where Id='{3}'", info.CityId, info.Name, info.PinCode, info.Id)));
 }
Пример #4
0
 public static bool Add(Village info)
 {
     return(BaseDataAccess.ExecuteSQL(String.Format("insert into Villages(CityId, Name, PinCode)values('{0}','{1}','{2}')", info.CityId, info.Name, info.PinCode)));
 }