public void AddCountry(CountryModel model) { bt_Country country = new bt_Country(); country.CountryId = model.CountryId; country.Name = model.Name; country.Code = model.Code; gWork.Repository <bt_Country>().Add(country); gWork.SaveChanges(); }
public void AddState(StateModel stateModel) { bt_State state = new bt_State(); state.StateId = stateModel.StateId; state.Name = stateModel.Name; state.Code = stateModel.Code; state.CountryId = stateModel.CountryId; gwork.Repository <bt_State>().Add(state); gwork.SaveChanges(); }
public void AddDesignation(DesignationModel model) { bt_Designation designation = new bt_Designation(); designation.DesignationId = model.DesignationId; designation.Name = model.Name; designation.Code = model.Code; designation.CreatedBy = model.CreatedBy; designation.CreatedDateTime = model.CreatedDateTime; gWork.Repository <bt_Designation>().Add(designation); gWork.SaveChanges(); }
public void AddRole(RoleModel model) { bt_Roles roleModel = new bt_Roles(); roleModel.RoleId = model.RoleId; roleModel.Name = model.Name; roleModel.Description = model.Description; roleModel.Code = model.Code; roleModel.IsActive = model.IsActive; roleModel.IsDeleted = model.IsDeleted; gWork.Repository <bt_Roles>().Add(roleModel); gWork.SaveChanges(); }
public void AddCity(CityModel model) { bt_City city = new bt_City(); city.CityId = model.CityId; city.Name = model.Name; city.Code = model.Code; city.DistrictId = model.DistrictId; city.StateId = model.StateId; city.CountryId = model.CountryId; city.IsActive = model.IsActive; gWork.Repository <bt_City>().Add(city); gWork.SaveChanges(); }
public void AddDistrict(DistrictModel model) { bt_District Dist = new bt_District(); Dist.DistrictId = model.DistrictId; Dist.Name = model.Name; Dist.Code = model.Code; Dist.IsActive = model.IsActive; Dist.IsDeleted = model.IsDeleted; Dist.StateId = model.StateId; Dist.CountryId = model.CountryId; Dist.CreatedBy = model.CreatedBy; Dist.CreatedDateTime = model.CreatedDateTime; gWork.Repository <bt_District>().Add(Dist); gWork.SaveChanges(); }
public void DeleteOffice(Guid OfficeId) { bt_Office office = gWork.Repository <bt_Office>().AsQuerable().FirstOrDefault(x => x.OfficeId == OfficeId); gWork.Repository <bt_Office>().Attach(office); office.IsDeleted = true; gWork.SaveChanges(); }
public void DeleteOperator(OperatorModel model) { bt_OfficeOperator rec = gWork.Repository <bt_OfficeOperator>().AsQuerable().FirstOrDefault(x => x.OperatorId == model.OperatorId); gWork.Repository <bt_OfficeOperator>().Attach(rec); rec.IsDeleted = true; gWork.SaveChanges(); }