public void adicionar_num(Double number)
 {
     //?implementar mais codigos?
      //se o resultado for diferente de zero E não houver sinal operação aritmetica, concatenar esse valor ao número passado por parametro aqui
     this.textBox += number.ToString();
     this.lastOperation += number.ToString();
 }
Пример #2
0
 public override string ToString()
 {
     return(String.Format("({0}, {1})", new object[]
     {
         normal.ToString(),
         d.ToString()
     }));
 }
Пример #3
0
 public override string ToString()
 {
     return(String.Format("({0}, {1}, {2})", new object[]
     {
         x.ToString(),
         y.ToString(),
         z.ToString()
     }));
 }
Пример #4
0
 public static MutableString ToJson(Double self, GeneratorState state)
 {
     if (Double.IsInfinity(self) || Double.IsNaN(self)) {
         if (state != null && state.AllowNaN == false) {
             Helpers.ThrowGenerateException(String.Format("{0} not allowed in JSON", self));
         }
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
     else {
         return MutableString.CreateAscii(self.ToString(NumberFormatInfo.InvariantInfo));
     }
 }
Пример #5
0
 public Course(
     Int64 id, 
     String name, 
     String description, 
     Double units, 
     Boolean isLaboratory, 
     Boolean isServiceCourse,
     AvailabilityEnum availability)
 {
     this.id = id;
     this.name = name;
     this.description = description;
     this.units = units;
     this.isLaboratory = isLaboratory;
     this.isServiceCourse = isServiceCourse;
     this.availability = availability;
     SubItems[0].Text = name.ToString();
     SubItems.Add(description.ToString());
     SubItems.Add(units.ToString());
     SubItems.Add(isLaboratory ? "Yes" : "No");
     SubItems.Add(isServiceCourse ? "Yes" : "No");
     SubItems.Add(availability == AvailabilityEnum.EverySemester ? "Every Semester" :
                 availability == AvailabilityEnum.FirstSemesterOnly ? "1st Semester Only" :
                     "2nd Semester Only");
 }
Пример #6
0
 public static string FormatearNumero(this HtmlHelper html, Double _cifra)
 {
     NumberFormatInfo nfi = new CultureInfo("en-US", false ).NumberFormat;
     nfi.NumberDecimalSeparator = ",";
     nfi.NumberGroupSeparator = ".";
     return(_cifra.ToString( "N", nfi ) );
 }
Пример #7
0
        private string CreateUrl(
            String Query, 
            Double? Latitude = null, 
            Double? Longitude = null, 
            String Market = "", 
            String Adult = "Strict", 
            String WebFileType = "", 
            String ImageFilters = "Size:Medium", 
            String VideoFilters = "", 
            String VideoSortBy = "", 
            String NewsLocationOverride = "", 
            String NewsCategory = "", 
            String NewsSortBy = "")
        {
            string _Url = "https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/Image?$format=atom&";

            _Url += (string.IsNullOrWhiteSpace(Query)) ? string.Empty : string.Format("Query='{0}'&", System.Uri.EscapeDataString(Query));
            _Url += (string.IsNullOrWhiteSpace(Market)) ? string.Empty : string.Format("Market='{0}'&", System.Uri.EscapeDataString(Market));
            _Url += (string.IsNullOrWhiteSpace(Adult)) ? string.Empty : string.Format("Adult='{0}'&", System.Uri.EscapeDataString(Adult));
            _Url += (!Latitude.HasValue) ? string.Empty : string.Format("Latitude='{0}'&", System.Uri.EscapeDataString(Latitude.ToString()));
            _Url += (!Longitude.HasValue) ? string.Empty : string.Format("Longitude='{0}'&", System.Uri.EscapeDataString(Longitude.ToString()));
            _Url += (string.IsNullOrWhiteSpace(WebFileType)) ? string.Empty : string.Format("WebFileType='{0}'&", System.Uri.EscapeDataString(WebFileType));
            _Url += (string.IsNullOrWhiteSpace(ImageFilters)) ? string.Empty : string.Format("ImageFilters='{0}'&", System.Uri.EscapeDataString(ImageFilters));
            _Url += (string.IsNullOrWhiteSpace(VideoFilters)) ? string.Empty : string.Format("VideoFilters='{0}'&", System.Uri.EscapeDataString(VideoFilters));
            _Url += (string.IsNullOrWhiteSpace(VideoSortBy)) ? string.Empty : string.Format("VideoSortBy='{0}'&", System.Uri.EscapeDataString(VideoSortBy));
            _Url += (string.IsNullOrWhiteSpace(NewsLocationOverride)) ? string.Empty : string.Format("NewsLocationOverride='{0}'&", System.Uri.EscapeDataString(NewsLocationOverride));
            _Url += (string.IsNullOrWhiteSpace(NewsCategory)) ? string.Empty : string.Format("NewsCategory='{0}'&", System.Uri.EscapeDataString(NewsCategory));
            _Url += (string.IsNullOrWhiteSpace(NewsSortBy)) ? string.Empty : string.Format("NewsSortBy='{0}'&", System.Uri.EscapeDataString(NewsSortBy));
            _Url = _Url.TrimEnd('&');

            return _Url;
        }
Пример #8
0
        public override string ToString()
        {
            UnitType this_type = this.Type;

            switch (this_type)
            {
            case UnitType.Float:
                return(floatValue.ToString());

            case UnitType.Integer:
                return(integerValue.ToString());

            case UnitType.Char:
                return(charValue.ToString());

            case UnitType.Null:
                return("Null");

            case UnitType.Boolean:
                return(boolValue.ToString());

            default:
                return(heapUnitValue.ToString());
            }
        }
Пример #9
0
        private void timer1_Tick(object sender, System.EventArgs e)
        {
            if (id > 0)
            {
                if (System.String.Equals(system, "Fuzzy"))
                {
                    power = fuzzy();
                }
                fx = 52 + Math.Round((21.84 - Convert.ToDouble(distance)) / 0.0678, 2);
                cleanlastimage();
            }
            distance = Math.Round(sim1(), 2);
            angle    = sim2();

            this.timer1.Interval = 215 - Math.Abs(Convert.ToInt32(power));

            this.label1.Text = angle.ToString();
            this.label2.Text = Convert.ToString(distance);
            this.label3.Text = power.ToString();
            fx = 52 + Math.Round((21.84 - distance) / 0.0678, 2);

            if (System.String.Equals(system, "Manual") && ((fx <= 15) || (fx >= 460)))
            {
                this.BackgroundImage = System.Drawing.Image.FromFile(pathformbackground2);
                this.timer1.Enabled  = false;
                this.button2.Enabled = false;
                this.button3.Enabled = false;
                this.button6.Enabled = false;
            }

            drawnewimage();

            ++id;
        }
Пример #10
0
 public System.String ToJSON()
 {
     return "{"
            + "\"x\": " + x.ToString("F3") + ", "
            + "\"y\": " + y.ToString("F3") + ", "
            + "\"z\": " + z.ToString("F3") + "}";
 }
Пример #11
0
 private void WritePathCostToTextBox(Double cost)
 {
     Application.Current.Dispatcher.Invoke(new Action(() =>
         {
             Logger.WriteLogInfo(string.Format("Total path cost: {0}",cost)); 
             this.pathCostTextBox.Text = cost.ToString(CultureInfo.InvariantCulture); 
         }));
 }
Пример #12
0
 private void btnView_Click(object sender, EventArgs e)
 {
     Double t = Convert.ToDouble(lblTotalMark.Text);
     Double ot = Convert.ToDouble(lblObtainedTotal.Text);
     Percent = ot / t * 100;
     lblPercent.Text = Percent.ToString();
    
 }
Пример #13
0
 internal Boolean DrawTextBox(ref Double dblVar, GUIStyle style, params GUILayoutOption[] options)
 {
     String strRef = dblVar.ToString();
     DrawTextBox(ref strRef, style, options);
     Double dblOld = dblVar;
     dblVar = Convert.ToDouble(strRef);
     return false;
 }
Пример #14
0
        public void idleManage(object sender, EventArgs e, Form1 form)
        {
            if (form.isCurrentlySheetActive() || isInPause)
            {
                Double idle = this.tmrIdle_Tick(sender, e);

                int paramIdleTime = Properties.Settings.Default.idelTime;

                //900000 = 15 min
                if (idle >= (paramIdleTime * 60) && isInPause == false)
                {
                    isInPause = true;
                    form.setDebutMessage("in pause now");

                    //Save current sheet to restart it
                    this.lastSheet = ProjectRepository.getInstance().actualSheet;

                    //Stop current sheet
                    form.stopCurrentSheet(paramIdleTime);
                }

                if (isInPause)
                {
                    if (idle > currentIdleTime)
                    {
                        currentIdleTime = idle;
                        form.setDebutMessage("in pause: currentIdle = " + currentIdleTime.ToString());
                    }
                    else {
                        DateTime startActive = new DateTime();
                        startActive = DateTime.Today.Add(Properties.Settings.Default.activeTimeFrom);

                        DateTime stopActive = new DateTime();
                        stopActive = DateTime.Today.Add(Properties.Settings.Default.activeTimeTo);

                        currentIdleTime = 0;

                        if (DateTime.Now.CompareTo(startActive) >= 0 && DateTime.Now.CompareTo(stopActive) <= 0)
                        {

                            isInPause = false;
                            form.setDebutMessage("out of pause");
                            //Restart last sheet
                            Sheet actualSheet = new Sheet();
                            actualSheet.start = DateTime.Now;
                            actualSheet.job = lastSheet.job;
                            actualSheet.job.task = lastSheet.job.task;

                            form.startSheet(actualSheet);
                        }
                        else
                        {
                            isInPause = false;
                        }
                    }
                }
            }
        }
Пример #15
0
        public static String ConvertToDBString(Double? d, string val)
        {
            if (d != null)
            {
                val = d.ToString();
            }

            return ((val == null) ? "null" : val.Replace("'", "''"));
        }
Пример #16
0
        public Collectable(Game game, Location location, Double lifeTime, CollectableEntityType collectableEntityType)
            : base(game)
        {
            this.collectableEntityType = collectableEntityType;
            this.Location = location;
            this.IsCollected = false;
            this.LifeTime = lifeTime;

            Console.WriteLine("Collectable Spawned: " + lifeTime.ToString("F2"));
        }
Пример #17
0
        public FormDownloadUpdate(Main wmain, Uri url, Double nv, Double ov)
        {
            InitializeComponent();
            fmain = wmain;
            this.url = url;
            if (nv.ToString().Length > 3)
            {
                this.nv = nv.ToString().Replace(',', '.');
            }
            else
            {
                this.nv = nv.ToString().Replace(',', '.') + "0";
            }

            this.ov = ov;
            labelDownloaded.Text = "-- MB's / -- MB's";
            labelSpeed.Text = "-- kb/s";
            labelPerc.Text = "-- %";
        }
Пример #18
0
 private void btn_close_Click(object sender, EventArgs e)
 {
     if (txt_num.Text.Length > 0)
     {
         n = Convert.ToDouble(txt_num.Text);
         txt.Text = n.ToString();
     }
     this.Hide();
     txt_num.Text = "";
 }
Пример #19
0
 public HabitacionAlta(SQLConnector conec,Double id)
 {
     InitializeComponent();
     conexion = conec;
     txtHotel.Text = id.ToString();
     DataTable tiposHab = conexion.consulta("select Tipo_Hab_Desc from NENE_MALLOC.Tipo_Habitacion");
     foreach(DataRow dr in tiposHab.Rows){
         cBTipoHabitacion.Items.Add(dr["Tipo_Hab_Desc"].ToString());
     }
 }
Пример #20
0
        public frmContinuousEditor(String name, Double bl, Double tl, Double tr, Double br)
        {
            InitializeComponent();

            txtLinguistic.Text = name;
            txtBottomLeft.Text = bl.ToString();
            txtTopLeft.Text = tl.ToString();
            txtTopRight.Text = tr.ToString();
            txtBottomRight.Text = br.ToString();
        }
Пример #21
0
        private void button1_Click(object sender, EventArgs e)
        {
            c.Open();
            String str = @"SELECT SUM(Amount) FROM Expenses WHERE Date_Exp=@bb;";

            OleDbCommand comm2 = new OleDbCommand(str, c);
            comm2.Parameters.Add("@bb", OleDbType.Date).Value = System.DateTime.Today;
            bill = Convert.ToDouble(comm2.ExecuteScalar());
            label2.Text = bill.ToString()+"/-";
            c.Close();
        }
Пример #22
0
 public override string ToString()
 {
     if (type == typeof(Float))
     {
         return(Type.ToString() + " Float: " + floatValue.ToString() + " position: " + PositionData.ToString());
     }
     else
     {
         return(Type.ToString() + " Integer: " + integerValue.ToString() + " position: " + PositionData.ToString());
     }
 }
Пример #23
0
 private void GetTotal()
 {
     double total = 1;
     foreach (UMLFactor factor in _factors)
     {
         //CultureInfo ci = new CultureInfo("en-US");
         total *= factor.SelectedValue;
     }
     _total = Math.Round(total, 2);
     this.txtTotal.Text = _total.ToString();
 }
Пример #24
0
        public override void on_data_available(DDS.DataReader reader)
        {
            tbfDataReader tbf_reader =
                (tbfDataReader)reader;

            try {
                tbf_reader.take(
                    data_seq,
                    info_seq,
                    DDS.ResourceLimitsQosPolicy.LENGTH_UNLIMITED,
                    DDS.SampleStateKind.ANY_SAMPLE_STATE,
                    DDS.ViewStateKind.ANY_VIEW_STATE,
                    DDS.InstanceStateKind.ANY_INSTANCE_STATE);
            }
            catch (DDS.Retcode_NoData) {
                return;
            }
            catch (DDS.Exception e) {
                Console.WriteLine("take error {0}", e);
                return;
            }

            System.Int32 data_length = data_seq.length;
            for (int i = 0; i < data_length; ++i)
            {
                if (info_seq.get_at(i).valid_data)
                {
                    /* Here we get source timestamp of the sample using the
                     * sample info.
                     *
                     * info_seq[i].source_timestamp returns DDS_Time_t
                     * ({seconds,nanoseconds}). We convert nanoseconds to
                     * seconds to get the decimal part of the timestamp.
                     */
                    System.Double source_timestamp =
                        info_seq.get_at(i).source_timestamp.sec +
                        (info_seq.get_at(i).source_timestamp.nanosec /
                         Constant.NANOSECOND);

                    Console.WriteLine(source_timestamp.ToString("0.00000") +
                                      "\t" + data_seq.get_at(i).code + "\t\t" +
                                      data_seq.get_at(i).x);
                }
            }

            try {
                tbf_reader.return_loan(data_seq, info_seq);
            }
            catch (DDS.Exception e) {
                Console.WriteLine("return loan error {0}", e);
            }
        }
Пример #25
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            openFD.Title = "Escoja una factura válida";
            openFD.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            openFD.FileName = "";
            openFD.Filter = "JPEG Images|*.jpg|All Files|*.*";

            if (openFD.ShowDialog() != DialogResult.Cancel)
            {

                string objString = Microsoft.VisualBasic.Interaction.InputBox("Valor de Factura", "Ingrese valor total de Factura", "", 0, 0);
                double Num;
                bool esCorrecto = double.TryParse(objString, out Num);

                if (esCorrecto)
                {
                    selectedFileName = null;
                    foreach (string fileName in openFD.FileNames)
                    {
                        selectedFileName = fileName;
                        Image img = Image.FromFile(fileName);
                        img.Tag = fileName;
                        imageList1.Images.Add(Path.GetFileName(fileName), img);
                    }

                    lstImgFacturas.Clear();
                    lstImgFacturas.LargeImageList = imageList1;

                    for (int index = 0; index < imageList1.Images.Count; index++)
                    {
                        lstImgFacturas.Items.Add(
                            new ListViewItem()
                            {
                                ImageIndex = index
                            }
                        );
                    }

                    lstImgFacturas.Refresh();
                    txtMonto.Enabled = false;
                    lstImgFacturas.Enabled = true;

                    total += double.Parse(objString);
                    txtMonto.Text = total.ToString();

                }
                else
                {
                    MessageBox.Show("El total ingresado no es correcto");
                }
            }
        }
