private void DataGrid_RequestView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DataGrid_RequestView.SelectedItem == null)
            {
                return;
            }
            var selectedDetails = DataGrid_RequestView.SelectedItem as Requestor;

            RequestorNo     = selectedDetails.RequestorNo;
            NameOfRequestor = selectedDetails.IdOfRequestor;
            IdOfRequestor   = selectedDetails.IdOfRequestor;
            Department      = selectedDetails.Department;
            ItemCode        = selectedDetails.ItemCode;
            ItemDescription = selectedDetails.ItemDescription;
            Quantity        = selectedDetails.Quantity;
            Unit            = selectedDetails.Unit;
            DateIssued      = selectedDetails.DateIssued;
            Time            = selectedDetails.Time;

            status = ReqStatus.select;
        }
        private void Button_Delete_Click(object sender, RoutedEventArgs e)
        {
            if (status == ReqStatus.select)
            {
                database_connection dc = new database_connection();
                string query;
                query = $@"Delete From RequestorVieww
where RequestorNo='{RequestorNo } '";
                dc.Connection2(query);

                Loading_User.Visibility = Visibility.Visible;
                Icon.Kind = MahApps.Metro.IconPacks.PackIconMaterialKind.DeleteRestore;
                TextBlock_Message.Text = "Deleted Records".ToUpper();
                status = ReqStatus.delete;
                refresh();
            }
            else
            {
                Loading_User.Visibility = Visibility.Visible;
                Icon.Kind = MahApps.Metro.IconPacks.PackIconMaterialKind.Message;
                TextBlock_Message.Text = "Please Click the Records you want to delete".ToUpper();
            }
        }
 private void Button_Refresh_Click(object sender, RoutedEventArgs e)
 {
     status = ReqStatus.refresh;
     refresh();
 }
Esempio n. 4
0
        public void updateStatus(string requisitionId, ReqStatus status)
        {
            Requisition requisition = findRequisition(requisitionId);

            requisition.status = status;
        }