private void shipmentMedsDetails_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            currentSelectedIndex = shipmentMedsDetails.CurrentCell.RowIndex;
            MedDetailsInShipment mds = (MedDetailsInShipment)MedDetailsInShipment.SHIPMENT_MEDS[currentSelectedIndex];

            parcodeTextBx.Text = mds.medicen.Parecode;
            showUpdateOrderPanel(true);
        }
        private void addMedOrderToSideList(MedDetailsInShipment mdis)
        {
            DataRow dataRow = table.NewRow();

            dataRow[colmMedName]    = mdis.medicen.MedName;
            dataRow[colmAmount]     = mdis.cmo.NumOfPackages.ToString();
            dataRow[colmTotalPrice] = mdis.cmo.TotalPrice.ToString();
            table.Rows.Add(dataRow);
        }
        private void showMedInfo(int inx)
        {
            MedDetailsInShipment mds = (MedDetailsInShipment)MedDetailsInShipment.SHIPMENT_MEDS[inx];

            med.Parecode              = parcodeTextBx.Text;
            med.IsNew                 = mds.medicen.IsNew;
            medicenTextBox.Text       = mds.medicen.MedName;
            ExpireDatePicker.Value    = mds.medicen.ExpiryDate;
            numberOfTapesEditBox.Text = mds.medicen.TabPerPackage.ToString();
            sellingPriceTextBx.Text   = (mds.medicen.TabPrice * mds.medicen.TabPerPackage).ToString();
            amoutTextBox.Text         = mds.cmo.NumOfPackages.ToString();
            buyingPriceEditBx.Text    = mds.cmo.PricePerUnit.ToString();
        }
        private void createShipment()
        {
            shipment = new Shipments();

            shipment.Company    = this.company;
            shipment.CompanyId  = this.company.CompanyID;
            shipment.PaidAmount = 0;
            shipment.DebtValue  = 0;
            shipment.OrderDate  = DateTime.Today;
            shipment.OrderMeds  = MedDetailsInShipment.SHIPMENT_MEDS;
            shipment.TotalPrice = getTotal();

            // reset the static medlist
            MedDetailsInShipment.RESET_SHIPMENT_MEDS();
            showData();
        }
        private void getMed()
        {
            med.MedName                 = medicenTextBox.Text;
            med.TabPerPackage           = int.Parse(numberOfTapesEditBox.Text);
            med.TabPrice                = double.Parse(sellingPriceTextBx.Text) / int.Parse(numberOfTapesEditBox.Text);
            med.AdditionalNumberOfTapes = int.Parse(numberOfTapesEditBox.Text) * Int32.Parse(amoutTextBox.Text);
            med.NumOfTabes             += med.AdditionalNumberOfTapes;
            med.ExpiryDate              = ExpireDatePicker.Value;


            cmo                = new CompaniesMedsOrder();
            cmo.Parcode        = parcodeTextBx.Text.ToString();
            cmo.NumOfPackages  = Int32.Parse(amoutTextBox.Text);
            cmo.PricePerUnit   = double.Parse(buyingPriceEditBx.Text);//buying Price
            med.TabBuyingPrice = cmo.PricePerUnit / med.TabPerPackage;
            cmo.TotalPrice     = cmo.PricePerUnit * cmo.NumOfPackages;
            MedDetailsInShipment mdis = new MedDetailsInShipment(med, cmo);

            addMedOrderToSideList(mdis);
            getAndDisplayTotal();
            med = new Medicine();
            cmo = new CompaniesMedsOrder();
        }