public override void RefreshList() { base.RefreshList(); using (DataManager = new CityCore()) { BindDataSource <ICityModel>(); } }
protected override void Save() { base.Save(); var city = PopulateCityModelFromInterface(); using (var facade = new CityCore()) { facade.Save(city); ShowMessage(facade); } }
protected override void DeleteRecord() { base.DeleteRecord(); var id = Convert.ToInt32(recordId.Text); using (var facade = new CityCore()) { facade.Delete(id); ShowMessage(facade); } }
protected override void SaveUpdate() { base.SaveUpdate(); var city = PopulateCityModelFromInterface(); city.Id = Convert.ToInt32(recordId.Text); city.ModifiedBy = modifiedBy.Text; city.ModifiedDate = modifiedDate.Value; using (var facade = new CityCore()) { facade.Update(city); ShowMessage(facade); } }
private void PopulateInterfaceFromModel(int id) { using (var facade = new CityCore()) { var city = facade.Get <ICityModel>(WhereTerm.DefaultParam(id, "ID")).FirstOrDefault(); if (city == null || !facade.IsSuccess) { MsgHelpers.ShowError(this, string.IsNullOrEmpty(facade.Message) ? "Employee not found" : facade.Message); return; } recordId.Text = city.Id.ToString(); cityName.Text = city.CityName; createdBy.Text = city.CreatedBy; createdDate.Value = city.CreatedDate; modifiedBy.Text = city.ModifiedBy; if (city.ModifiedDate != null) { modifiedDate.Value = (DateTime)city.ModifiedDate; } } }