Beispiel #1
0
        /// <summary>
        /// Choose Food Type from Each tab.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChooseFood_Each_Click(object sender, EventArgs e)
        {
            frmTypePicker tp = new frmTypePicker(VWA4Common.GlobalSettings.SessionTracker_TermID, "food");

            if (tp.ShowDialog() == DialogResult.OK)
            {
                selectedfoodtypeid = tp.TypeIDSelected;
                /// Set a pack type as default for chosen food type
                if (VWA4Common.GlobalSettings.GetEachFormatDefault(selectedfoodtypeid, out selectedeachformatid,
                                                                   out selectedeachformatname))
                {
                    // An Each Format was picked - get the name
                    decimal eachquantity = 0;
                    decimal wtmultiplier = 0;
                    int     unitswtid    = 0;
                    int     order        = 0;
                    string  description  = "";
                    // Get Item name from Item ID
                    VWA4Common.GlobalSettings.GetEachFormatDataFromID(
                        selectedeachformatid, out selectedeachformatname, out eachquantity,
                        out wtmultiplier, out unitswtid, out order, out description);
                    lItemEach_TypeName.Text = selectedeachformatname;
                    lFoodEach_TypeName.Text = tp.TypeNameSelected;
                    VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = true;
                }
                else
                {
                    MessageBox.Show("No Each Formats defined for " + tp.TypeNameSelected);
                    selectedfoodtypeid      = "";
                    selectedeachformatname  = "";
                    selectedeachformatid    = 0;
                    lItemEach_TypeName.Text = "";
                    VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = false;
                }

                checkQuantityReady();
                return;
            }
            else
            {
                VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = false;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Choose container type from Volume tab.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChooseContainer_Vol_Click(object sender, EventArgs e)
        {
            decimal       volume         = 0;
            int           volumeunittype = 0;
            frmTypePicker tp             = new frmTypePicker(VWA4Common.GlobalSettings.SessionTracker_TermID, "container");

            if (tp.ShowDialog() == DialogResult.OK)
            {
                /// Note that the return values are in Global Settings - indicate to caller
                if (VWA4Common.GlobalSettings.GetContainerVolumeData(tp.TypeIDSelected,
                                                                     out volume, out volumeunittype))
                {                 // Container Type Has volume data
                    lCurrContainerType.Text = tp.TypeNameSelected;
                    selectedcontainertypeid =
                        tp.TypeIDSelected;
                    VWA4Common.GlobalSettings.frmUnits_ContainerTypeID      = selectedcontainertypeid;
                    VWA4Common.GlobalSettings.frmUnits_ContainerTypeUpdated = true;

                    //sContainerTypeName = VWA4Common.GlobalSettings.frmTypePicker_TypeNameSelected;
                    //sContainerTypeCost = VWA4Common.GlobalSettings.frmTypePicker_ContainerTypeCostSelected;
                    //sSingleContainerWt = VWA4Common.GlobalSettings.frmTypePicker_ContainerWtSelected;
                    //lCurrContainerType.Text = sContainerTypeName;
                    //decimal dSingleContainerWt = decimal.Parse(sSingleContainerWt);
                    //sTotalTareWt = (dSingleContainerWt * nItems_CurrTrans).ToString();
                    checkQuantityReady();
                    return;
                }
                else
                {                 // Container Type doesn't have volume data
                    MessageBox.Show("Selected Container Type has no volume data configured for it!");
                    VWA4Common.GlobalSettings.frmUnits_ContainerTypeUpdated = false;
                    lCurrContainerType.Text = "";
                    bDone.Hide();
                }
            }
            else
            {
                VWA4Common.GlobalSettings.frmUnits_ContainerTypeUpdated = false;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Choose Food type from volume tab.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChooseFood_Vol_Click(object sender, EventArgs e)
        {
            decimal       volumeweight   = 0;
            decimal       volumeunits    = 0;
            int           volumeunittype = 0;
            frmTypePicker tp             = new frmTypePicker(VWA4Common.GlobalSettings.SessionTracker_TermID, "food");

            if (tp.ShowDialog() == DialogResult.OK)
            {
                /// Note that the return values are in Global Settings - indicate to caller
                if (VWA4Common.GlobalSettings.GetFoodVolumeData(tp.TypeIDSelected,
                                                                out volumeweight, out volumeunits, out volumeunittype))
                {                 // Food Type Has volume data
                    selectedfoodtypeid = tp.TypeIDSelected;
                    lCurrFoodType.Text = tp.TypeNameSelected;
                    VWA4Common.GlobalSettings.frmUnits_FoodTypeID        = selectedfoodtypeid;
                    VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = true;

                    //sFoodTypeID = VWA4Common.GlobalSettings.frmTypePicker_TypeIDSelected;
                    //sFoodTypeName = VWA4Common.GlobalSettings.frmTypePicker_TypeNameSelected;
                    //sFoodTypeCost = VWA4Common.GlobalSettings.frmTypePicker_FoodTypeCostSelected;
                    checkQuantityReady();
                    return;
                }
                else
                {                 // Food Type doesn't have volume data
                    MessageBox.Show("Selected Food Type has no volume data configured for it!");
                    VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = false;
                    lCurrFoodType.Text = "";
                    bDone.Hide();
                }
            }
            else
            {
                VWA4Common.GlobalSettings.frmUnits_FoodTypeIDUpdated = false;
            }
        }