protected void StreamService_DataReceivedEvent(object sender, EventArgs e)
        {
            try
            {
                DataReceivedEventArgs eventArgs = e as DataReceivedEventArgs;
                SampledStreamModel    model     = eventArgs.StreamDataResponse;

                var aTweet = new Tweet
                {
                    ChirpId           = Guid.NewGuid(),
                    TweetContent      = model?.data?.text,
                    FullTweetDataJson = model.data.source
                };


                _repository.Insert <Tweet>(new List <Tweet> {
                    aTweet
                });
                _repository.Save();


                Task.Run(() => ParseTweetMedtaData(aTweet, model));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.ToString() + e?.ToString());
            }
        }
Пример #2
0
    protected void btnGenearate_Click(object sender, EventArgs e)
    {
        FormSaleBLL saleBLL = new FormSaleBLL();
        FormDS.FormDataTable tbForm = null;

        string FormNoStr = this.txtFormNo.Text;
        if (!string.IsNullOrEmpty(FormNoStr)) {
            string[] FormNos = FormNoStr.Split(',');
            if (FormNos.Length > 0) {
                foreach (string FormNo in FormNos) {
                    tbForm = saleBLL.GetDataByFormNo(FormNo);
                    if (tbForm != null && tbForm.Count > 0) {
                        try {
                            saleBLL.GenerateSettlement(tbForm[0].FormID);
                            this.lblError.Text += "申请单"+FormNo+ "生成结案单成功,结案单号为<br />";
                        } catch (Exception) {
                            this.lblError.Text+=e.ToString()+"<br />";
                            throw;
                        }
                    }
                }
            }
        }
    }
Пример #3
0
 private void registerButtonClick(object sender, EventArgs e)
 {
     write(e.ToString(), false);
 }
Пример #4
0
    protected void Login1_Authenticate(object sender, EventArgs e)
    {
        String user     = inputEmail.Text;
        String password = inputPassword.Text;
        bool   verify   = false;

        try
        {
            string        QueryUserDetails = "Select PasswordHash, ActivatedBool, UserPermission from dbo.GeneralUser where EmailAddress = '" + user + "'"; // This query returns the password hash and the boolean for whether or not the profile is activated
            SqlConnection connection       = new SqlConnection(ConfigurationManager.ConnectionStrings["conString"].ConnectionString);                       // connection string is in web config
            connection.Open();
            SqlCommand     cmd = new SqlCommand(QueryUserDetails, connection);                                                                              // execute select statement
            SqlDataAdapter adp = new SqlDataAdapter(cmd);                                                                                                   // read in data from query results
            DataTable      dt  = new DataTable();                                                                                                           // create data table for sql query
            adp.Fill(dt);                                                                                                                                   // populate datatable with query results



            // Verify there are rows in the datatable before populating variables
            if (dt.Rows.Count > 0) // if the query finds the user-entered Email (username)
            {
                string activated  = dt.Rows[0][1].ToString();
                string permission = dt.Rows[0][2].ToString();
                // Get the PasswordHash from DB, verify the hash matches the user-entered password
                string pwHash = dt.Rows[0][0].ToString();
                verify = SimpleHash.VerifyHash(password, "MD5", pwHash);
                System.Diagnostics.Debug.WriteLine(verify);
                Session["loggedIn"] = verify;

                // Create permissions session variable
                Session["permission"] = permission.ToString();

                // If the log-in credentials are verified
                if (verify)
                {
                    // Verify that the user has activated their profile
                    if (activated == "True") // if the account's activated column is equal to true
                    {
                        // Redirect user to their profile based on their permission
                        if (permission == "5")
                        {
                            Session["UserID"] = user;
                            Response.Redirect("Admin.Dashboard.aspx"); // if all details match up, user is redirected to their profile page. TODO: Code profile page, figure out if statements for directing user to their appropriate profile type
                        }
                        if (permission == "4")
                        {
                            // redirect to staff/instructor/intern profile/// Community Wall
                            Session["UserID"] = user;
                            Response.Redirect("Wall.aspx");
                        }
                        if (permission == "3")
                        {
                            // redirect to student profile
                            Session["UserID"] = user;
                            Response.Redirect("Wall.aspx");
                        }
                        if (permission == "2")
                        {
                            // parent permission
                            //  Debug.WriteLine(user);
                            Session["UserID"] = inputEmail.Text;
                            Debug.WriteLine(Session["UserID"].ToString());
                            Response.Redirect("Wall.aspx");
                        }
                        if (permission == "1")
                        {
                            // redirect to cipher profile
                            Session["UserID"] = user;
                            Response.Redirect("Wall.aspx");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Error: Account is not activated. You will receive an e-mail when your account is approved and ready for activation");
                    }
                }
                else
                {
                    MessageBox.Show("Error: Invalid Password. Please enter the correct password or click 'Forgot Password'");
                }
            }
            else
            {
                MessageBox.Show("Error: That account does not exist! Please click sign up to join the community");
            }
        }
        catch (SqlException error)
        {
            MessageBox.Show(e.ToString());
            System.Diagnostics.Debug.WriteLine(error.ToString());
        }
    }
Пример #5
0
 private void Browser_BindingContextChanged(object sender, EventArgs e)
 {
     PrintShowLogMessage(e.ToString());
 }
Пример #6
0
 private void fichierToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Console.WriteLine(sender.ToString());
     Console.WriteLine(e.ToString());
     refreshStatusStrip("Maximiser la taille de la form");
 }
