示例#1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (dgHouse.SelectedItems.Count > 0)
            {
                string Result = "";
                issuanceDelID = new ObservableCollection <string>();
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    for (int i = 0; i < dgHouse.SelectedItems.Count; i++)
                    {
                        string GradeID = "";
                        GradeID = (dgHouse.SelectedItems[i] as T_OA_HOUSEINFOISSUANCE).ISSUANCEID;
                        if ((dgHouse.SelectedItems[i] as T_OA_HOUSEINFOISSUANCE).CHECKSTATE == "0" || (dgHouse.SelectedItems[i] as T_OA_HOUSEINFOISSUANCE).CHECKSTATE == "3")
                        {
                            if (!(issuanceDelID.IndexOf(GradeID) > -1))
                            {
                                issuanceDelID.Add(GradeID);
                            }
                        }
                    }
                    if (issuanceDelID.Count > 0)
                    {
                        client.DeleteIssuanceAsync(issuanceDelID);
                    }
                    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"));
            }

            //issuanceDelID = GridHelper.GetSelectItem(dgHouse, "myChkBox", Action.Delete);
            //if (issuanceDelID == null || issuanceDelID.Count == 0)
            //{
            //    //HtmlPage.Window.Alert("请先选择需要删除的房源信息记录");

            //    //Utility.ShowCustomMessage(MessageTypes.Message, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "DELETE"));

            //    ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
            //}
            //else
            //{
            //    //ComfirmBox deleComfirm = new ComfirmBox();
            //    //deleComfirm.Title = Utility.GetResourceStr("DELETECONFIRM");
            //    //deleComfirm.MessageTextBox.Text = Utility.GetResourceStr("DELETEALTER");
            //    //deleComfirm.ButtonOK.Click += new RoutedEventHandler(ButtonOK_Click);
            //    //deleComfirm.Show();

            //    //if (HtmlPage.Window.Confirm("您确定要删除选中的房源信息记录吗?"))
            //    //{
            //    //    client.DeleteIssuanceAsync(issuanceDelID);
            //    //}

            //    string Result = "";
            //    ComfirmWindow com = new ComfirmWindow();
            //    com.OnSelectionBoxClosed += (obj, result) =>
            //    {
            //        client.DeleteIssuanceAsync(issuanceDelID);
            //    };
            //    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            //}
        }