Пример #26
0
        static StackObject *ToString_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Double instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
 /// <summary>
 /// Convert value to parameter which understand monitis.com 
 /// </summary>
 /// <param name="value">Value to convert</param>
 /// <param name="timeStamp">Parameter timestamp</param>
 /// <param name="convert">Custom converter function</param>
 /// <param name="resultParameterName">Parameter name</param>
 /// <returns></returns>
 public static ResultParameter ConvertToMonitorResult(Double value, DateTime timeStamp,
                                                      Func<Double, String> convert, String resultParameterName)
 {
     String convertedValue = convert == null
                                 ? value.ToString()
                                 : convert(value);
     return new ResultParameter
     {
         Name = HttpUtility.UrlEncode(resultParameterName),
         Value = HttpUtility.UrlEncode(convertedValue),
         Timestamp = timeStamp
     };
 }
        static StackObject *ToString_17(ILIntepreter __intp, StackObject *__esp, List <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String format = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Double instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString(format);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Пример #29
0
 // конструктор
 public Settings(Double q, List<Area> areas, Int32 changesCount, 
                 Int32 limit, Area areaPointer, Int32 segCount, Boolean auto,
                 Boolean fullMesh, Boolean autoWeight, Boolean autoPortName)
 {
     InitializeComponent();
     cbArea.DataSource = areas;
     txtValue.Text = q.ToString();
     txtChangesCount.Text = changesCount.ToString();
     txtLimit.Text = limit.ToString();
     txtSegmentsCount.Text = segCount.ToString();
     rbtnAuto.Checked = auto;
     ckAutoWeight.Checked = autoWeight;
     ckFullMesh.Checked = fullMesh;
     if (areas.Contains(areaPointer) == true)
         cbArea.SelectedItem = areaPointer;
 }
        protected PayfirmaTransactionResponse ProcessTransaction(String type, PayfirmaCredentials credentials, Double amount, String transactionId, Boolean isTest)
        {
            PayfirmaTransactionResponse payfirmaResponse = new PayfirmaTransactionResponse();
            var webClient = new WebClient();

            NameValueCollection requestData = new NameValueCollection();
            requestData.Add("key", credentials.APIKey);
            requestData.Add("merchant_id", credentials.MerchantID);
            requestData.Add("amount", amount.ToString());
            requestData.Add("test_mode", isTest.ToString().ToLower());
            requestData.Add("do_not_store", "true");

            if (type.ToLower() != "refund" && type.ToLower() != "capture")
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction Type : " + type;
                return payfirmaResponse;
            }

            if (String.IsNullOrEmpty(transactionId))
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction ID";
                return payfirmaResponse;
            }

            String url = this.GetPayfirmaURL() + "/" + type.ToLower() + "/" + transactionId;

            try
            {
                var webResponseByte = webClient.UploadValues(url, "POST", requestData);
                var webResponse = Encoding.ASCII.GetString(webResponseByte);

                if (!String.IsNullOrEmpty(webResponse))
                {
                    payfirmaResponse = this.HandleTransacitonResponse(webResponse);
                }
                else
                {
                    payfirmaResponse.Error = "Payfirma unknown error";
                }
            }
            catch (Exception e)
            {
                payfirmaResponse.Error = "Payfirma Error: " + e.Message;
            }

            return payfirmaResponse;
        }
