Esempio n. 1
0
        private void toolBar_btnCancel_Click(object sender)
        {
            dbContext.CancelAllChanges();
            hr_talent hr_talent = (hr_talent)hr_talentDataGrid.SelectedItem;

            hr_talent.State = EntityState.Unchanged;
        }
Esempio n. 2
0
        private void New_Click(object sender)
        {
            hr_talent hr_talent = new hr_talent();

            hr_talent.State                  = EntityState.Added;
            hr_talent.IsSelected             = true;
            dbContext.Entry(hr_talent).State = EntityState.Added;
            hr_talentViewSource.View.MoveCurrentToLast();
        }
Esempio n. 3
0
 private void toolBar_btnEdit_Click(object sender)
 {
     // add_MissingRecords();
     if (hr_talentDataGrid.SelectedItem != null)
     {
         hr_talent hr_talent = (hr_talent)hr_talentDataGrid.SelectedItem;
         hr_talent.IsSelected             = true;
         hr_talent.State                  = EntityState.Modified;
         dbContext.Entry(hr_talent).State = EntityState.Modified;
     }
     else
     {
         //toolBar.msgWarning("Please Select a record");
     }
 }
Esempio n. 4
0
        private void toolBar_btnSearch_Click(object sender, string query)
        {
            if (!string.IsNullOrEmpty(query) && hr_talentViewSource != null)
            {
                try
                {
                    hr_talentViewSource.View.Filter = i =>
                    {
                        hr_talent hr_talent = i as hr_talent;

                        if (hr_talent != null)
                        {
                            //Protect the code against null values.

                            string customer = hr_talent.name;

                            if ((customer.ToLower().Contains(query.ToLower()))
                                )
                            {
                                return(true);
                            }
                            else
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    };
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            else
            {
                hr_talentViewSource.View.Filter = null;
            }
        }