Exemplo n.º 1
0
 private void add750Values()
 {
     try
     {
         f35.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(txtbox6.Text) + removeUSd(txtbox7.Text) + removeUSd(txtbox8.Text) + removeUSd(txtbox9.Text), 2)));
         f36.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(b36.Text) + removeUSd(c36.Text) + removeUSd(d36.Text) + removeUSd(e36.Text), 2)));
         double value = Math.Round(TrimLastCharacter(b37.Text) + TrimLastCharacter(c37.Text) + TrimLastCharacter(d37.Text) + TrimLastCharacter(e37.Text), 2);
         double multvalue = value / 4;
         f37.Text = Convert.ToString(multvalue) + '%';
     }
     catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
 }
Exemplo n.º 2
0
        protected void txtbox12_TextChanged(object sender, EventArgs e)
        {
            try
            {
                //=IF(C42>D20,
                //((C42-D20)*E21)
                //    +((D20-D19)*E20)
                //    +(D19*E19),
                //IF(C42>D19,
                //    ((C42-D19)*E20)
                //    +(D19*E19),C42*E19))
                if (Convert.ToDouble(removeUSd(txtbox12.Text)) > Convert.ToDouble(removeUSd(d20.Text)))
                {
                    c43.Text = string.Format("USD {0}", Convert.ToString(Math.Round(((((Convert.ToDouble(removeUSd(txtbox12.Text)) - Convert.ToDouble(removeUSd(d20.Text))) * TrimLastCharacter(e21.Text)) / 100)
                                        + (((Convert.ToDouble(removeUSd(d20.Text)) - Convert.ToDouble(removeUSd(d19.Text))) * TrimLastCharacter(e20.Text)) / 100)
                                        + ((Convert.ToDouble(removeUSd(d19.Text)) * Convert.ToDouble(TrimLastCharacter(e19.Text))) / 100)))));

                    c44.Text = Convert.ToString(Math.Round(((removeUSd(b43.Text) / removeUSd(txtbox12.Text)) * 100), 2)) + '%';
                }
                else
                {
                    if (Convert.ToDouble(removeUSd(txtbox12.Text)) > Convert.ToDouble(removeUSd(d19.Text)))
                    {
                        c43.Text = string.Format("USD {0}", Convert.ToString(
                            (((Convert.ToDouble(removeUSd(txtbox12.Text)) - Convert.ToDouble(removeUSd(d19.Text))) * TrimLastCharacter(e20.Text)) / 100)
                            + ((Convert.ToDouble(removeUSd(d19.Text)) * TrimLastCharacter(e19.Text)) / 100)
                            ));
                    }
                    else
                    { c43.Text = Convert.ToString((Convert.ToDouble(removeUSd(txtbox12.Text)) * TrimLastCharacter(e19.Text)) / 100); }
                    c44.Text = Convert.ToString(Math.Round(((removeUSd(c43.Text) / removeUSd(txtbox12.Text)) * 100), 2)) + '%';
                }
                txtbox12.Text = (txtbox12.Text.Contains("USD") || txtbox12.Text.Contains("usd")) ? txtbox12.Text : "USD " + txtbox12.Text;
                add500Values();
                add750Values();
                add1500Values();
            }
            catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
        }
Exemplo n.º 3
0
 private void add500Values()
 {
     try
     {
         f28.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(txtbox1.Text) + removeUSd(txtbox2.Text) + removeUSd(txtbox3.Text) + removeUSd(txtbox4.Text))));
         f29.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(b29.Text) + removeUSd(c29.Text) + removeUSd(d29.Text) + removeUSd(e29.Text))));
         double value = Math.Round(TrimLastCharacter(b30.Text) + TrimLastCharacter(c30.Text) + TrimLastCharacter(d30.Text) + TrimLastCharacter(e30.Text));
         double multvalue = value / 4;
         f30.Text = Convert.ToString(multvalue) + '%';
     }
     catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
 }