Пример #31
0
        // third task, average hops.
        public static void taskAvgHop()
        {
            Double dTotalTraffic = 0;
            Double dHopTraffic = 0;
            Console.WriteLine("From | To | Traffic | Hops");
            foreach (PathListEntry e in listPaths)
            {
                Console.WriteLine(e.printforTask3());
                // sum up all the hops
                dHopTraffic += e.m_listPath.Count * e.m_nTraffic;
                // sum up all the traffic
                dTotalTraffic += e.m_nTraffic;
            }

            m_dAvgHop = dHopTraffic / dTotalTraffic;
            Console.WriteLine(" Avg Hops = {0}", m_dAvgHop.ToString("f"));
        }
Пример #32
0
        protected PayfirmaTransactionResponse ProcessTransaction(String type, PayfirmaCredentials credentials, PayfirmaCreditCard cc, PayfirmaMetaData metaData, Double amount, Boolean isTest)
        {
            PayfirmaTransactionResponse payfirmaResponse = new PayfirmaTransactionResponse();
            var webClient = new WebClient();

            NameValueCollection requestData = new NameValueCollection();
            this.GenerateMetaData(metaData, requestData);
            requestData.Add("key", credentials.APIKey);
            requestData.Add("merchant_id", credentials.MerchantID);
            requestData.Add("amount", amount.ToString());
            requestData.Add("card_number", cc.Number);
            requestData.Add("card_expiry_month", cc.ExpMonth.ToString());
            requestData.Add("card_expiry_year", cc.ExpYear.ToString());
            requestData.Add("cvv2", cc.CVV2);
            if (isTest) { requestData.Add("test_mode", "true"); }

            requestData.Add("do_not_store", "true");

            if (type.ToLower() != "sale" && type.ToLower() != "authorize")
            {
                // Default to sale transaction type.
                type = "sale";
            }
            String url = this.GetPayfirmaURL() + "/" + type.ToLower(); ;

            try
            {
                var webResponseByte = webClient.UploadValues(url, "POST", requestData);
                var webResponse = Encoding.ASCII.GetString(webResponseByte);

                if (!String.IsNullOrEmpty(webResponse))
                {
                    payfirmaResponse = this.HandleTransacitonResponse(webResponse);
                }
                else
                {
                    payfirmaResponse.Error = "Payfirma unknown error";
                }
            }
            catch (Exception e)
            {
                payfirmaResponse.Error = "Payfirma Error: " + e.Message;
            }

            return payfirmaResponse;
        }
        private bool ValidLength(Double value)
        {
            bool isValid = true;

            if (value == 0)
            {
                errorMessage = string.Format("Input value shouldn't be zero.", value);
                isValid = false;
            }
            else if(value.ToString().Length > 9 || Math.Round((decimal)value) > 100)
            {
                errorMessage = string.Format("{0} is  not valid range.", value);
                isValid = false;
            }

            return isValid;
        }
