private void BtnEdit_Click(object sender, RoutedEventArgs e) { if (grdBenefitAndDeductionsLists.SelectedValue != null) { try { Data.PayrollSentence myData = new PayrollSentence(); myData.ID = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).ID; myData.PrSType = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSType; myData.PrSOType = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSOType; myData.PrSDescription = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSDescription; myData.PrSMoney = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSMoney; myData.PrSIsInsurance = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSIsInsurance; myData.PrSIsTax = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSIsTax; myData.PrSInsuranceEmployer = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSInsuranceEmployer; myData.PrSInsuranceUnemployment = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSInsuranceUnemployment; myData.PrSInsuranceEmployee = (grdBenefitAndDeductionsLists.SelectedValue as dynamic).PrSInsuranceEmployee; new PayrollSentencesSubmitChild(myData).ShowDialog(); } catch { throw; } loadGridLinq(); } }
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 void Insert(PayrollSentence payrollBenefitAndDeductions) { try { if (payrollBenefitAndDeductions.ID == Guid.Empty) { payrollBenefitAndDeductions.ID = Guid.NewGuid(); } this.Table.Add(payrollBenefitAndDeductions); this.SubmitChanges(); } catch { throw; } }
public void Save(PayrollSentence PayrollSentences) { try { if (PayrollSentences.ID == Guid.Empty) { this.Insert(PayrollSentences); } else { this.SubmitChanges(); } } catch { throw; } }
public PayrollSentencesSubmitChild(PayrollSentence myData) { InitializeComponent(); FormLoad(myData); }