Esempio n. 1
0
 public override void RefreshList()
 {
     base.RefreshList();
     using (DataManager = new PositionModuleCore())
     {
         BindDataSource <IPositionModel>();
     }
 }
Esempio n. 2
0
 protected override void DeleteRecord()
 {
     base.DeleteRecord();
     var id = Convert.ToInt32(recordId.Text);
     using (var facade = new PositionModuleCore())
     {
         facade.Delete(id);
         ShowMessage(facade);
     }
 }
Esempio n. 3
0
        protected override void DeleteRecord()
        {
            base.DeleteRecord();
            var id = Convert.ToInt32(recordId.Text);

            using (var facade = new PositionModuleCore())
            {
                facade.Delete(id);
                ShowMessage(facade);
            }
        }
Esempio n. 4
0
        protected override void Save()
        {
            base.Save();
            var positionModel = PopulateModelFromInterface();

            using (var facade = new PositionModuleCore())
            {
                facade.Save(positionModel);
                ShowMessage(facade);
            }
        }
Esempio n. 5
0
 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();
         }
     }
 }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
 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;
     }
 }
Esempio n. 8
0
 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>();
     }
 }
Esempio n. 9
0
 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);
     }
 }
Esempio n. 10
0
 protected override void Save()
 {
     base.Save();
     var positionModel = PopulateModelFromInterface();
     using (var facade = new PositionModuleCore())
     {
         facade.Save(positionModel);
         ShowMessage(facade);
     }
 }
Esempio n. 11
0
 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;
     }
 }
Esempio n. 12
0
 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();
     }
 }