Пример #7
0
 void client_MqttMsgDisconnected(object sender, EventArgs e)
 {
     Debug.Log("Disconnected: " + e.ToString());
 }
Пример #8
0
 protected void btnSavePaymentInfo_Click(object sender, EventArgs e)
 {
     DateTime PaymentDate = DateTime.MinValue;
     decimal PaymentAmount = decimal.Zero;
     if (!string.IsNullOrEmpty(ucPaymentDate.SelectedDate)) {
         DateTime.TryParse(ucPaymentDate.SelectedDate, out PaymentDate);
     }
     if (PaymentDate == DateTime.MinValue) {
         PageUtility.ShowModelDlg(this, "֧��������д����ȷ��");
         return;
     }
     try {
         SalesReimburseBLL.UpdateFormReimburseForRealPaymentInfo(int.Parse(this.ViewState["ObjectId"].ToString()), PaymentDate);
     } catch (Exception) {
         PageUtility.ShowModelDlg(this, e.ToString());
         throw;
     }
     if (this.Request["Source"] != null) {
         this.Response.Redirect(this.Request["Source"].ToString());
     } else {
         this.Response.Redirect("~/Home.aspx");
     }
 }
Пример #9
0
 private void Test3(object sender, EventArgs e)
 {
     Console.WriteLine("Static EventArgs is {0}: ", e.ToString());
 }
Пример #10
0
 private void HandleError(Object sender, EventArgs e)
 {
     Logger.Append("RAPI", Severity.ERROR, "Remoting API service error : " + e.ToString());
 }
Пример #11
0
 static void ws_OnOpen(object sender, EventArgs e)
 {
     Console.WriteLine(DateTime.Now.ToString() + " ws_OnOpen says: " + e.ToString());
 }
