Example #1
0
        private void Delete(string id)
        {
            string Result = "";
            string strMsg = string.Empty;
            //提示是否删除
            ComfirmWindow com = new ComfirmWindow();

            com.OnSelectionBoxClosed += (obj, result) =>
            {
                client.EmployeeCancelLeaveDeleteAsync(new System.Collections.ObjectModel.ObservableCollection <string>(new List <string>()
                {
                    id
                }));
            };
            com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("确定要删除吗?"), ComfirmWindow.titlename, Result);
        }
Example #2
0
        /// <summary>
        /// 删除指定的签卡记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (dgEmpLeaveRdList.SelectedItems == null)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            if (dgEmpLeaveRdList.SelectedItems.Count == 0)
            {
                ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON"));
                return;
            }

            ObservableCollection <string> ids = new ObservableCollection <string>();

            foreach (object ovj in dgEmpLeaveRdList.SelectedItems)
            {
                T_HR_EMPLOYEECANCELLEAVE ent = ovj as T_HR_EMPLOYEECANCELLEAVE;
                if (ent == null)
                {
                    continue;
                }

                if (ent.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString())
                {
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("DELETEAUDITERROR"));
                    break;
                }

                ids.Add(ent.CANCELLEAVEID);
            }

            string Result = "";

            if (ids.Count > 0)
            {
                ComfirmWindow delComfirm = new ComfirmWindow();
                delComfirm.OnSelectionBoxClosed += (obj, result) =>
                {
                    client.EmployeeCancelLeaveDeleteAsync(ids);
                };
                delComfirm.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result);
            }
        }