Пример #1
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            strDelResult = string.Empty;
            if (DtGrid.SelectedItems.Count > 0)
            {
                strDelIDs.Clear();
                string filterString = string.Empty;
                ObservableCollection <string> paras = new ObservableCollection <string>();

                NumericUpDown nuYear        = Utility.FindChildControl <NumericUpDown>(expander, "Nuyear");
                NumericUpDown NuStartmounth = Utility.FindChildControl <NumericUpDown>(expander, "NuStartmounth");

                if (nuYear != null)
                {
                    filterString = " SALARYYEAR == @" + paras.Count().ToString();
                    paras.Add(nuYear.Value.ToString());
                }

                if (NuStartmounth != null)
                {
                    if (!string.IsNullOrEmpty(filterString))
                    {
                        filterString += " AND";
                    }

                    filterString = " SALARYMONTH == @" + paras.Count().ToString();
                    paras.Add(NuStartmounth.Value.ToString());
                }

                if (!string.IsNullOrEmpty(filterString))
                {
                    filterString += " AND (";
                }

                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    for (int i = 0; i < DtGrid.SelectedItems.Count; i++)
                    {
                        T_HR_PENSIONDETAIL tmp = DtGrid.SelectedItems[i] as T_HR_PENSIONDETAIL;

                        strDelIDs.Add(tmp.PENSIONDETAILID);
                        filterString += " EMPLOYEEID == @" + paras.Count().ToString();

                        if (i < DtGrid.SelectedItems.Count - 1)
                        {
                            filterString += " OR ";
                        }
                        else
                        {
                            filterString += " )";
                        }

                        paras.Add(tmp.PENSIONDETAILID);
                    }

                    clientSalary.CheckSalaryAuditStateAsync(strDelResult, filterString, paras);
                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, strDelResult);
            }
        }