Пример #12
0
        /// <summary>
        /// 提交 手术
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_tj_Click(object sender, EventArgs e)
        {
            try
            {
                /*
                 * T_IN_Code_Information 编目信息表
                 * ID
                 * 编目状态
                 * 编目人
                 * 编目时间
                 * 住院号
                 */
                //TODO:
                string        User_Id        = App.UserAccount.UserInfo.User_id;
                List <string> ls_name        = new List <string>(); //存储dgv_1中的手术操作名称
                List <string> ls_ID          = new List <string>(); //存储dgv_1中的主键ID
                List <string> ls_code        = new List <string>();
                List <string> ls_time        = new List <string>();
                List <string> ls_operationor = new List <string>();
                List <string> ls_xh          = new List <string>();

                DataInit.Count    = 0;
                DataInit.Count_xh = 0;
                for (int i = 0; i < dgv_1.Rows.Count; i++)
                {
                    string operationName = dgv_1.Rows[i].Cells["手术操作名称"].Value.ToString();
                    string iid           = dgv_1.Rows[i].Cells["ID"].Value.ToString();
                    string operationCode = dgv_1.Rows[i].Cells["操作编码"].Value.ToString();
                    string operationTime = dgv_1.Rows[i].Cells["操作日期"].Value.ToString();
                    string operationor   = dgv_1.Rows[i].Cells["手术操作人"].Value.ToString();
                    string xh            = dgv_1.Rows[i].Cells["序号"].Value.ToString();

                    ls_name.Add(operationName);
                    ls_ID.Add(iid);
                    ls_code.Add(operationCode);
                    ls_time.Add(operationTime);
                    ls_operationor.Add(operationor);
                    ls_xh.Add(xh);
                }
                List <string> ls_2_icd10 = new List <string>(); //存储dgv_2中的编码
                List <string> ls_2_ID    = new List <string>(); //存储dgv_2中的主键ID
                List <string> ls_2_xh    = new List <string>(); //存储dgv_2中的主键ID
                for (int i = 0; i < dgv_2.Rows.Count; i++)
                {
                    string icd10_2_operationor = dgv_2.Rows[i].Cells["操作编码"].Value.ToString();
                    string ID_2_operationor    = dgv_2.Rows[i].Cells["ID"].Value.ToString();
                    string xh_2 = dgv_2.Rows[i].Cells["序号"].Value.ToString();
                    ls_2_icd10.Add(icd10_2_operationor);
                    ls_2_ID.Add(ID_2_operationor);
                    ls_2_xh.Add(xh_2);
                }
                for (int k = 0; k < ls_code.Count; k++)
                {
                    if (ls_code[k].ToString() != ls_2_icd10[k].ToString() && ls_ID[k].ToString() == ls_2_ID[k].ToString())
                    {
                        DataInit.Count++;
                        int    _ID = App.GenId();
                        int    ID_ = App.GenId();
                        string operationCode_Befor = ls_code[k].ToString();    //之前的诊断编码
                        string operationCode_After = ls_2_icd10[k].ToString(); //之后的诊断编码
                        string iid = ls_2_ID[k].ToString();                    //与首页手术表主键相关联的ID
                        string befor = "修改前"; string after = "修改后";

                        /*
                         * 1.先插入之前的手术信息
                         * 2.再插入新的手术信息
                         * 3.更新cover_operation中的诊断信息
                         * **/
                        string Sql_Operation_Befor = "insert into T_IN_Code_Operation(ID,PATIENT_ID,operationname,operationcode,operationtime,operator,user_id,iid,key_id,befororafter )values('" + _ID + "','" + Pid + "','" + ls_name[k].ToString() + "','" + operationCode_Befor + "',to_date('" + ls_time[k].ToString() + "','yyyy-MM-dd hh24:mi:ss'),'" + ls_operationor[k].ToString() + "','" + User_Id + "','" + iid + "','" + DataInit.ID + "','" + befor + "')";
                        App.ExecuteSQL(Sql_Operation_Befor);//1

                        string Sql_Operation_After = "insert into T_IN_Code_Operation(ID,PATIENT_ID,operationname,operationcode,operationtime,operator,user_id,iid,key_id,befororafter )values('" + ID_ + "','" + Pid + "','" + ls_name[k].ToString() + "','" + operationCode_After + "',to_date('" + ls_time[k].ToString() + "','yyyy-MM-dd hh24:mi:ss'),'" + ls_operationor[k].ToString() + "','" + User_Id + "','" + iid + "','" + DataInit.ID + "','" + after + "')";
                        App.ExecuteSQL(Sql_Operation_After);                                                                                      //2

                        string Sql_Update          = "update cover_operation set oper_code='" + operationCode_After + "' where id='" + iid + "'"; //3
                        App.ExecuteSQL(Sql_Update);
                    }
                    if (ls_xh[k].ToString() != ls_2_xh[k].ToString())
                    {
                        DataInit.Count_xh++;
                        string iid        = ls_2_ID[k].ToString();//与首页手术表主键相关联的ID
                        string xh_2       = ls_2_xh[k].ToString();
                        string Sql_Update = "update cover_operation set o_number='" + xh_2 + "' where id='" + iid + "'";
                        App.ExecuteSQL(Sql_Update);
                    }
                }
                //App.Msg("提交成功!");
                Operation();
                ls_name        = null;
                ls_ID          = null;
                ls_code        = null;
                ls_time        = null;
                ls_operationor = null;
                ls_2_icd10     = null;
                ls_2_ID        = null;
            }
            catch (Exception)
            {
                App.MsgErr(e.ToString());
            }
        }
