Esempio n. 1
0
 private void DbClearLog_Click(object sender, EventArgs e)
 {
     DbLogText.Clear();
     DbLogWriter.Close();
     DbActionSuccessLabel.Text = "История очищена";
     DbLogWriter = new System.IO.StreamWriter("routefinder.log", false);
 }
Esempio n. 2
0
 private void local_log_add_row(string row)
 {
     string[] tmp = row.Split(',');
     try
     {
         DbLogText.AppendText(tmp[0] + "/" + tmp[1] + "/" + tmp[2] + " " + (tmp[3].Length == 2 ? tmp[3] : "0" + tmp[3]) + ":" + (tmp[4].Length == 2 ? tmp[4] : "0" + tmp[4]) + ":" + (tmp[5].Length == 2 ? tmp[5] : "0" + tmp[5]) + " ");
         if (tmp[6] == "add")
         {
             DbLogText.AppendText("Добавлен ");
         }
         if (tmp[6] == "del")
         {
             DbLogText.AppendText("Удален ");
         }
         if (tmp[6] == "mod")
         {
             DbLogText.AppendText("Изменен");
         }
         if (tmp[7] == "c")
         {
             DbLogText.AppendText(" город: " + tmp[8]);
             if (tmp[6] == "mod")
             {
                 DbLogText.AppendText(String.Format(" на {0}\n", tmp[9]));
             }
             else
             {
                 DbLogText.AppendText("\n");
             }
         }
         if (tmp[7] == "r")
         {
             if (tmp[6] == "mod")
             {
                 DbLogText.AppendText(String.Format("ы параметры маршрута {0} - {1}: ({2} км, {3} ч, {4}$) на ({5} км, {6} ч, {7}$)\n", tmp[8], tmp[9], tmp[10], tmp[11], tmp[12], tmp[13], tmp[14], tmp[15]));
             }
             else
             {
                 DbLogText.AppendText(String.Format(" маршрут: {0} - {1} ({2} км, {3} ч, {4}$)\n", tmp[8], tmp[9], tmp[10], tmp[11], tmp[12]));
             }
         }
     }
     catch (IndexOutOfRangeException)
     {
         return;
     }
 }