public void GetMessageCount_Pass() { //Arrange bool expected = true; bool actual = false; IList <GeneralMessage> messages = new List <GeneralMessage>(); //Act try { for (int i = 0; i < _numMessages; i++) // Creating 3 general messages to send to database { messages.Add(new GeneralMessage(receiverID, i + 2, GetDateTime.GetUTCNow(), "Test message" + i)); RoomAid.QueueConsumer.QueueConsumer.SendToDB((IMessage)messages[i]); } if (_messageDAO.GetCount(receiverID, true) == _numMessages) { actual = true; } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Assert Assert.AreEqual(expected, actual); }
public void PurgeQueue_Pass() { //Arrange var expected = true; var actual = false; IMessage message = new GeneralMessage(1, 2, GetDateTime.GetUTCNow(), "Test message"); //Act try { _msmqHandler.Send(message); if (_msmqHandler.Peek(1)) // If message is sent to queue (a message exists on queue) { _msmqHandler.Purge(); // Then purge if (!_msmqHandler.Peek(1)) // If queue is now empty { actual = true; // Actual = true; } } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Assert Assert.IsTrue(expected == actual); }
public void SendInvitationToDB_MessageIDCreated_Pass() { //Arrange IMessage invitation = new Invitation(receiverID, 2, GetDateTime.GetUTCNow()); bool isSuccess = false; //Act try { RoomAid.QueueConsumer.QueueConsumer.SendToDB(invitation); // using directive doesn't work for some reason // NOTE: All three commands below will return the first column of the first row of data, but since we cleared the database first there is only one entry int incomingSysID = (int)_messageDAO.RetrieveOneColumn(new SqlCommand("SELECT SysID FROM dbo.InboxMessages")); int incomingMessageID = (int)_messageDAO.RetrieveOneColumn(new SqlCommand("SELECT MessageID FROM dbo.InboxMessages")); int incomingInvitationMessageID = (int)_messageDAO.RetrieveOneColumn(new SqlCommand("SELECT MessageID FROM dbo.Invitations")); if (incomingSysID == receiverID && incomingMessageID == incomingInvitationMessageID) { isSuccess = true; } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Assert Assert.IsTrue(isSuccess); }
private void button1_Click(object sender, EventArgs e) { try { int ID = GenerateIDColumn.GetNewID("TripTbl"); string Origin = this.textBox1.Text.ToString(); string Destination = this.textBox2.Text.ToString(); string RegisterDateTime = GetDateTime.GenerateDateTime(); string Cost = this.textBox3.Text.ToString(); string Description = this.richTextBox1.Text.ToString(); string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["TaxiServiceDempAppWithSQLServer.Properties.Settings.TaxiServicesDBConnectionString"].ToString(); SqlConnection cn = new SqlConnection(connectionString); cn.Open(); string query = "INSERT INTO TripTbl (ID, Origin, Destination, RegisterDateTime, Cost, Description) values (@ID, @Origin, @Destination, @RegisterDateTime, @Cost, @Description)"; SqlCommand cmd = new SqlCommand(query, cn); cmd.Parameters.Add("@ID", SqlDbType.Int); cmd.Parameters.Add("@Origin", SqlDbType.NVarChar); cmd.Parameters.Add("@Destination", SqlDbType.NVarChar); cmd.Parameters.Add("@RegisterDateTime", SqlDbType.NVarChar); cmd.Parameters.Add("@Cost", SqlDbType.NVarChar); cmd.Parameters.Add("@Description", SqlDbType.NVarChar); cmd.Parameters["@ID"].Value = ID; cmd.Parameters["@Origin"].Value = Origin; cmd.Parameters["@Destination"].Value = Destination; cmd.Parameters["@RegisterDateTime"].Value = RegisterDateTime; cmd.Parameters["@Cost"].Value = Cost; cmd.Parameters["@Description"].Value = Description; cmd.ExecuteNonQuery(); cn.Close(); if (InsertTripsToDB(ID)) { MessageBox.Show("اطلاعات با موفقیت در سیستم ثبت شد!"); this.textBox1.Clear(); this.textBox2.Clear(); this.textBox3.Clear(); this.richTextBox1.Clear(); } else { throw new Exception(); } } catch (Exception ex) { MessageBox.Show("متاسفانه خطایی در روند ثبت اطلاعات رخ داده است !"); MessageBox.Show(ex.Message); } }
public void SendAndReadMultipleRows_GeneralMessage_Pass() { //Arrange bool isSuccess = false; IList <GeneralMessage> messages = new List <GeneralMessage>(); //Act try { for (int i = 0; i < _numMessages; i++) // Creating 3 general messages to send to database { messages.Add(new GeneralMessage(receiverID, i + 2, GetDateTime.GetUTCNow(), "Test message" + i)); RoomAid.QueueConsumer.QueueConsumer.SendToDB((IMessage)messages[i]); } IList <IList <string> > incomingMessages = _messageDAO.RetrieveMultipleRows(new SqlCommand("SELECT * FROM dbo.InboxMessages")); IList <IList <string> > generalMessageContent = _messageDAO.RetrieveMultipleRows(new SqlCommand("SELECT MessageBody FROM dbo.GeneralMessages")); for (int i = 0; i < incomingMessages.Count; i++) { // InboxMessage[0..6] = [ReceiverID, MessageID, PrevMessageID, SenderID, IsRead, SentDate, IsGeneral] GeneralMessage incomingMessage = new GeneralMessage(Int32.Parse(incomingMessages[i][0]), Int32.Parse(incomingMessages[i][2]), Int32.Parse(incomingMessages[i][3]), DateTime.Parse(incomingMessages[i][5]), generalMessageContent[i][0]) { IsRead = bool.Parse(incomingMessages[i][4]) // IsRead [4] }; //incomingMessage.IsAccepted = bool.Parse(generalMessageContent[i][0]); if (incomingMessage.SenderID == messages[i].SenderID && incomingMessage.ReceiverID == messages[i].ReceiverID && incomingMessage.PrevMessageID == messages[i].PrevMessageID && incomingMessage.IsRead == messages[i].IsRead && incomingMessage.SentDate.ToString().Equals(messages[i].SentDate.ToString()) && // HACK: SQL & .NET DateTime precision is off, so comparing strings incomingMessage.MessageBody.Equals(messages[i].MessageBody) && incomingMessage.IsGeneral == true) { isSuccess = true; } else { isSuccess = false; // Since there are multiple messages to be checked, must set false if any are not equal } } } catch (Exception e) { Trace.WriteLine(e); } //Assert Assert.IsTrue(isSuccess); }
private void Awake() { GetDateTime._instance = this; EventDelegate.Set(this.btn_comfirm.onClick, new EventDelegate.Callback(this.OnComfirmBtnClick)); EventDelegate.Set(this.btn_cancle.onClick, new EventDelegate.Callback(this.OnCancleBtnClick)); EventDelegate.Set(this.btn_mask.onClick, new EventDelegate.Callback(this.OnMaskBtnClick)); EventDelegate.Set(this.input_year.onSubmit, new EventDelegate.Callback(this.OnInputYearCallback)); EventDelegate.Set(this.input_month.onSubmit, new EventDelegate.Callback(this.OnInputMonthCallback)); for (int i = 0; i < this.dayList.Count; i++) { this.SetButtonCallBack(this.dayList[i], new Action <int>(this.OnDayBtnClick), i); } }
public bool SendInvitation(int receiverID, int senderID) { try { var invitation = new Invitation(receiverID, senderID, GetDateTime.GetUTCNow()); Send(invitation); return(true); } catch (Exception e) { _errorHandler.Handle(e); return(false); } }
public SinhVienViewModel() { //Title cho Window base.DisplayName = "Thông tin Sinh Viên - CEOS Technology"; //Lấy danh sách Sinh Viên ListSinhVien = new ObservableCollection <SinhVien>(db.SinhVien.ToList()); //Lấy danh sách lớp ListLop = new ObservableCollection <Lop>(db.Lop.ToList()); //Lấy danh sách ngày tháng năm ListDay = GetDateTime.GetListDay(); ListMonth = GetDateTime.GetListMonth(); ListYear = GetDateTime.GetListYear(); Button n = new Button(); }
private bool InsertTripsToDB(int InputTripID) { try { int ID = GenerateIDColumn.GetNewID("TripsTbl"); int TripID = InputTripID; int ReservationPersonID = int.Parse(this.comboBox3.SelectedValue.ToString()); int CustomerID = int.Parse(this.comboBox1.SelectedValue.ToString()); int DriverID = int.Parse(this.comboBox2.SelectedValue.ToString()); string RegisterDateTime = GetDateTime.GenerateDateTime(); string Description = "-"; string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["TaxiServiceDempAppWithSQLServer.Properties.Settings.TaxiServicesDBConnectionString"].ToString(); SqlConnection cn = new SqlConnection(connectionString); cn.Open(); string query = "INSERT INTO TripsTbl (ID, TripID, ReservationPersonID, CustomerID, DriverID, RegisterDateTime, Description) values (@ID, @TripID, @ReservationPersonID, @CustomerID, @DriverID, @RegisterDateTime, @Description)"; SqlCommand cmd = new SqlCommand(query, cn); cmd.Parameters.Add("@ID", SqlDbType.Int); cmd.Parameters.Add("@TripID", SqlDbType.Int); cmd.Parameters.Add("@ReservationPersonID", SqlDbType.Int); cmd.Parameters.Add("@CustomerID", SqlDbType.Int); cmd.Parameters.Add("@DriverID", SqlDbType.Int); cmd.Parameters.Add("@RegisterDateTime", SqlDbType.NVarChar); cmd.Parameters.Add("@Description", SqlDbType.NVarChar); cmd.Parameters["@ID"].Value = ID; cmd.Parameters["@TripID"].Value = TripID; cmd.Parameters["@ReservationPersonID"].Value = ReservationPersonID; cmd.Parameters["@CustomerID"].Value = CustomerID; cmd.Parameters["@DriverID"].Value = DriverID; cmd.Parameters["@RegisterDateTime"].Value = RegisterDateTime; cmd.Parameters["@Description"].Value = Description; cmd.ExecuteNonQuery(); cn.Close(); return(true); } catch (Exception ex) { MessageBox.Show("متاسفانه خطایی در روند ثبت اطلاعات رخ داده است !"); MessageBox.Show(ex.Message); return(false); } }
public bool ReplyInvitation(int receiverID, int prevMessageID, int senderID, bool accepted) { try { var reply = new Invitation(receiverID, prevMessageID, senderID, GetDateTime.GetUTCNow()); if (accepted) { reply.IsAccepted = true; } return(Send(reply)); } catch (Exception e) { _errorHandler.Handle(e); return(false); } }
public bool ReplyMessage(int receiverID, int prevMessageID, int senderID, string messageBody) { try { if (messageBody == "" || messageBody == null) // NOTE: do check on front=end? { throw new Exception("Message body cannot be empty"); } var reply = new GeneralMessage(receiverID, prevMessageID, senderID, GetDateTime.GetUTCNow(), messageBody); return(Send(reply)); } catch (Exception e) { _errorHandler.Handle(e); return(false); } }
public static DateTime ToDateTime(this GetDateTime option, int days = 0) { { switch (option) { case GetDateTime.TODAY: return(DateTime.Now); case GetDateTime.YESTERDAY: return(DateTime.Now.AddDays(-1)); case GetDateTime.N_DAYS_AGO: return(DateTime.Now.AddDays(-days)); case GetDateTime.TOMORROW: return(DateTime.Now.AddDays(1)); default: return(DateTime.Now); } } }
public void SendMultipleMessages_RetrieveMessagesInSameOrder_GeneralMessages_Pass() { //Arrange bool isSuccess = false; IList messages = new List <IMessage>(); var j = 0; // Counter to check number of incoming messages against number of messages sent //Act try { for (int i = 0; i < _numMessages; i++) // Creating 3 general messages to send to queue { messages.Add(new GeneralMessage(i + 1, i + 2, GetDateTime.GetUTCNow(), "Test message" + i)); _msmqHandler.Send((IMessage)messages[i]); } while (_msmqHandler.Peek(1)) // 1 second should be enough to retrieve each message { var incoming = _msmqHandler.Receive(); if (incoming.ToString().Equals(messages[j].ToString())) // Check each incoming message against messages list { isSuccess = true; } else { isSuccess = false; // If any are not equal, the messages are not in the same order or did not send properly } j++; // Increment incoming messages counter } if (j != _numMessages) // If the number of incoming messages doesn't equal the number of messages sent to the queue { isSuccess = false; Trace.WriteLine("Incorrect number of incoming messages"); } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Cleanup _msmqHandler.Purge(); //Assert Assert.IsTrue(isSuccess); }
private void button1_Click(object sender, EventArgs e) { try { string ID = Guid.NewGuid().ToString(); string Origin = this.textBox1.Text.ToString(); string Destination = this.textBox2.Text.ToString(); string RegisterDateTime = GetDateTime.GenerateDateTime(); string Cost = this.textBox3.Text.ToString(); string Description = this.richTextBox1.Text.ToString(); var TripXDoc = XDocument.Load(xmlTripFile); var newElement = new XElement("Trip", new XElement("ID", ID), new XElement("Origin", Origin), new XElement("Destination", Destination), new XElement("RegisterDateTime", RegisterDateTime), new XElement("Cost", Cost), new XElement("Description", Description) ); TripXDoc.Element("Trips").Add(newElement); TripXDoc.Save(xmlTripFile); if (InsertTripsToDB(ID)) { MessageBox.Show("اطلاعات با موفقیت در سیستم ثبت شد!"); this.textBox1.Clear(); this.textBox2.Clear(); this.textBox3.Clear(); this.richTextBox1.Clear(); } else { throw new Exception(); } } catch (Exception ex) { MessageBox.Show("متاسفانه خطایی در روند ثبت اطلاعات رخ داده است !"); MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); } }
private void MakeTestData() { IList <GeneralMessage> messages = new List <GeneralMessage>(); IList <User> sendingUsers = new List <User>(); try { //CreateUser(receiverID, email, "Michell", "Kuang"); // Creating a user for the first account created in test initialization for (int i = 0; i < _numMessages; i++) // Creating the same number of users as the number of messages that will be sent { // Create email StringBuilder userEmail = new StringBuilder("email"); userEmail.Append(i); userEmail.Append("@gmail.com"); // Create first name StringBuilder firstName = new StringBuilder("FirstName"); firstName.Append(i); // Create last name StringBuilder lastName = new StringBuilder("LastName"); lastName.Append(i); CreateAccount(userEmail.ToString(), "TestPassword", "TestSalt"); // Create user var command = new SqlCommand("SELECT SysID FROM dbo.Users WHERE UserEmail = @email"); command.Parameters.AddWithValue("@email", userEmail.ToString()); int rcvid = (int)_messageDAO.RetrieveOneColumn(command); // Get SysID of user just created var user = CreateUser(rcvid, userEmail.ToString(), firstName.ToString(), lastName.ToString()); sendingUsers.Add(user); messages.Add(new GeneralMessage(2211, rcvid, GetDateTime.GetUTCNow(), "Test message" + i)); // All messages will be sent to the first user created RoomAid.QueueConsumer.QueueConsumer.SendToDB((IMessage)messages[i]); command = new SqlCommand("SELECT MessageID FROM dbo.InboxMessages WHERE SenderID = @sendid"); command.Parameters.AddWithValue("@sendid", rcvid); int incomingMessageID = (int)_messageDAO.RetrieveOneColumn(command); messages[i].MessageID = incomingMessageID; } } catch (Exception e) { Trace.WriteLine(e); } }
public void SendAndReadOneRow_Invitation_Pass() { //Arrange Invitation invitation = new Invitation(receiverID, 2, GetDateTime.GetUTCNow()); bool isSuccess = false; //Act try { RoomAid.QueueConsumer.QueueConsumer.SendToDB(invitation); // using directive doesn't work for some reason List <string> inboxContent = (List <string>)_messageDAO.RetrieveOneRow(new SqlCommand("SELECT * FROM dbo.InboxMessages")); bool invitationContent = bool.Parse(_messageDAO.RetrieveOneColumn(new SqlCommand("SELECT IsAccepted FROM dbo.Invitations")).ToString()); // InboxMessage[0..6] = [ReceiverID, MessageID, PrevMessageID, SenderID, IsRead, SentDate, IsGeneral] Invitation incomingInvitation = new Invitation(Int32.Parse(inboxContent[0]), Int32.Parse(inboxContent[2]), Int32.Parse(inboxContent[3]), DateTime.Parse(inboxContent[5])) { IsRead = bool.Parse(inboxContent[4]), IsAccepted = invitationContent }; if (incomingInvitation.SenderID == invitation.SenderID && incomingInvitation.ReceiverID == invitation.ReceiverID && incomingInvitation.PrevMessageID == invitation.PrevMessageID && incomingInvitation.IsRead == invitation.IsRead && incomingInvitation.SentDate.ToString().Equals(invitation.SentDate.ToString()) && // HACK: SQL & .NET DateTime precision is off, so comparing strings incomingInvitation.IsAccepted.Equals(invitation.IsAccepted) && incomingInvitation.IsGeneral == false) { isSuccess = true; } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Assert Assert.IsTrue(isSuccess); }
public void SendAndReadOneRow_GeneralMessage_Pass() { //Arrange GeneralMessage message = new GeneralMessage(receiverID, 2, GetDateTime.GetUTCNow(), "Test message"); bool isSuccess = false; //Act try { RoomAid.QueueConsumer.QueueConsumer.SendToDB(message); // using directive doesn't work for some reason List <string> inboxContent = (List <string>)_messageDAO.RetrieveOneRow(new SqlCommand("SELECT * FROM dbo.InboxMessages")); string generalMessageContent = _messageDAO.RetrieveOneColumn(new SqlCommand("SELECT MessageBody FROM dbo.GeneralMessages")).ToString(); // InboxMessage[0..6] = [ReceiverID, MessageID, PrevMessageID, SenderID, IsRead, SentDate, IsGeneral] GeneralMessage incomingMessage = new GeneralMessage(Int32.Parse(inboxContent[0]), Int32.Parse(inboxContent[2]), Int32.Parse(inboxContent[3]), DateTime.Parse(inboxContent[5]), generalMessageContent) { IsRead = bool.Parse(inboxContent[4]) }; if (incomingMessage.SenderID == message.SenderID && incomingMessage.ReceiverID == message.ReceiverID && incomingMessage.PrevMessageID == message.PrevMessageID && incomingMessage.IsRead == message.IsRead && incomingMessage.SentDate.ToString().Equals(message.SentDate.ToString()) && // HACK: SQL & .NET DateTime precision is off, so comparing strings incomingMessage.MessageBody.Equals(message.MessageBody) && incomingMessage.IsGeneral == true) { isSuccess = true; } } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Assert Assert.IsTrue(isSuccess); }
public void SendAndReceiveOneMessage_GeneralMessage_Pass() { //Arrange IMessage message = new GeneralMessage(1, 2, GetDateTime.GetUTCNow(), "Test message"); var incoming = new GeneralMessage(); //Act try { _msmqHandler.Send(message); incoming = (GeneralMessage)_msmqHandler.Receive(); } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Cleanup _msmqHandler.Purge(); //Assert Assert.AreEqual(incoming.ToString(), message.ToString()); // Doesn't pass if not converted to String (even though seemingly equal) }
public void SendAndReceiveOneMessage_Invitation_Pass() { //Arrange IMessage invitation = new Invitation(1, 2, GetDateTime.GetUTCNow()); var incoming = new Invitation(); //Act try { _msmqHandler.Send(invitation); incoming = (Invitation)_msmqHandler.Receive(); } catch (Exception e) { Trace.WriteLine(e.ToString()); } //Cleanup _msmqHandler.Purge(); //Assert Assert.AreEqual(incoming.ToString(), invitation.ToString()); // Doesn't pass if not converted to String (even though seemingly equal) }
private bool InsertTripsToDB(string InputTripID) { try { string ID = Guid.NewGuid().ToString(); string TripID = InputTripID; string ReservationPersonID = (this.comboBox3.SelectedItem as UserComboBoxData).Value.ToString(); string CustomerID = (this.comboBox1.SelectedItem as UserComboBoxData).Value.ToString(); string DriverID = (this.comboBox2.SelectedItem as UserComboBoxData).Value.ToString(); string RegisterDateTime = GetDateTime.GenerateDateTime(); string Description = this.richTextBox1.Text.ToString(); var TripsXDoc = XDocument.Load(xmlTripsFile); var newElement = new XElement("Trips", new XElement("ID", ID), new XElement("TripID", TripID), new XElement("ReservationPersonID", ReservationPersonID), new XElement("CustomerID", CustomerID), new XElement("DriverID", DriverID), new XElement("RegisterDateTime", RegisterDateTime), new XElement("Description", Description) ); TripsXDoc.Element("Tripss").Add(newElement); TripsXDoc.Save(xmlTripsFile); return(true); } catch (Exception ex) { MessageBox.Show("متاسفانه خطایی در روند ثبت اطلاعات رخ داده است !"); MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); return(false); } }
public override string ToString() { return(string.Format("Toy[{0}].Name={1}, get from {2}, by {3}", Id, Name, GetDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff"), Owner != null ? Owner.Name + "(" + Owner.Id + ")" : string.Empty)); }
public void GetInvitationInbox_Pass() { //Arrange bool isSuccess = false; IList <Invitation> invitations = new List <Invitation>(); IList <User> sendingUsers = new List <User>(); try { CreateUser(receiverID, email, "Michell", "Kuang"); // Creating a user for the first account created in test initialization for (int i = 0; i < _numMessages; i++) // Creating the same number of users as the number of messages that will be sent { // Create email StringBuilder userEmail = new StringBuilder("email"); userEmail.Append(i); userEmail.Append("@gmail.com"); // Create first name StringBuilder firstName = new StringBuilder("FirstName"); firstName.Append(i); // Create last name StringBuilder lastName = new StringBuilder("LastName"); lastName.Append(i); CreateAccount(userEmail.ToString(), "TestPassword", "TestSalt"); // Create user var command = new SqlCommand("SELECT SysID FROM dbo.Users WHERE UserEmail = @email"); command.Parameters.AddWithValue("@email", userEmail.ToString()); int rcvid = (int)_messageDAO.RetrieveOneColumn(command); // Get SysID of user just created var user = CreateUser(rcvid, userEmail.ToString(), firstName.ToString(), lastName.ToString()); sendingUsers.Add(user); invitations.Add(new Invitation(receiverID, rcvid, GetDateTime.GetUTCNow())); // All messages will be sent to the first user created RoomAid.QueueConsumer.QueueConsumer.SendToDB((IMessage)invitations[i]); command = new SqlCommand("SELECT MessageID FROM dbo.InboxMessages WHERE SenderID = @sendid"); command.Parameters.AddWithValue("@sendid", rcvid); int incomingMessageID = (int)_messageDAO.RetrieveOneColumn(command); invitations[i].MessageID = incomingMessageID; } } catch (Exception e) { Trace.WriteLine(e); } //Act try { IList <MessageListing> inbox = manager.GetAllInvitations(receiverID); // Retrieve all messages in inbox for user "Michell Kuang" for (int i = 0; i < inbox.Count; i++) { // Combine first and last to get full name StringBuilder sb = new StringBuilder(sendingUsers[i].FirstName); sb.Append(" "); sb.Append(sendingUsers[i].LastName); if (inbox[i].MessageID == invitations[i].MessageID && inbox[i].SentDate.ToString().Equals(invitations[i].SentDate.ToString("f", CultureInfo.CreateSpecificCulture("en-US"))) && inbox[i].FullName.Equals(sb.ToString())) { isSuccess = true; } else { isSuccess = false; // Since there are multiple messages to be checked, must set false if any are not equal } } } catch (Exception e) { Trace.WriteLine(e); } //Cleanup other users created foreach (User u in sendingUsers) { DeleteAccounts(u.UserEmail); } //Assert Assert.IsTrue(isSuccess); }
/// <summary> /// Creates a user associated with an account for testing /// </summary> /// <param name="rcvid">SystemID of the user to be created</param> /// <param name="userEmail">Email of the user to be created</param> /// <param name="firstname">First name of user to be created</param> /// <param name="lastname">Last name of user to be created</param> /// <returns></returns> private User CreateUser(int rcvid, string userEmail, string firstname, string lastname) { try { var user = new User(rcvid, userEmail, firstname, lastname, "Enable", GetDateTime.GetUTCNow(), "Female"); var update = new UpdateAccountSqlService(user, _dao); update.Update(); return(user); } catch (Exception e) { Trace.WriteLine(e); return(null); } }