private void button5_Click(object sender, EventArgs e) { log(conn_manager.Select_content()["content"].ToString()); t = conn_manager.SelectData(); r = t.Rows[0]; foreach (DataRow r in t.Rows) { log(r["user_id"].ToString()); } }
public void form_start() { conn_manager = new sql_connection_manager(this); manager = new Main_Manager(this, conn_manager); try { t = conn_manager.SelectData(); r = t.Rows[0]; try { string now_date = DateTime.Now.ToString("yyyy-MM-dd"); string latest_date; foreach (DataRow r2 in t.Rows) { listBox1.Items.Add(r2["user_id"].ToString()); latest_date = r2["latest_date"].ToString(); try { DateTime dt = DateTime.ParseExact(r2["latest_date"].ToString(), "MM/dd/yyyy", CultureInfo.InvariantCulture); latest_date = dt.ToString("yyyy-MM-dd"); } catch (Exception) { } //if latest_date is not equal to current date then upadte date and set like and comment count to 0 if (latest_date != now_date) { conn_manager.update_count_date(r2["user_id"].ToString(), now_date); } } } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } //Select the current item in the list listBox1.Focus(); listBox1.SetSelected(0, true); //Check #tag Status ,comment and job status ..IF Ok then Proceed Otherwise Stop if (checkCommentStatus() && checkHashTag()) { //시작 버튼 활성화 시도 //get the total users and login total_user = t.Rows.Count; //total_user = 2; } else { MessageBox.Show(" [데이터베이스] 기본 데이터를 입력하세요"); } } //else { MessageBox.Show("먼저 로그인하세요 "); } catch (Exception ex) { log("No Users Record found!!!"); log(ex.StackTrace); } }