Пример #34
0
 private bool VerifyToString(String id, Double myDouble, String expected)
 {
     try
     {
         String actual = myDouble.ToString();
         if (actual != expected)
         {
             TestLibrary.TestFramework.LogError(id + "_001", "Expected: " + expected + " Actual: " + actual);
             return false;
         }
     }
     catch (Exception e)
     {
         TestLibrary.TestFramework.LogError(id + "_002", "Unexpected exception occurs: " + e);
         return false;
     }
     return true;
 }
Пример #35
0
        //AbonoVenta
        public static void TicketAbonoVentaCredito(SalePayment abono, Sale venta, Double deuda, String clientName)
        {
            Company empresa = CompanyHelper.currentCompany;
            Ticket ticket = getTicket(clientName);

            ticket.AddSubHeaderLine("Venta # " + venta.ID);
            ticket.AddSubHeaderLine("Abono # " + abono.ID);
            ticket.AddSubHeaderLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString());

            ticket.AddTotal("Total Venta", venta.Total.ToString("C"));
            ticket.AddTotal("Deuda:", deuda.ToString("C"));
            ticket.AddTotal("Abono:", abono.Payment.ToString("C"));
            ticket.AddTotal("Saldo:", (deuda-abono.Payment).ToString("C"));
            ticket.AddTotal("", "");

            ticket.AddFooterLine("VUELVA PRONTO");
            printTicket(ref ticket);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     DataView dv = (DataView)DateSelect.Select(DataSourceSelectArguments.Empty);
     DateTime dd = (DateTime)dv.Table.Rows[0][0];
     TextBox1.Text = dd.ToShortDateString();
     TextBox2.Text = ((int)dv.Table.Rows[0][1]).ToString();
     era = (Double)dv.Table.Rows[0][2];
     gt = (Double)dv.Table.Rows[0][3];
     tgt.Text = gt.ToString("n2");
     tera.Text = era.ToString("n2");
     DataView dvd = (DataView)EventDetails.Select(DataSourceSelectArguments.Empty);
     dt = (DateTime)dvd.Table.Rows[0][0];
     st = (TimeSpan)dvd.Table.Rows[0][1];
     et = (TimeSpan)dvd.Table.Rows[0][2];
     rdate.Text = dt.ToShortDateString();
     stime.Text = st.ToString();
     etime.Text = et.ToString();
 }
 public void adicionar_num(Double num)
 {
     if (stream.lastOperationSign == String.Empty)
     {
         if (resultado != 0)
         {
             stream.textBox += num.ToString();
             resultado = Double.Parse(stream.textBox);
         }
         else
         {
             stream.adicionar_num(num);
         }
     }
     else
     {
         stream.adicionar_num(num);
     }
 }
