Ejemplo n.º 1
0
 public ApprovalRequest(ApprovalRequest old, int index)
 {
     documentTitle = old.documentTitle;
     document = old.document;
     approvalType = old.approvalType;
     requester = old.requester;
     concurrentIndex = index;
     id = old.id;
 }
Ejemplo n.º 2
0
 public ApprovalRequest(String dt, String d, String at, User re)
 {
     documentTitle = dt;
     document = d;
     approvalType = at;
     requester = re;
     concurrentIndex = 0;
     id = Guid.NewGuid();
 }
Ejemplo n.º 3
0
 public static void RemoveUser(User id)
 {
     using (SqlConnection sCon = new SqlConnection(dbconnStr))
     {
         using (SqlCommand sCom = new SqlCommand())
         {
             sCom.Connection = sCon;
             sCom.CommandText = "DELETE FROM users WHERE guid='" + id.Id + "'";
             sCon.Open();
             sCom.ExecuteNonQuery();
             sCon.Dispose();
         }
     }
 }
Ejemplo n.º 4
0
 public static User AddUser(String uname, String utype, String endaddressrequest, String endaddressresponse)
 {
     User newUser = new User(uname, utype, endaddressrequest, endaddressresponse);
     using (SqlConnection sCon = new SqlConnection(dbconnStr))
     {
         SqlCommand sCom = new SqlCommand();
         sCom.Connection = sCon;
         sCom.CommandText = "insert into users (username,usertype,addressrequest,addressresponse,guid) values('" + uname + "', '" + utype + "', '" + endaddressrequest + "', '" + endaddressresponse + "', '" + newUser.Id + "')";
         sCon.Open();
         sCom.ExecuteNonQuery();
         sCon.Dispose();
     }
     return newUser;
 }
Ejemplo n.º 5
0
 public void Unsubscribe(User id)
 {
     UserManager.RemoveUser(id);
 }
Ejemplo n.º 6
0
 public User Subscribe(User newuser)
 {
     return UserManager.AddUser(newuser.Name, newuser.Type, newuser.AddressRequest, newuser.AddressResponse);
 }
Ejemplo n.º 7
0
 public void Unsubscribe(Microsoft.Samples.DocumentApprovalProcess.ApprovalMessageContractLibrary.User id)
 {
     base.Channel.Unsubscribe(id);
 }
Ejemplo n.º 8
0
 public Microsoft.Samples.DocumentApprovalProcess.ApprovalMessageContractLibrary.User Subscribe(Microsoft.Samples.DocumentApprovalProcess.ApprovalMessageContractLibrary.User newuser)
 {
     return(base.Channel.Subscribe(newuser));
 }
Ejemplo n.º 9
0
        private void connect_Click(object sender, RoutedEventArgs e)
        {
            connect.IsEnabled = false;
            name.IsEnabled = false;
            userType.IsEnabled = false;

            SubscriptionServiceClient sclient = new SubscriptionServiceClient();
            // Set endpoint to previously discovered address
            sclient.Endpoint.Address = subscriptionAddr;

            statusWriter.WriteLine("Subscribing to " + sclient.Endpoint.Address + " as " + name.Text + " of type " + userType.Text);

            user = sclient.Subscribe(new User(name.Text, userType.Text, addrListenForApprovalRequests, addrListenForApprovalResponses));
            subscribed = true;

            disconnect.IsEnabled = true;
            approvalType.IsEnabled = true;
            docName.IsEnabled = true;
            document.IsEnabled = true;
            requestApproval.IsEnabled = true;

            statusWriter.WriteLine("Subscribed with user guid " + user.Id);
        }
Ejemplo n.º 10
0
 public UserWithIndex(User u, int index)
 {
     U = u;
     Index = index;
 }