예제 #1
0
        private void OpenEachFormat()
        {
            frmEachFormatPicker frme = new frmEachFormatPicker("", true);

            if (frme.ShowDialog() == DialogResult.OK)
            {
                string  selectedeachformatname = "";
                string  foodtypename           = "";
                decimal eachquantity           = 0;
                decimal wtmultiplier           = 0;
                int     unitswtid   = 0;
                int     order       = 0;
                string  description = "";
                string  foodtypeid  = "";
                VWA4Common.GlobalSettings.GetEachFormatDataFromID(int.Parse(frme.EachFormatID),
                                                                  out selectedeachformatname, out eachquantity, out wtmultiplier, out unitswtid,
                                                                  out order, out description, out foodtypeid);
                txtEachName.Text      = selectedeachformatname;
                lFoodEach_TypeID.Text = foodtypeid;
                if (VWA4Common.GlobalSettings.GetTypeNameFromTypeID(
                        "food", foodtypeid, out foodtypename))
                {
                    lFoodEach_TypeName.Text = foodtypename;
                }
                ceWtMultiplier.Value = wtmultiplier;
                ceEachQuantity.Value = eachquantity;
                txtDescription.Text  = description;
                SetIndexforWtUnitsComboBox(unitswtid);
                bSave.Enabled = false;
            }
        }
예제 #2
0
 /// <summary>
 /// Choose Items type from Each tab.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ChooseItem_Each_Click(object sender, EventArgs e)
 {
     if ((selectedfoodtypeid != "") && (selectedfoodtypeid != null))
     {
         frmEachFormatPicker fp = new frmEachFormatPicker(selectedfoodtypeid);
         if (fp.ShowDialog() == DialogResult.OK)
         {
             selectedeachformatid = int.Parse(VWA4Common.GlobalSettings.frmEachFormats_FormatIDSelected);
             // An Each Format was picked - get the name
             selectedeachformatname = "";
             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;
             checkQuantityReady();
             return;
         }
     }
     else
     {
         MessageBox.Show("You must select a Food Type before you can select an Item Type!");
     }
 }