public D_EmployeeForm(BaseDAO <Employee> employeeDAO, Action <Employee> onOK, Employee employee = null)
        {
            InitializeComponent();

            EmployeeDAO = employeeDAO;
            OnOK        = onOK;

            cbGender.SelectedIndex = 0;
            cbType.SelectedIndex   = 0;

            if (employee != null)
            {
                txtId.Text            = employee.EntityId;
                txtName.Text          = employee.FullName;
                txtPhone.Text         = employee.PhoneNumber;
                cbGender.SelectedItem = employee.Gender;
                dtpBirthdate.Value    = employee.BirthDate;
                txtUsername.Text      = employee.Username;
                txtPassword.Text      = employee.Password;
                cbType.SelectedItem   = employee.Type;
            }
            else
            {
                txtId.Text = "NV" + (EmployeeDAO.Count() + 1);
            }
        }
 private void D_DirectSaleForm_Load(object sender, EventArgs e)
 {
     LoadMedicines();
     btnRemove.Enabled   = false;
     numQuantity.Minimum = 1;
     txtId.Text          = "HD" + (ReceiptDAO.Count() + 1);
     txtSum.Text         = 0.ToString();
 }
예제 #3
0
        public D_MedicineForm(BaseDAO <Medicine> medicineDAO,
                              Action <Medicine> onOK, Medicine medicine = null)
        {
            InitializeComponent();

            MedicineDAO = medicineDAO;
            OnOK        = onOK;

            if (medicine != null)
            {
                txtId.Text    = medicine.EntityId;
                txtName.Text  = medicine.Name;
                txtPrice.Text = medicine.SellPrice.ToString();
            }
            else
            {
                txtId.Text = "T" + (MedicineDAO.Count() + 1);
            }
        }
        public D_MedicineSupplierForm(BaseDAO <MedicineSupplier> supplierDAO,
                                      Action <MedicineSupplier> onOK, MedicineSupplier supplier = null)
        {
            InitializeComponent();

            SuppliderDAO = supplierDAO;
            OnOK         = onOK;

            if (supplier != null)
            {
                txtId.Text    = supplier.EntityId;
                txtName.Text  = supplier.Name;
                txtPhone.Text = supplier.PhoneNumber;
            }
            else
            {
                txtId.Text = "NCC" + (SuppliderDAO.Count() + 1);
            }
        }
예제 #5
0
        public D_PatientForm(BaseDAO <Patient> patientDAO, Action <Patient> onOK, Patient patient = null)
        {
            InitializeComponent();

            PatientDAO = patientDAO;
            OnOK       = onOK;

            if (patient != null)
            {
                txtId.Text            = patient.EntityId;
                txtName.Text          = patient.FullName;
                txtPhone.Text         = patient.PhoneNumber;
                cbGender.SelectedItem = patient.Gender;
                dtpBirthdate.Value    = patient.BirthDate;
            }
            else
            {
                txtId.Text             = "BN" + (PatientDAO.Count() + 1);
                cbGender.SelectedIndex = 0;
            }
        }
        public D_PrescriptionForm(Employee employee, Patient patient, Action <PatientPrescription> onOK,
                                  PatientPrescription prescription = null)
        {
            InitializeComponent();

            Employee = employee;
            Patient  = patient;
            OnOK     = onOK;

            if (prescription == null)
            {
                txtPrescriptionId.Text = "DT" + (PrescriptionDAO.Count() + 1);
            }
            else
            {
                txtPrescriptionId.Text    = prescription.EntityId;
                txtPrescriptionId.Enabled = false;
                detailGroup.Visible       = false;
                txtDiesease.Text          = prescription.DiseaseName;
                details = PrescriptionDetailDAO.Select(pd => pd.PatientPrescriptionId == prescription.EntityId);
                LoadDetails();
            }
        }
        private void BtnOK_Click(object sender, EventArgs e)
        {
            if (cbSupplier.SelectedItem == null)
            {
                return;
            }

            // TODO: Validate
            Close();
            OnOK(new MedicineDetail()
            {
                Id                 = MedDetail != null ? MedDetail.EntityId : "CTT" + (MedDetailDAO.Count() + 1),
                Quantity           = (int)numQuantity.Value,
                UnitPrice          = float.Parse(txtPrice.Text),
                AddedDate          = dtpAddedDate.Value,
                ExpirationDate     = dtpExpiredDate.Value,
                MedicineId         = MedDetail != null ? MedDetail.MedicineId : Medicine.EntityId,
                MedicineSupplierId = SupplierDAO.Select(s => s.Name == cbSupplier.SelectedItem.ToString())[0].EntityId
            });
        }
 private void D_SaleWithPrescriptionForm_Load(object sender, EventArgs e)
 {
     txtId.Text  = "HD" + (ReceiptDAO.Count() + 1);
     txtSum.Text = 0.ToString();
     LoadDetails();
 }