private void loadGridLinq() { grdBenefitAndDeductionsLists.ItemsSource = Business.GetPayrollSentencesBusiness().GetItems().ToList(); var v = Business.GetPayrollSentencesBusiness().GetItems().ToList(); cc = v.Count(); ss = new string[cc, 9]; int ii = 0; foreach (var item in v) { string k_v_m = item.PrSTypeDesc; string N_ = item.PrSOTypeDesc; string Onv_ = item.PrSDescription; string Mablagh = item.PrSMoney.ToString(); string Bime = item.PrSIsInsurance.ToString(); string Maliayat = item.PrSIsTax.ToString(); string D_B_K_F = item.PrSInsuranceEmployer; string D_B_B = item.PrSInsuranceUnemployment; string D_B_P = item.PrSInsuranceEmployee; ss[ii, 0] = k_v_m; ss[ii, 1] = N_; ss[ii, 2] = Onv_; ss[ii, 3] = Mablagh; ss[ii, 4] = Bime; ss[ii, 5] = Maliayat; ss[ii, 6] = D_B_K_F; ss[ii, 7] = D_B_B; ss[ii, 8] = D_B_P; ii++; } }
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, })); }
private void FormLoad() { cmbType.ItemsSource = Business.GetPayrollSentencesBusiness().GetSentenceByUserId(_personid).Select(r => new { id = r.ID, Name = r.PrSDescription }).ToList(); cmbType.SelectedIndex = 0; }
private void txtSearch_KeyUp(object sender, KeyEventArgs e) { if (txtSearch.Text.Trim().Length > 0) { grdBenefitAndDeductionsLists.ItemsSource = Business.GetPayrollSentencesBusiness().GetItems().Where(i => i.PrSTypeDesc.Contains(txtSearch.Text) || i.PrSOTypeDesc.Contains(txtSearch.Text)).ToList(); } else { grdBenefitAndDeductionsLists.ItemsSource = Business.GetPayrollSentencesBusiness().GetItems().ToList(); } }
private void btnSubmit_Click(object sender, RoutedEventArgs e) { var _PayrollSentence = new PayrollSentence(); if (entityId != Guid.Empty) { _PayrollSentence = Business.GetPayrollSentencesBusiness().GetById(entityId); } if (FormIsValid()) { commitchange(_PayrollSentence); } }
private void commitchange(PayrollSentence payrollSentence) { payrollSentence.PrSType = cmbBenefitType.SelectedValue.ToGUID(); payrollSentence.PrSOType = cmbType.SelectedValue.ToGUID(); payrollSentence.PrSDescription = txtTitle.Text; payrollSentence.PrSMoney = txtPrice.Text.ToDecimal(); payrollSentence.PrSIsInsurance = chbInsurance.IsChecked; payrollSentence.PrSIsTax = chbTaxation.IsChecked; payrollSentence.PrSInsuranceEmployer = txtMasterInsurance.Text; payrollSentence.PrSInsuranceUnemployment = txtUnemploymentInsurance.Text; payrollSentence.PrSInsuranceEmployee = txtEmployeeInsurance.Text; Business.GetPayrollSentencesBusiness().Save(payrollSentence); this.Close(); }
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; } }
public PayrollSentencesSubmit(bool HaveCheckBox, Guid PersonID, List <Guid?> SentencesID) { InitializeComponent(); loadGridLinq(); grdBenefitAndDeductionsLists.ItemsSource = Business.GetPayrollSentencesBusiness().GetItems().Where(r => !SentencesID.Contains(r.PayrollSentencesID)).ToList(); DataGridCheckBoxColumn chbSentence = new DataGridCheckBoxColumn(); Binding chbBinding = new Binding("IsSelected"); chbSentence.Header = "انتخاب"; chbSentence.Binding = chbBinding; grdBenefitAndDeductionsLists.Columns.Add(chbSentence); this.PersonID = PersonID; IsSelected = true; }
private void BtnPrint_Click(object sender, RoutedEventArgs e) { var v = Business.GetPayrollSentencesBusiness().GetItems().ToList(); if (txtSearch.Text.Trim().Length > 0) { v = Business.GetPayrollSentencesBusiness().GetItems().Where(i => i.PrSTypeDesc.Contains(txtSearch.Text) || i.PrSOTypeDesc.Contains(txtSearch.Text)).ToList(); } else { grdBenefitAndDeductionsLists.ItemsSource = Business.GetPayrollSentencesBusiness().GetItems().ToList(); } StiReport report = new StiReport(); report.Load(@".\\Report\\Payroll\\PayrollSentencesSubmit.mrt"); report.RegData("v", v); report.Show(); }