private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
            if (IsEdited == true)
            {
                List <Data.PayrollPersonSentence> payrollPersonSentence = new List <Data.PayrollPersonSentence>();
                foreach (var item in grdSentenceItemsSoruce)
                {
                    var entity = Business.GetPayrollPersonSentencesBusiness().GetByID(item.ID);
                    entity.IDPayrollPerson    = _personID;
                    entity.IDPayrollSentences = item.PayrollSentencesID;
                    entity.PrPSMoney          = item.Money;
                    payrollPersonSentence.Add(entity);
                }
                Business.GetPayrollPersonSentencesBusiness().Save(payrollPersonSentence);
                IsEdited = false;
            }

            if (FormIsValid())
            {
                var _PayrollContract = new Data.PayrollContract();
                if (_personID != Guid.Empty)
                {
                    _PayrollContract = Business.GetPayrollContractBusiness().GetById(_personID);
                }
                commitchange(_PayrollContract);
            }
        }
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var DeletedItem = Business.GetPayrollPersonSentencesBusiness().GetByID((grdSentenceList.SelectedItem as dynamic).ID);

            Business.GetPayrollPersonSentencesBusiness().Delete(DeletedItem);
            GridSentenceLoad();
        }
        private void btnSentenceList_Click(object sender, RoutedEventArgs e)
        {
            List <Guid?> SentencesID = Business.GetPayrollPersonSentencesBusiness().GetByPersonID(_personID).Select(r => r.IDPayrollSentences).ToList();

            new PayrollSentencesSubmit(true, _personID, SentencesID).ShowDialog();
            GridSentenceLoad();
        }
 public IQueryable <Class.Variable.PayrollContarctSentences> GetItems(Guid _personID)
 {
     return(Business.GetPayrollSentencesBusiness().GetAll().
            Join(Business.GetBaseInfoBusiness().GetAll(),
                 rFrist => rFrist.PrSType, o => o.Id, (rFrist, oFrist) =>
                 new { PayrollSentence = rFrist, BaseInfo = oFrist }).
            Join(Business.GetBaseInfoBusiness().GetAll(),
                 rSecend => rSecend.PayrollSentence.PrSOType, oSecend => oSecend.Id,
                 (r, i) => new { all = r, i }).
            Join(Business.GetPayrollPersonSentencesBusiness().GetAll().Where(r => r.IDPayrollPerson == _personID),
                 r => r.all.PayrollSentence.ID, i => i.IDPayrollSentences,
                 (r, i) => new Class.Variable.PayrollContarctSentences
     {
         PayrollSentencesID = r.all.PayrollSentence.ID,
         ID = i.ID,
         PrSType = r.all.PayrollSentence.PrSType,
         PrSOType = r.all.PayrollSentence.PrSOType,
         PrSDescription = r.all.PayrollSentence.PrSDescription,
         PrSMoney = r.all.PayrollSentence.PrSMoney,
         PrSIsInsurance = r.all.PayrollSentence.PrSIsInsurance,
         PrSIsTax = r.all.PayrollSentence.PrSIsTax,
         PrSInsuranceEmployer = r.all.PayrollSentence.PrSInsuranceEmployer,
         PrSInsuranceUnemployment = r.all.PayrollSentence.PrSInsuranceUnemployment,
         PrSInsuranceEmployee = r.all.PayrollSentence.PrSInsuranceEmployee,
         PrSOTypeDesc = r.i.AssignName,
         PrSTypeDesc = r.all.BaseInfo.AssignName,
         Money = i.PrPSMoney,
     }));
 }
示例#5
0
 public IQueryable <Data.PayrollSentence> GetSentenceByUserId(Guid _Id)
 {
     try
     {
         return(Business.GetPayrollPersonBusiness().GetAll().Where(r => r.id == _Id).
                Join(Business.GetPayrollPersonSentencesBusiness().GetAll(),
                     p => p.id, ps => ps.IDPayrollSentences, (p, ps) =>
                     new { PayrollPerson = p, PersonSentences = ps }).
                Join(Business.GetPayrollSentencesBusiness().GetAll(),
                     ps => ps.PersonSentences.IDPayrollSentences, s => s.ID, (ps, s) =>
                     new { PayrollSentence = s }).Select(r => r.PayrollSentence));
     }
     catch
     {
         throw;
     }
 }
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            if (IsSelected)
            {
                List <Data.PayrollPersonSentence> _personSentence = new List <PayrollPersonSentence>();

                foreach (var item in grdBenefitAndDeductionsLists.ItemsSource)
                {
                    if ((item as dynamic).IsSelected)
                    {
                        Data.PayrollPersonSentence _entity = new PayrollPersonSentence();
                        _entity.IDPayrollPerson    = PersonID;
                        _entity.IDPayrollSentences = (item as dynamic).PayrollSentencesID;
                        _entity.PrPSMoney          = (item as dynamic).PrSMoney;
                        _personSentence.Add(_entity);
                    }
                }
                Business.GetPayrollPersonSentencesBusiness().Save(_personSentence);
            }
            this.Close();
        }
示例#7
0
 public Data.PayrollPersonSentence GetByID(Guid ID)
 {
     return(Business.GetPayrollPersonSentencesBusiness().GetAll().Where(r => r.ID == ID).FirstOrDefault());
 }
示例#8
0
 public IQueryable <Data.PayrollPersonSentence> GetByPersonID(Guid _personID)
 {
     return(Business.GetPayrollPersonSentencesBusiness().GetAll().Where(r => r.IDPayrollPerson == _personID));
 }