private void btnInsertRequest_Click(object sender, RoutedEventArgs e) { StartLoad(); string typeId = (reqTypeId.SelectedIndex + 1).ToString(); string autorId = reqAutorId.Text.Trim(); string addDate = Convert.ToDateTime(reqAddDate.Text).ToString("yyyy-MM-dd"); string state = reqState.Text.Replace("True", "1").Replace("False", "0"); reqAutorId.Text = string.Empty; reqAddDate.Text = string.Empty; StopLoad(); if (ManageEdfDAO.InsertRequest(typeId, autorId, addDate, state)) { SetMessageInfo("Row successfully inserted!", MessageType.Success); } }
private void btnInsertNotification_Click(object sender, RoutedEventArgs e) { StartLoad(); string userId = notificationAutorId.Text.Trim(); string dateAdd = (string.IsNullOrEmpty(notificationAddDate.Text)) ? DateTime.Now.ToLongDateString() : Convert.ToDateTime(notificationAddDate.Text).ToString("yyyy-MM-dd"); string visited = notificationVisited.Text.Replace("True", "1").Replace("False", "0"); string visitUrl = notificationVisitUrl.Text.Trim(); string message = notificationMessage.Text.Trim(); string avatar = notificationAvatar.Text.Trim(); string typeId = (notificationTypeId.SelectedIndex + 1).ToString(); //notificationAutorId.Text = string.Empty; //notificationAddDate.Text = string.Empty; //notificationVisitUrl.Text = string.Empty; //notificationMessage.Text = string.Empty; //notificationAvatar.Text = string.Empty; StopLoad(); if (ManageEdfDAO.InsertNotification(userId, dateAdd, visited, visitUrl, message, avatar, typeId)) { SetMessageInfo("Row successfully inserted!", MessageType.Success); } }
private void btnInsertAppRequest_Click(object sender, RoutedEventArgs e) { StartLoad(); string autorId = appReqAutorId.Text.Trim(); string requestId = appReqId.Text.Trim(); string state = appReqState.Text.Replace("True", "1").Replace("False", "0"); string addDate = (string.IsNullOrEmpty(appReqAddDate.Text)) ? DateTime.Now.ToLongDateString() : Convert.ToDateTime(appReqAddDate.Text).ToString("yyyy-MM-dd"); string approveDate = (string.IsNullOrEmpty(appReqApproveDate.Text)) ? "" : Convert.ToDateTime(appReqApproveDate.Text).ToString("yyyy-MM-dd"); string replaceId = appReqRepId.Text.Trim(); string status = appReqStatus.Text.Trim(); appReqAutorId.Text = string.Empty; appReqId.Text = string.Empty; appReqAddDate.Text = string.Empty; appReqApproveDate.Text = string.Empty; appReqRepId.Text = string.Empty; appReqStatus.Text = string.Empty; StopLoad(); if (ManageEdfDAO.InsertAppReq(autorId, requestId, state, addDate, approveDate, replaceId, status)) { SetMessageInfo("Row successfully inserted!", MessageType.Success); } }