Exemplo n.º 4
0
 private void add1500Values()
 {
     try
     {
         f42.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(txtbox11.Text) + removeUSd(txtbox12.Text) + removeUSd(txtbox13.Text) + removeUSd(txtbox14.Text))));
         f43.Text = string.Format("USD {0}", Convert.ToString(Math.Round(removeUSd(b43.Text) + removeUSd(c43.Text) + removeUSd(d43.Text) + removeUSd(e43.Text))));
         double value = Math.Round(TrimLastCharacter(b44.Text) + TrimLastCharacter(c44.Text) + TrimLastCharacter(d44.Text) + TrimLastCharacter(e44.Text));
         double multvalue = value / 4;
         f44.Text = Convert.ToString(multvalue) + '%';
     }
     catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
 }
Exemplo n.º 5
0
        protected void txtbox9_TextChanged(object sender, EventArgs e)
        {
            try
            {
                //=IF(E35>D13,
                //((E35-D13)*E14)
                //    +((D13-D12)*E13)
                //    +(D12*E12),
                //IF(E35>D12,
                //    ((E35-D12)*E13)
                //    +(D12*E12),E35*E12))
                if (Convert.ToDouble(removeUSd(txtbox9.Text)) > Convert.ToDouble(removeUSd(d13.Text)))
                {
                    e36.Text = string.Format("USD {0}", Convert.ToString(Math.Round(((((Convert.ToDouble(removeUSd(txtbox9.Text)) - Convert.ToDouble(removeUSd(d13.Text))) * TrimLastCharacter(e14.Text)) / 100)
                      + (((Convert.ToDouble(removeUSd(d13.Text)) - Convert.ToDouble(removeUSd(d12.Text))) * TrimLastCharacter(e13.Text)) / 100)
                      + ((Convert.ToDouble(removeUSd(d12.Text)) * Convert.ToDouble(TrimLastCharacter(e12.Text))) / 100)))));

                    e37.Text = Convert.ToString(Math.Round(((removeUSd(e36.Text) / removeUSd(txtbox9.Text)) * 100), 2)) + '%';
                }
                else
                {
                    if (Convert.ToDouble(removeUSd(txtbox9.Text)) > Convert.ToDouble(removeUSd(d12.Text)))
                    {
                        e36.Text = string.Format("USD {0}", Convert.ToString(
                            (((Convert.ToDouble(removeUSd(txtbox9.Text)) - Convert.ToDouble(removeUSd(d12.Text))) * TrimLastCharacter(e13.Text)) / 100)
                            + ((Convert.ToDouble(removeUSd(d12.Text)) * TrimLastCharacter(e12.Text)) / 100)));
                    }
                    else
                    { e36.Text = string.Format("USD {0}", Convert.ToString((Convert.ToDouble(removeUSd(txtbox9.Text)) * TrimLastCharacter(e12.Text)) / 100)); }
                    e37.Text = Convert.ToString(Math.Round(((removeUSd(e36.Text) / removeUSd(txtbox9.Text)) * 100), 2)) + '%';
                }
                txtbox9.Text = (txtbox9.Text.Contains("USD") || txtbox9.Text.Contains("usd")) ? txtbox9.Text : "USD " + txtbox9.Text;
                add500Values();
                add750Values();
                add1500Values();
            }
            catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
        }
