Beispiel #1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            CARSServiceClient client = CARSServiceClientFactory.CreateCARSServiceClient();            // leave this line, we cannot use a public static object here. Because this reject reason window will be created may times.

            client.RejectLeaveCompleted += new EventHandler <RejectLeaveCompletedEventArgs>(client_RejectLeaveCompleted);
            string reasonValue = reason.Text.Replace("&", "&amp;")
                                 .Replace(" ", "&nbsp;")
                                 .Replace("\"", "&quot;")
                                 .Replace(">", "&gt;")
                                 .Replace("<", "&lt;");

            foreach (LeaveItem leave in leaves)
            {
                client.RejectLeaveAsync(mUser.Employee.PKEmployeeID.ToString(), leave.LeaveInfo.PKLeaveInfoID.ToString(), LeaveStatus.Rejected, reasonValue);
                count++;
            }

            this.DialogResult = true;
        }