Пример #13
0
 private void folderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Console.WriteLine(e.ToString());
 }
Пример #14
0
 protected void Handler(object sender, EventArgs e)
 {
     ListBox1.Items.Add(((Control)sender).GetType().Name + "  " + e.ToString());
 }
Пример #15
0
 /// <summary>
 /// Function to exit the application programatically in case windows X button doesn't work or the windows bar is missing
 /// </summary>
 /// <param name="sender"> reference to the object that raised the event</param>
 /// <param name="e"> event specific object with relevant parameters </param>
 private void button_exit_program_Click(object sender, EventArgs e)
 {
     log.Log(lq.critical_message, "user clicked on the program exit button: " + e.ToString(), new string[] { "user input" });
     this.Close(); // exits the program
 }
Пример #16
0
        /// <summary>
        /// Called whenever the dragon's body sends something to its brain.
        /// </summary>
        /// <param name="e">The event that occured.</param>
        /// <param name="sender">The source of the event.</param>
        /// <param name="args">The event details.</param>
        public override void Notify(DOL.Events.DOLEvent e, object sender, EventArgs args)
        {
            base.Notify(e, sender, args);
            if (sender == Body)
            {
                GameDragon dragon = sender as GameDragon;
                if (e == GameObjectEvent.TakeDamage)
                {
                    if (CheckHealth())
                    {
                        return;
                    }

                    // Someone hit the dragon. If the attacker is in melee range, there
                    // is a chance the dragon will cast a debuff specific to melee
                    // classes on him, if not, well, dragon will try to get its Glare off...
                    GameObject source = (args as TakeDamageEventArgs).DamageSource;
                    if (source != null)
                    {
                        if (dragon.IsWithinRadius(source, dragon.AttackRange))
                        {
                            dragon.CheckMeleeDebuff(source as GamePlayer);
                        }
                        else
                        {
                            dragon.CheckGlare(source as GamePlayer);
                        }
                    }
                    else
                    {
                        log.Error("Dragon takes damage from null source. args = " + (args == null ? "null" : args.ToString()));
                    }
                }
                else if (e == GameLivingEvent.EnemyHealed)
                {
                    // Someone healed an enemy. If the healer is in melee range, there
                    // is a chance the dragon will cast a debuff specific to ranged
                    // classes on him, if not, there's still Glare...
                    GameObject source = (args as EnemyHealedEventArgs).HealSource;

                    if (source != null)
                    {
                        if (dragon.IsWithinRadius(source, dragon.AttackRange))
                        {
                            dragon.CheckRangedDebuff(source as GamePlayer);
                        }
                        else
                        {
                            dragon.CheckGlare(source as GamePlayer);
                        }
                    }
                    else
                    {
                        log.Error("Dragon heal source null. args = " + (args == null ? "null" : args.ToString()));
                    }
                }
            }
            else if (e == GameNPCEvent.ArriveAtTarget && sender != null)
            {
                // Message from another NPC, such as a retriever,
                // for example.
                log.Info(string.Format("DragonBrain.Notify: ArriveAtTarget({0})", (sender as GameObject).Name));
                (Body as GameDragon).OnRetrieverArrived(sender as GameNPC);
            }
        }
Пример #17
0
 private void HandleUnknownMsg(Object sender, EventArgs e)
 {
     Logger.Append("RAPI", Severity.ERROR, "Remoting API service received unknown message : " + e.ToString());
 }
