public override void RefreshList() { base.RefreshList(); using (DataManager = new PositionModuleCore()) { BindDataSource <IPositionModel>(); } }
protected override void DeleteRecord() { base.DeleteRecord(); var id = Convert.ToInt32(recordId.Text); using (var facade = new PositionModuleCore()) { facade.Delete(id); ShowMessage(facade); } }
protected override void Save() { base.Save(); var positionModel = PopulateModelFromInterface(); using (var facade = new PositionModuleCore()) { facade.Save(positionModel); ShowMessage(facade); } }
private void PopulatePosition() { using (var position = new PositionModuleCore()) { var source = position.Get <IPositionModel>(); positionName.DisplayMember = "PositionName"; positionName.ValueMember = "Id"; if (source != null) { positionName.DataSource = source.OrderBy(a => a.PositionName).ToList(); } } }
protected override void SaveUpdate() { base.SaveUpdate(); var positionModel = PopulateModelFromInterface(); positionModel.Id = Convert.ToInt32(recordId.Text); positionModel.ModifiedBy = modifiedBy.Text; positionModel.ModifiedDate = modifiedDate.Value; using (var facade = new PositionModuleCore()) { facade.Update(positionModel); ShowMessage(facade); } }
private void PopulateInterfaceFromModel(int id) { using (var facade = new PositionModuleCore()) { var positionModel = facade.Get <IPositionModel>(WhereTerm.DefaultParam(id, "ID")).FirstOrDefault(); if (positionModel == null || !facade.IsSuccess) { MsgHelpers.ShowError(this, string.IsNullOrEmpty(facade.Message) ? "Employee Position not found" : facade.Message); return; } createdBy.Text = positionModel.CreatedBy; createdDate.Value = positionModel.CreatedDate; recordId.Text = positionModel.Id.ToString(); positionName.Text = positionModel.PositionName; createdBy.Text = positionModel.CreatedBy; createdDate.Value = positionModel.CreatedDate; modifiedBy.Text = positionModel.ModifiedBy; modifiedDate.Value = positionModel.ModifiedDate.HasValue ? positionModel.ModifiedDate.Value : DateTime.Now; } }
protected override void DataListView1BeforeSorting(object sender, BrightIdeasSoftware.BeforeSortingEventArgs e) { base.DataListView1BeforeSorting(sender, e); if (SortCounter != 0) { e.Canceled = true; return; } SortCounter++; if (e.ColumnToSort == null) { return; } SortColumn = e.ColumnToSort.AspectName; SortDirection = GetSort(e.SortOrder); using (DataManager = new PositionModuleCore()) { BindDataSource <IPositionModel>(); } }
private void PopulateInterfaceFromModel(int id) { using (var facade = new PositionModuleCore()) { var positionModel = facade.Get<IPositionModel>(WhereTerm.DefaultParam(id, "ID")).FirstOrDefault(); if (positionModel == null || !facade.IsSuccess) { MsgHelpers.ShowError(this, string.IsNullOrEmpty(facade.Message) ? "Employee Position not found" : facade.Message); return; } createdBy.Text = positionModel.CreatedBy; createdDate.Value = positionModel.CreatedDate; recordId.Text = positionModel.Id.ToString(); positionName.Text = positionModel.PositionName; createdBy.Text = positionModel.CreatedBy; createdDate.Value = positionModel.CreatedDate; modifiedBy.Text = positionModel.ModifiedBy; modifiedDate.Value = positionModel.ModifiedDate.HasValue ? positionModel.ModifiedDate.Value : DateTime.Now; } }
private void PopulatePosition() { using (var position = new PositionModuleCore()) { var source = position.Get<IPositionModel>(); positionName.DisplayMember = "PositionName"; positionName.ValueMember = "Id"; if (source != null) positionName.DataSource = source.OrderBy(a => a.PositionName).ToList(); } }