Exemplo n.º 6
0
        protected void txtbox4_TextChanged(object sender, EventArgs e)
        {
            try
            {
                //=IF(E28>D6,
                //((E28-D6)*E7)
                //    +((D6-D5)*E6)
                //    +(D5*E5),
                //IF(E28>D5,
                //    ((E28-D5)*E6)+(D5*E5),E28*E5))
                //        +IF(AND(C28>D5,D28>D5,E28>D5)
                //        ,D5*E8,0)
                double value = 0;
                if (removeUSd(txtbox4.Text) > removeUSd(d6.Text))
                {
                    value = Math.Round(((((Convert.ToDouble(removeUSd(txtbox4.Text)) - Convert.ToDouble(removeUSd(d6.Text))) * TrimLastCharacter(e7.Text)) / 100)
                                  + (((Convert.ToDouble(removeUSd(d6.Text)) - Convert.ToDouble(removeUSd(d5.Text))) * TrimLastCharacter(e6.Text)) / 100)
                                  + ((Convert.ToDouble(removeUSd(d5.Text)) * Convert.ToDouble(TrimLastCharacter(e5.Text))) / 100)));
                }
                else
                {
                    if (removeUSd(txtbox4.Text) > removeUSd(d5.Text))
                    {
                        value = (((removeUSd(txtbox4.Text) - removeUSd(d5.Text)) * TrimLastCharacter(e6.Text)) / 100)
                            + ((removeUSd(d5.Text) * TrimLastCharacter(e5.Text)) / 100);
                    }
                    else
                    { value = (removeUSd(txtbox4.Text) * TrimLastCharacter(e5.Text) / 100); }
                }
                if (removeUSd(txtbox2.Text) > removeUSd(d5.Text)
                    && (removeUSd(txtbox3.Text) > removeUSd(d5.Text))
                    && (removeUSd(txtbox4.Text) > removeUSd(d5.Text)))

                { value += (removeUSd(d5.Text) * TrimLastCharacter(e8.Text)) / 100; }
                else
                {
                    value += 0;
                }
                e29.Text = string.Format("USD {0}", Convert.ToString(Math.Round(value)));
                e30.Text = Convert.ToString(Math.Round(((removeUSd(e29.Text) / removeUSd(txtbox4.Text)) * 100), 2)) + '%';
                txtbox4.Text = (txtbox4.Text.Contains("USD") || txtbox4.Text.Contains("usd")) ? txtbox4.Text : "USD " + txtbox4.Text;
                add500Values();
                add750Values();
                add1500Values();
            }
            catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
        }
Exemplo n.º 7
0
 protected void txtbox2_TextChanged(object sender, EventArgs e)
 {
     try
     {
         //=IF(C28>D6,
         //((C28-D6)*E7)
         //    +((D6-D5)*E6)
         //    +(D5*E5),
         //IF(C28>D5,
         //    ((C28-D5)*E6)
         //    +(D5*E5),C28*E5))
         if (Convert.ToDouble(removeUSd(txtbox2.Text)) > Convert.ToDouble(removeUSd(d6.Text)))
         {
             c29.Text = string.Format("USD {0}", Convert.ToString(Math.Round(((((Convert.ToDouble(removeUSd(txtbox2.Text)) - Convert.ToDouble(removeUSd(d6.Text))) * TrimLastCharacter(e7.Text)) / 100)
                 + (((Convert.ToDouble(removeUSd(d6.Text)) - Convert.ToDouble(removeUSd(d5.Text))) * TrimLastCharacter(e6.Text)) / 100)
                 + ((Convert.ToDouble(removeUSd(d5.Text)) * Convert.ToDouble(TrimLastCharacter(e5.Text))) / 100)))));
             c30.Text = Convert.ToString(Math.Round(((removeUSd(c29.Text) / removeUSd(txtbox2.Text)) * 100), 2)) + '%';
         }
         else
         {
             if (removeUSd(txtbox2.Text) > removeUSd(d5.Text))
             {
                 c29.Text = string.Format("USD {0}", Convert.ToString(Math.Round(
                     (((removeUSd(txtbox2.Text) - removeUSd(d5.Text)) * TrimLastCharacter(e6.Text)) / 100)
                     + ((removeUSd(d5.Text) * TrimLastCharacter(e5.Text)) / 100)
                     , 2)));
             }
             else
             { c29.Text = string.Format("USD {0}", Convert.ToString((removeUSd(txtbox2.Text) * TrimLastCharacter(e5.Text)) / 100)); }
             c30.Text = Convert.ToString(Math.Round(((removeUSd(c29.Text) / removeUSd(txtbox2.Text)) * 100), 2)) + '%';
         }
         txtbox2.Text = (txtbox2.Text.Contains("USD") || txtbox2.Text.Contains("usd")) ? txtbox2.Text : "USD " + txtbox2.Text;
         add500Values();
         add750Values();
         add1500Values();
     }
     catch (Exception ex) { CreateLogFile Err = new CreateLogFile(); Err.ErrorLog(Server.MapPath(filePath), ex.Message, ex.StackTrace); }
 }