Beispiel #1
0
 private void ClearContents()
 {
     File.WriteAllText(dataLocation, "");
     LstVewPrograms.Items.Clear();
     TxtNameInput.Clear();
     TxtFileInput.Clear();
     TxtFileNameInput.Clear();
     TxtLocationInput.Clear();
     TxtParametersInput.Clear();
     TxtSize.Clear();
 }
Beispiel #2
0
 public void AddNewItem()
 {
     if (!string.IsNullOrEmpty(TxtSKUNum.Text.Trim()))
     {
         cloth.SKUNumber = TxtSKUNum.Text.Trim();
         if (!string.IsNullOrEmpty(TxtColor.Text.Trim()))
         {
             cloth.Color = TxtColor.Text.Trim();
             if (!string.IsNullOrEmpty(TxtSize.Text.Trim()))
             {
                 cloth.Size = TxtSize.Text.Trim();
                 if (!string.IsNullOrEmpty(TxtName.Text.Trim()))
                 {
                     cloth.Name = TxtName.Text.Trim();
                     int Result = dal.AddNewCloth(cloth);
                     if (Result > 0)
                     {
                         MessageBox.Show("New Item Added Successfully");
                         LoadDGV();
                         HideTextBoxes();
                     }
                     else
                     {
                         MessageBox.Show("Something went Wrong");
                     }
                 }
                 else
                 {
                     MessageBox.Show("Product Name cannot be empty");
                     TxtName.Focus();
                 }
             }
             else
             {
                 MessageBox.Show("Size cannot be empty");
                 TxtSize.Focus();
             }
         }
         else
         {
             MessageBox.Show("Color cannot be empty");
             TxtColor.Focus();
         }
     }
     else
     {
         MessageBox.Show("SKU Number cannot be empty");
         TxtSKUNum.Focus();
     }
 }
Beispiel #3
0
    public static Vector2 GetLabelSpaceing(TxtSize varSize)
    {
        Vector2 tempSpace = Vector2.zero;

        if (mFontsSpace == null)
        {
            mFontsSpace = new Dictionary <TxtSize, Vector2> ();
            mFontsSpace.Add(TxtSize.size14, new Vector2(0.0f, 4.0f));
            mFontsSpace.Add(TxtSize.size16, new Vector2(1.0f, 4.0f));
            mFontsSpace.Add(TxtSize.size18, new Vector2(1.0f, 5.0f));
            mFontsSpace.Add(TxtSize.size22, new Vector2(1.0f, 5.0f));
            mFontsSpace.Add(TxtSize.size26, new Vector2(0.0f, 6.0f));
            mFontsSpace.Add(TxtSize.size35, new Vector2(0.0f, 6.0f));
            mFontsSpace.Add(TxtSize.size50, new Vector2(1.0f, 10.0f));
        }
        if (mFontsSpace != null)
        {
            if (mFontsSpace.TryGetValue(varSize, out tempSpace))
            {
                return(tempSpace);
            }
        }
        return(tempSpace);
    }