private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (dgHireApp.SelectedItems.Count > 0)
            {
                string Result = "";
                hireAppID = new ObservableCollection <string>();
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    for (int i = 0; i < dgHireApp.SelectedItems.Count; i++)
                    {
                        string hireID = "";
                        hireID = (dgHireApp.SelectedItems[i] as V_HouseHireApp).houseAppObj.HIREAPPID;
                        if ((dgHireApp.SelectedItems[i] as V_HouseHireApp).houseAppObj.CHECKSTATE == "0" || (dgHireApp.SelectedItems[i] as V_HouseHireApp).houseAppObj.CHECKSTATE == "3")
                        {
                            if (!(hireAppID.IndexOf(hireID) > -1))
                            {
                                hireAppID.Add(hireID);
                            }
                        }
                    }
                    if (hireAppID.Count > 0)
                    {
                        client.DeleteHireAppAsync(hireAppID);
                    }
                    else
                    {
                        Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("SELECTITEMSNOTDELETE"));
                    }
                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
            else
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }


            //ObservableCollection<string> hireAppID = GridHelper.GetSelectItem(dgHireApp, "myChkBox", Action.Edit);
            //if (hireAppID == null || hireAppID.Count == 0)
            //{
            //    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            //}
            //else
            //{
            //    string Result = "";
            //    ComfirmWindow com = new ComfirmWindow();
            //    com.OnSelectionBoxClosed += (obj, result) =>
            //    {
            //        client.DeleteHireAppAsync(hireAppID);
            //    };
            //    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            //}
        }
示例#2
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            ObservableCollection <string> hireAppID = GridHelper.GetSelectItem(dgHireApp, "myChkBox", Action.Edit);

            if (hireAppID == null || hireAppID.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            }
            else
            {
                string        Result = "";
                ComfirmWindow com    = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    client.DeleteHireAppAsync(hireAppID);
                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
        }