Ejemplo n.º 1
0
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            //string strMsg = "";
            //string Result = "";
            //if (SelectCompany != null)
            //{
            //    if (SelectCompany.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
            //    {
            //        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("Msg_NoDeleteOrder"),
            //    Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

            //        return;
            //    }
            //    //if (!SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(SelectCompany, "T_HR_COMPANY", SMT.SaaS.FrameworkUI.OperationType.Delete, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID))
            //    //{
            //    //    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("NODELETEPERMISSION", SelectCompany.CNAME),
            //    //  Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            //    //    return;
            //    //}
            //    ComfirmWindow com = new ComfirmWindow();
            //    com.OnSelectionBoxClosed += (obj, result) =>
            //    {
            //        client.CompanyDeleteAsync(SelectCompany.COMPANYID, strMsg);
            //    };
            //    com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            //}
            //else
            //{
            //    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"),
            //Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            //}
            string Result = "";
            string strMsg = string.Empty;

            if (DtGrid.SelectedItems.Count > 0)
            {
                //判断是否可以删除
                string ids = "";
                foreach (T_HR_COMPANY tmp in DtGrid.SelectedItems)
                {
                    if (tmp.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("Msg_NoDeleteOrder"),
                                                       Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);

                        return;
                    }
                    ids += tmp.COMPANYID + ",";
                }
                string a = ids.Substring(0, ids.Length - 1);
                //提示是否删除
                ComfirmWindow com = new ComfirmWindow();
                com.OnSelectionBoxClosed += (obj, result) =>
                {
                    string newIds = ids.Substring(0, ids.Length - 1);
                    client.CompanyDeleteAsync(newIds, strMsg);
                };
                com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
            else
            {
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"),
                                               Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
        }