Пример #18
0
 void btn1_onclick(object sender, EventArgs e)
 {
     Text = "Sender: " + sender.ToString() + " - Event: " + e.ToString();
 }
 void Handler(object sender, EventArgs e)
 {
     Log.Out(msg: "{0} saw event {1}", (object)ToString(), e != null ? (object)e.ToString() : (object)"null");
     if (this._sinkReference == null || !(this._sinkReference.Target is IEventSink target))
     {
         return;
     }
     target.SinkEvent(eventArgs: new WaiterEventArgs(sender: sender, eventArgs: e));
 }
Пример #20
0
        private void buttonFilter_Click(object sender, EventArgs e)
        {
            try
            {
                buttonFilter.Enabled = false;
                textBoxFound.Text    = "";
                textBoxNotFound.Text = "";
                //textBoxLog.Text += "开始筛选\r\n";

                //获取文本到动态数组
                ArrayList arrSource = new ArrayList();
                foreach (string str in textBoxSource.Lines)
                {
                    arrSource.Add(str);
                }
                ArrayList arrTarget = new ArrayList();
                foreach (string str in textBoxTarget.Lines)
                {
                    arrTarget.Add(str);
                }


                //交叉比较文本
                int j = 0;
                foreach (object o in arrTarget)
                {
                    for (int i = 0; i < arrSource.Count; i++)
                    {
                        object c = arrSource[i];
                        if (c.ToString() == o.ToString() && o.ToString() != "")
                        {
                            textBoxFound.Text += o.ToString() + "\r\n";
                            j++;
                        }
                    }
                }
                textBoxLog.Text += "已发现目标数:" + j.ToString() + "\r\n";

                //列出未找到的文本

                ArrayList arrFound = new ArrayList();
                foreach (string str in textBoxFound.Lines)
                {
                    arrFound.Add(str);
                }
                int l = textBoxTarget.Lines.GetUpperBound(0);
                for (int i = 0; i < textBoxFound.Lines.GetUpperBound(0); i++)
                {
                    //if (arrTarget.Count == arrFound.Count)
                    //{
                    //break;
                    //}
                    string strFound = arrFound[i].ToString();

                    for (int k = 0; k < l; k++)
                    {
                        string strTarget = arrTarget[k].ToString();

                        if (strTarget == strFound)
                        {
                            arrTarget.RemoveAt(k);
                            l--;
                            k--;
                        }
                    }
                }

                for (int i = 0; i < arrTarget.Count; i++)
                {
                    textBoxNotFound.Text += arrTarget[i].ToString() + "\r\n";
                }
                textBoxLog.Text += "未发现目标数:" + (arrTarget.Count - 1).ToString() + "\r\n";


                buttonFilter.Enabled = true;
            }
            catch
            {
                MessageBox.Show(e.ToString(), "Error");
            }
        }
 private void Arduino_Disposed(object sender, EventArgs e)
 {
     Console.Out.WriteLine("Arduino port disposed." + e.ToString());
 }
Пример #22
0
 private void Txtusername_Completed(object sender, EventArgs e)
 {
     lblusername.Text = "completed" + e.ToString();
 }
Пример #23
0
        private void websocket_Closed(object sender, EventArgs e)
        {
            Debug.WriteLine("CLOSE: " + e.ToString());

            Authenticated = false;
        }
Пример #24
0
 private void BtnGo_Click(object sender, EventArgs e)
 {
     lbl1.Text = "Go button clicked.";
     lbl2.Text = sender.ToString();
     lbl3.Text = e.ToString();
 }
Пример #25
0
 private void ItemExit_Click(object sender, EventArgs e)
 {
     this.Close();
     Environment.Exit(0);
     SystemLog.Output(SystemLog.MSG_TYPE.Err, "PLC To GMES", e.ToString());
 }