Пример #38
0
        //Stop the timer and step forwarding
        private void button8_Click(object sender, System.EventArgs e)
        {
            this.timer1.Enabled  = false;
            this.button6.Enabled = false;
            this.button7.Enabled = true;
            this.button7.Text    = "&Resume";

            fx = 52 + Math.Round((21.84 - Convert.ToDouble(distance)) / 0.0678, 2);
            cleanlastimage();
            power    = fuzzy();
            distance = Math.Round(sim1(), 2);
            angle    = sim2();

            this.label1.Text = angle.ToString();
            this.label2.Text = Convert.ToString(distance);
            this.label3.Text = power.ToString();
            fx = 52 + Math.Round((21.84 - distance) / 0.0678, 2);
            drawnewimage();
        }
Пример #39
0
        private void comboBoxMonth_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxMonth.SelectedItem.ToString() != "" && comboBoxMonth.SelectedItem.ToString() != "Ano Inteiro")
            {
                this.month = new Utils().monthStringToInt(comboBoxMonth.SelectedItem.ToString());

                String receit = sql.ExecuteScalar("select sum(tr.amount) from transactions tr, categories cat "
                    + "where strftime('%Y', tr.display_date) = '" + year + "' and strftime('%m', tr.display_date) = '" + month + "' and tr.cat_id = cat.cat_id and cat.cat_type = 1");
                receitas = new Utils().stringtoDouble(receit);
                labelReceitas.Text = receitas.ToString() + " €";

                String despe = sql.ExecuteScalar("select sum(tr.amount) from transactions tr, categories cat "
                    + "where strftime('%Y', tr.display_date) = '" + year + "' and strftime('%m', tr.display_date) = '" + month + "' and tr.cat_id = cat.cat_id and cat.cat_type = 2");
                despesas = new Utils().stringtoDouble(despe);
                labelDespesas.Text = despesas.ToString() + " €";

                totalCount(Math.Round(receitas - despesas, 2));

                //agora preencher o datgagridview
                fillDgvAll(false);
                allyear = false;
            }
            else
            {
                String receit = sql.ExecuteScalar("select sum(tr.amount) from transactions tr, categories cat "
                    + "where strftime('%Y', tr.display_date) = '" + year + "' and tr.cat_id = cat.cat_id and cat.cat_type = 1");
                receitas = new Utils().stringtoDouble(receit);
                labelReceitas.Text = receitas.ToString() + " €";

                String despe = sql.ExecuteScalar("select sum(tr.amount) from transactions tr, categories cat "
                    + "where strftime('%Y', tr.display_date) = '" + year + "' and tr.cat_id = cat.cat_id and cat.cat_type = 2");
                despesas = new Utils().stringtoDouble(despe);
                labelDespesas.Text = despesas.ToString() + " €";

                totalCount(Math.Round(receitas - despesas, 2));

                //agora preencher o datgagridview
                fillDgvAll(true);
                allyear = true;
            }
        }
