2024-01-31 12:05:11 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2024-02-14 20:05:13 -05:00
|
|
|
|
using Microsoft.VisualBasic;
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
2024-01-31 12:05:11 -05:00
|
|
|
|
namespace Louis__Pharmacy_CNSA212_FP
|
|
|
|
|
{
|
2024-01-31 12:45:33 -05:00
|
|
|
|
public partial class frmRefill : Form
|
2024-01-31 12:05:11 -05:00
|
|
|
|
{
|
2024-02-17 00:22:25 -05:00
|
|
|
|
public DataSet ds = new DataSet();
|
|
|
|
|
|
2024-01-31 12:45:33 -05:00
|
|
|
|
public frmRefill()
|
2024-01-31 12:05:11 -05:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2024-02-07 16:53:41 -05:00
|
|
|
|
|
|
|
|
|
private void rEFILLSBindingNavigatorSaveItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void frmRefill_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2024-02-16 12:41:14 -05:00
|
|
|
|
dgvRefills.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnSearch_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string patientID = "";
|
|
|
|
|
DateTime date = new DateTime();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2024-02-20 01:24:59 -05:00
|
|
|
|
DataSet ds = new DataSet();
|
2024-02-16 12:41:14 -05:00
|
|
|
|
//PharmacyDataTier phaDT = new PharmacyDataTier();
|
|
|
|
|
|
|
|
|
|
patientID = txtPatientID.Text.Trim();
|
|
|
|
|
if (txtDate.Text.Trim().Length > 0)
|
|
|
|
|
{
|
|
|
|
|
date = DateTime.Parse(txtDate.Text.Trim());
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-20 01:24:59 -05:00
|
|
|
|
ds = PharmacyDataTier.RefillSearch(date, patientID);
|
2024-02-16 12:41:14 -05:00
|
|
|
|
|
|
|
|
|
if (ds.Tables[0].Rows.Count > 0 )
|
|
|
|
|
{
|
|
|
|
|
dgvRefills.Visible = true;
|
|
|
|
|
|
|
|
|
|
dgvRefills.DataSource = ds.Tables[0];
|
|
|
|
|
dgvRefills.AlternatingRowsDefaultCellStyle.BackColor = Color.Black;
|
|
|
|
|
dgvRefills.AlternatingRowsDefaultCellStyle.ForeColor = Color.White;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dgvRefills.Visible = false;
|
|
|
|
|
MessageBox.Show("No records found");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2024-02-07 16:53:41 -05:00
|
|
|
|
}
|
2024-02-17 00:22:25 -05:00
|
|
|
|
|
|
|
|
|
private void cmuAdd_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
frmRefillAdd refillAdd = new frmRefillAdd(true);
|
|
|
|
|
refillAdd.MdiParent = MdiParent;
|
|
|
|
|
refillAdd.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
refillAdd.Show();
|
|
|
|
|
refillAdd.Focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmuUpdate_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string refillID = "";
|
|
|
|
|
|
2024-02-19 12:24:56 -05:00
|
|
|
|
if (dgvRefills.Rows.Count > 0)
|
|
|
|
|
{
|
2024-02-20 14:57:03 -05:00
|
|
|
|
//dgvRefills.DataSource = ds.Tables[0];
|
2024-02-19 12:24:56 -05:00
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvRefills.SelectedRows[0];
|
|
|
|
|
refillID = (row.Cells[0].Value).ToString();
|
|
|
|
|
|
|
|
|
|
frmRefillAdd refillUpdate = new frmRefillAdd(false);
|
|
|
|
|
refillUpdate.MdiParent = MdiParent;
|
|
|
|
|
refillUpdate.StartPosition = FormStartPosition.CenterScreen;
|
|
|
|
|
refillUpdate.Show();
|
|
|
|
|
refillUpdate.Focus();
|
|
|
|
|
refillUpdate.FillRefill(refillID);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cmuDelete_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
string refillID = "";
|
|
|
|
|
|
2024-02-20 01:24:59 -05:00
|
|
|
|
//dgvRefills.DataSource = ds.Tables[0];
|
2024-02-17 00:22:25 -05:00
|
|
|
|
DataGridViewRow row = new DataGridViewRow();
|
|
|
|
|
row = dgvRefills.SelectedRows[0];
|
|
|
|
|
refillID = (row.Cells[0].Value).ToString();
|
2024-02-19 12:24:56 -05:00
|
|
|
|
PharmacyDataTier.DeleteRefill(refillID);
|
|
|
|
|
btnSearch_Click(sender, e);
|
2024-02-17 00:22:25 -05:00
|
|
|
|
}
|
2024-01-31 12:05:11 -05:00
|
|
|
|
}
|
|
|
|
|
}
|