Пример #26
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection connec    = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        mssqlatma = "SELECT avg(zaman) as zaman2 FROM[dbo].[mssqlatma]";
                SqlCommand    cmd       = new SqlCommand(mssqlatma, connec);
                SqlDataReader reader    = null;
                int           mssqlat   = 0;
                connec.Open();
                try
                {
                    reader = cmd.ExecuteReader();
                    while (reader.Read())   // This is how record is read. Loop through the each record
                    {
                        mssqlat = reader.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    reader.Close();
                    connec.Close();
                }
                SqlConnection connece    = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        mssqlcekme = "SELECT avg(zaman) as zaman2 FROM[dbo].[mssqlcekme]";
                SqlCommand    cmdd       = new SqlCommand(mssqlcekme, connece);
                SqlDataReader readerr    = null;
                int           mssqlcek   = 0;
                connece.Open();
                try
                {
                    readerr = cmdd.ExecuteReader();
                    while (readerr.Read())   // This is how record is read. Loop through the each record
                    {
                        mssqlcek = readerr.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    readerr.Close();
                    connece.Close();
                }
                SqlConnection connecet  = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        mysqlatma = "SELECT avg(zaman) as zaman2 FROM[dbo].[mysqlatma]";
                SqlCommand    cmddd     = new SqlCommand(mysqlatma, connecet);
                SqlDataReader readerrr  = null;
                int           mysqlat   = 0;
                connecet.Open();
                try
                {
                    readerrr = cmddd.ExecuteReader();
                    while (readerrr.Read())   // This is how record is read. Loop through the each record
                    {
                        mysqlat = readerrr.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    readerrr.Close();
                    connecet.Close();
                }
                SqlConnection con        = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        mysqlcekme = "SELECT avg(zaman) as zaman2 FROM[dbo].[mysqlcekme]";
                SqlCommand    cmdddd     = new SqlCommand(mysqlcekme, con);
                SqlDataReader readerrrr  = null;
                int           mysqlcek   = 0;
                con.Open();
                try
                {
                    readerrrr = cmdddd.ExecuteReader();
                    while (readerrrr.Read())   // This is how record is read. Loop through the each record
                    {
                        mysqlcek = readerrrr.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    readerrrr.Close();
                    con.Close();
                }
                SqlConnection conn           = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        postgresqlatma = "SELECT avg(zaman) as zaman2 FROM[dbo].[postgresql]";
                SqlCommand    cmddddd        = new SqlCommand(postgresqlatma, conn);
                SqlDataReader readerrrrr     = null;
                int           postgresqlat   = 0;
                conn.Open();
                try
                {
                    readerrrrr = cmddddd.ExecuteReader();
                    while (readerrrrr.Read())   // This is how record is read. Loop through the each record
                    {
                        postgresqlat = readerrrrr.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    readerrrrr.Close();
                    conn.Close();
                }
                SqlConnection conne           = new SqlConnection(@"Data Source=DESKTOP-VOC3F1I\SQLEXPRESS;Initial Catalog=zamancizelgesi;Integrated Security = True;");
                string        postgresqlcekme = "SELECT avg(zaman) as zaman2 FROM[dbo].[postgresqlatma]";
                SqlCommand    cmdddddd        = new SqlCommand(postgresqlcekme, conne);
                SqlDataReader readerrrrrr     = null;
                int           postgresqlcek   = 0;
                conne.Open();
                try
                {
                    readerrrrrr = cmdddddd.ExecuteReader();
                    while (readerrrrrr.Read())   // This is how record is read. Loop through the each record
                    {
                        postgresqlcek = readerrrrrr.GetInt32(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("! " + e.ToString());
                }
                finally
                {
                    readerrrrrr.Close();
                    conne.Close();
                }
                MailMessage mail       = new MailMessage();
                SmtpClient  SmtpServer = new SmtpClient("smtp.gmail.com");
                string      mailll     = textBox1.Text;
                if (IsValidEmail(mailll))
                {
                    mail.From = new MailAddress("*****@*****.**");
                    mail.To.Add(mailll);
                    mail.Subject = "Mailin basligi";
                    mail.Body    = "Mssql import taking time: " + mssqlat.ToString() + "\nMssql export taking time: " + mssqlcek.ToString() + "\nMysql import taking time: " + mysqlat.ToString() + "\nMysql export taking time: " + mysqlcek.ToString() + "\nPostgresql import taking time: " + postgresqlat.ToString() + "\nPostgresql export taking time:  " + postgresqlcek.ToString();

                    SmtpServer.Port        = 587;
                    SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "Smtp.1234");
                    SmtpServer.EnableSsl   = true;

                    SmtpServer.Send(mail);
                    MessageBox.Show("Mail sent");
                }
                else
                {
                    MessageBox.Show("Mail cannot send");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Mail cannot send");
            }
        }
Пример #27
0
 private void PointCounts_Error(object sender, EventArgs e)
 {
     this.Master.SetErrorMessage(e.ToString());
 }
 public void OnAssociationRelease(object sender, EventArgs args)
 {
     _logger.Log(LogLevel.Information, $"OnAssociationRelease {sender.ToString()} {args.ToString()}");
 }
Пример #29
0
 public override string ToString()
 {
     return("SubscriptionEventArg(" + (_args == null ? "null" : _args.ToString()) + ")");
 }
Пример #30
0
 private void LogFunc(object sender, EventArgs e)
 {
     Debug.WriteLine(e.ToString());
 }
Пример #31
0
 private void update_load(object sender, EventArgs e)
 {
     percent_num_lbl.Dispatcher.BeginInvoke((Action)(() => percent_num_lbl.Content = Math.Round(Convert.ToDouble(e.ToString()), 2)));
     percent_bar.Dispatcher.BeginInvoke((Action)(() => percent_bar.Value = Convert.ToDouble(e.ToString())));
 }
Пример #32
0
 private void AxRDPViewer_OnConnectionFailed(object sender, EventArgs e)
 {
     this.OnDisconnectedEvent?.Invoke(this, new DisconnectEventArgs(8888, "连接服务器失败:" + e.ToString()));
 }
Пример #33
0
 /// <include file='doc\ListManager.uex' path='docs/doc[@for="CurrencyManager.OnPositionChanged"]/*' />
 /// <devdoc>
 /// </devdoc>
 protected virtual void OnPositionChanged(EventArgs e)
 {
     // if (!inChangeRecordState) {
     Debug.WriteLineIf(CompModSwitches.DataView.TraceVerbose, "OnPositionChanged(" + listposition.ToString(CultureInfo.InvariantCulture) + ") " + e.ToString());
     try {
         if (onPositionChangedHandler != null)
         {
             onPositionChangedHandler(this, e);
         }
     }
     catch (Exception ex) {
         OnDataError(ex);
     }
     // }
 }
Пример #34
0
 public void TheCalendar_SelectionChanged(object sender, EventArgs e)
 {
     String s = e.ToString();
 }
Пример #35
0
        /// <include file='doc\ListManager.uex' path='docs/doc[@for="CurrencyManager.OnCurrentChanged"]/*' />
        /// <devdoc>
        /// <para>Causes the CurrentChanged event to occur. </para>
        /// </devdoc>
        internal protected override void OnCurrentChanged(EventArgs e)
        {
            if (!inChangeRecordState)
            {
                Debug.WriteLineIf(CompModSwitches.DataView.TraceVerbose, "OnCurrentChanged() " + e.ToString());
                int  curLastGoodKnownRow = lastGoodKnownRow;
                bool positionChanged     = false;
                if (!suspendPushDataInCurrentChanged)
                {
                    positionChanged = CurrencyManager_PushData();
                }
                if (Count > 0)
                {
                    object item = list[Position];
                    if (item is IEditableObject)
                    {
                        ((IEditableObject)item).BeginEdit();
                    }
                }
                try {
                    // if currencyManager changed position then we have two cases:
                    // 1. the previous lastGoodKnownRow was valid: in that case we fell back so do not fire onCurrentChanged
                    // 2. the previous lastGoodKnownRow was invalid: we have two cases:
                    //      a. FindGoodRow actually found a good row, so it can't be the one before the user changed the position: fire the onCurrentChanged
                    //      b. FindGoodRow did not find a good row: we should have gotten an exception so we should not even execute this code
                    if (!positionChanged || (positionChanged && curLastGoodKnownRow != -1))
                    {
                        if (onCurrentChangedHandler != null)
                        {
                            onCurrentChangedHandler(this, e);
                        }

                        // we fire OnCurrentItemChanged event every time we fire the CurrentChanged + when a property of the Current item changed
                        if (onCurrentItemChangedHandler != null)
                        {
                            onCurrentItemChangedHandler(this, e);
                        }
                    }
                }
                catch (Exception ex) {
                    OnDataError(ex);
                }
            }
        }
Пример #36
0
 public int Test4(object sender, EventArgs e)
 {
     Console.WriteLine("Int value return EventArgs is {0}: ", e.ToString());
     return 1;
 }
Пример #37
0
 void ws_OnOpen(object sender, EventArgs e)
 {
     UpdateListBox(" ws_OnOpen says: " + e.ToString());
     ConnectStomp();
 }
Пример #38
0
 void btn1_onclick2(object sender, EventArgs e)
 {
     Console.WriteLine(String.Format("Sender: {0} - Event: {1}", sender.ToString(), e.ToString()));
 }
    protected void gvMain_DataBound(object sender, EventArgs e)
    {
        try
        {
            //Literal litPageInfo = gvMain.TopPagerRow.FindControl("litPageInfo") as Literal;
            //if (litPageInfo != null) litPageInfo.Text = string.Format(Resources.Message.PagingInfo, gvMain.PageIndex + 1, gvMain.PageCount, HttpContext.Current.Items["rowCount"]);

            List<Exchangepartheader> listEph = (new ExchangePartHeaderDataSource()).Select(fromDate, toDate, status, ddlDealer.SelectedValue);
            if (listEph.Count > 0)
            {
                long TotalQuantity = 0;
                long TotalPartCost = 0;
                long TotalHireCost = 0;
                long TotalTotal = 0;

                foreach (Exchangepartheader eph in listEph)
                {
                    List<Exchangepartdetail> listEpd = ExchangeVoucherBO.GetExPartDetailByExPartHeader(eph);
                    long Total = 0;
                    if (listEpd.Count > 0)
                    {
                        long Quantity = 0;
                        long PartCost = 0;
                        Total = 0;
                        foreach (Exchangepartdetail epd in listEpd)
                        {
                            Quantity = Quantity + epd.Partqtym;
                            PartCost = PartCost + (long)epd.Partqtym * epd.Unitpricem;
                        }
                        TotalQuantity = TotalQuantity + Quantity;
                        TotalPartCost = TotalPartCost + PartCost;
                        Total = PartCost + eph.Feeamount;
                    }
                    TotalHireCost = TotalHireCost + eph.Feeamount;
                    TotalTotal = TotalTotal + Total;
                }

                Literal litTotalQuantity = gvMain.FooterRow.FindControl("litTotalQuantity") as Literal;
                if (litTotalQuantity != null) litTotalQuantity.Text = NumberFormatHelper.NumberToCurentMoneyFormatString(TotalQuantity);

                Literal litTotalPartCost = gvMain.FooterRow.FindControl("litTotalPartCost") as Literal;
                if (litTotalPartCost != null) litTotalPartCost.Text = NumberFormatHelper.NumberToCurentMoneyFormatString(TotalPartCost);

                Literal litTotalHireCost = gvMain.FooterRow.FindControl("litTotalHireCost") as Literal;
                if (litTotalHireCost != null) litTotalHireCost.Text = NumberFormatHelper.NumberToCurentMoneyFormatString(TotalHireCost);

                Literal litTotalTotal = gvMain.FooterRow.FindControl("litTotalTotal") as Literal;
                if (litTotalTotal != null) litTotalTotal.Text = NumberFormatHelper.NumberToCurentMoneyFormatString(TotalTotal);
            }
        }
        catch
        {
            bllMessage.Items.Add(e.ToString());
        }
    }