Пример #40
0
        private void buttonOperator_click(object sender, EventArgs e)
        {
            Button button = (Button)sender;
            ustBilgi = button.Text;
            sonucDeger = Double.Parse(textBox1.Text);
            isustBilgi = true;

            switch (ustBilgi)
            {
                case "1/x":
                    textBox1.Text = (1 / sonucDeger).ToString();
                    label1.Text = "reciproc(" + sonucDeger.ToString() + ")";
                    break;
                case "±":
                    textBox1.Text = (sonucDeger * -1).ToString();
                    break;
                case "kök":
                    textBox1.Text = Math.Sqrt(sonucDeger).ToString();
                    break;
            }
        }
Пример #41
0
        public VOTABLE ConeSearch(System.Double ra, System.Double dec, System.Double sr)
        {
            CJobsTARGET = (HttpContext.Current.Request.RequestContext.RouteData.Values["anything1"] as string).ToUpper().Replace("CONE", "");

            VOTABLE v;

            if (!valid_input(ra, dec, sr))
            {
                throw new Exception(" Wrong input parameters ");
            }

            sr *= 60.0; // in arcminutes because dbo.fGetNearbyObjEq requires  arcminutes ;

            StringBuilder qry = new StringBuilder();

            qry.Append("select " + ConeSelect);
            qry.Append("  from PhotoPrimary p, dbo.fGetNearbyObjEq(" + ra + "," + dec + "," + sr + ") n");
            qry.Append("  where p.objId=n.objId");

            sr /= 60.0; // back to degrees as the ervices requieres;

            JobsSoapClient cjobs = new JobsSoapClient();
            //cjobs.Url = CJobsURL;

            DataSet   ds   = cjobs.ExecuteQuickJobDS(CJobsWSID, CJobsPasswd, qry.ToString(), CJobsTARGET, "FOR CONESEARCH", false);
            Hashtable ucds = FetchUCDS(ds, cjobs);
            VOTABLE   vot  = VOTableUtil.DataSet2VOTable(ds);

            vot.DESCRIPTION = new anyTEXT();
            // = "ConeSearch results from the Sloan Digital Sky Survey ";
            vot.RESOURCE[0].TABLE[0].Items = new object[ds.Tables[0].Columns.Count + 3];
            Hashtable votypes = VOTableUtil.getdataTypeTable();
            PARAM     p       = new PARAM();

            p.name     = "inputRA";
            p.datatype = (dataType)votypes[typeof(System.Single)];
            p.value    = ra.ToString();
            p.unit     = "degrees";
            vot.RESOURCE[0].TABLE[0].Items[0] = p;
            p          = new PARAM();
            p.name     = "inputDEC";
            p.datatype = (dataType)votypes[typeof(System.Single)];
            p.unit     = "degrees";
            p.value    = dec.ToString();
            vot.RESOURCE[0].TABLE[0].Items[1] = p;
            p          = new PARAM();
            p.name     = "inputSR";
            p.datatype = (dataType)votypes[typeof(System.Single)];
            p.unit     = "degrees";
            p.value    = sr.ToString();
            vot.RESOURCE[0].TABLE[0].Items[2] = p;

            vot.DESCRIPTION.Any = new System.Xml.XmlNode[1];
            XmlDocument doc = new XmlDocument();

            vot.DESCRIPTION.Any[0] = doc.CreateTextNode("DESCRIPTION");

            vot.DESCRIPTION.Any[0].InnerText = "ConeSearch results from the Sloan Digital Sky Survey " + CJobsTARGET;

            //vot.RESOURCE[0].Items[ind] = p;

            for (int x = 0; x < ds.Tables[0].Columns.Count; x++)
            {
                DataColumn col = ds.Tables[0].Columns[x];
                FIELD      f   = new FIELD();
                f.datatype = (dataType)votypes[col.DataType];
                f.ID       = fix(col.ColumnName);
                f.ucd      = ucds[fix(col.ColumnName)] != null ? ucds[fix(col.ColumnName)].ToString() : "UNKNOWN";
                vot.RESOURCE[0].TABLE[0].Items[x + 3] = f;
            }

            return(vot);
        }
Пример #42
0
 public override string ToString()
 {
     return(String.Format("({0}, {1}, {2}, {3})", x.ToString(), y.ToString(), z.ToString(), w.ToString()));
 }
Пример #43
0
 public override string ToString()
 {
     return(string.Format("{0}:{1}:{2}:{3}:{4}",
                          iInt64.ToString(), iDouble.ToString(), iComplex.ToString(), iBigInt.ToString(), iString));
 }
Пример #44
0
 public static string __ftoa(real r)
 {
     return(r.ToString());
 }
Пример #45
0
 public static System.String ToString_4(System.Double AValue)
 {
     return(AValue.ToString(FORMAT_DOUBLE_4));
 }
Пример #46
0
 public static string EncodeFloat(JsEncoder_Type_Float Value)
 {
     return(Value.ToString());
 }
Пример #47
0
 /// <summary>
 /// Returns a string like (0,0)
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return('(' + X.ToString() + '/' + Y.ToString() + ')');
 }
Пример #48
0
 internal Real(real _d)
 {
     d = _d; name = d.ToString("0.0#################");
 }
Пример #49
0
 protected override string toString()
 {
     return(value.ToString());
 }
Пример #50
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Returns the fully qualified type name of this instance. </summary>
        ///
        /// <returns>   A <see cref="T:System.String" /> containing a fully qualified type name. </returns>
        ///
        /// <seealso cref="M:System.ValueType.ToString()"/>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public override string ToString()
        {
            return(Value.ToString());
        }
Пример #51
0
 private void label1_Click(object sender, EventArgs e)
 {
     System.Double i = 1.2345678 / 3;
     label1.Text = i.ToString();
 }
Пример #52
0
 /// <summary>
 /// Converts this <see cref="Vector4"/> to a string with the given <paramref name="format"/>.
 /// </summary>
 /// <returns>A string representation of this vector.</returns>
 public string ToString(string format)
 {
     return($"({x.ToString(format)}, {y.ToString(format)}, {z.ToString(format)}, {w.ToString(format)})");
 }
Пример #53
0
 /// <summary>
 /// Returns a string representation of this logical time.
 /// </summary>
 /// <returns> a string representation of this logical time
 /// </returns>
 public override System.String ToString()
 {
     return(val.ToString());
 }
Пример #54
0
 public string ToString(string f)
 {
     return(string.Concat("{ ", "\"X\": " + X.ToString(f), ", ", "\"Y\": " + Y.ToString(f), " }"));
 }
Пример #55
0
 public string ToString(string format, IFormatProvider formatProvider)
 {
     return(m_v.ToString(format, formatProvider));
 }