private bool Signup(string id, string pw) { DataSet ds = DBFactory.ExcuteQuery( @"SELECT * " + @" FROM TB_CURER " + @" WHERE 1=1 " + @" AND CURER_ID = '" + id + "'" ); if (ds != null && ds.Tables[0].Rows.Count > 0) { Console.WriteLine(" id : " + ds.Tables[0].Rows[0][0]); return(false); } else { DBFactory.ExcuteNonQuery( @"INSERT INTO " + @" TB_CURER (CURER_ID, CURER_PW) " + @"VALUES " + @" ('" + id + "', '" + pw + "')" ); return(true); } }
// /*register Error*/ // private int Add_FigureToDb() { FileStream fs = new FileStream(pictureBox_fig_img.Tag.ToString(), FileMode.Open, FileAccess.Read); byte[] bImage = new byte[fs.Length]; fs.Read(bImage, 0, (int)fs.Length); int fNum = int.Parse(DBFactory.ExcuteQuery(@"SELECT count(*) FROM TB_FIGURE").Tables[0].Rows[0][0].ToString()); fNum++; DBFactory.ExcuteNonQuery( @"INSERT INTO " + @" TB_FIGURE (FIG_NUM,IMAGE,CATEGORY,DIVISION,SECTION,SYMBOL)" + @"VALUES" + @"('" + fNum + "','" + utfEncoding.ToUtf8(tb_img_path.Text) + "','" + utfEncoding.ToUtf8(comboBox_add_cate.Text) + "','" + utfEncoding.ToUtf8(comboBox_add_div.Text) + "','" + utfEncoding.ToUtf8(comboBox_add_sel.Text) + "','" + utfEncoding.ToUtf8(textBox_add_sym.Text) + "')" ); fs.Close(); return(fNum); }
private void insertForDB() { int pNum = int.Parse(DBFactory.ExcuteQuery(String.Format(Query.countFig)).Tables[0].Rows[0][0].ToString()); // 선택된 모래상자 이미지들을 DB에 저장 // TODO 쿼리를 전역변수로 바꾸기 for (int i = 0; i < 8; i++) { DBFactory.ExcuteNonQuery(@"INSERT INTO TB_PHOTO (PO_NUM, PHOTO_DATA) VALUES( (SELECT COUNT(*) FROM TB_PHOTO), '" + utfEncoding.ToUtf8(picBoxArr[i]) + "')"); } }
private void btn_search_pat_Click(object sender, EventArgs e) { DataSet ds = DBFactory.ExcuteQuery(@"SELECT PAT_NUM,PAT_NAME FROM TB_PATIENT"); //쿼리문 중복 바꿀 것 patnumList = new List <string>(); foreach (DataRow row in ds.Tables[0].Rows) { patListview.Items.Add(utfEncoding.FromUtf8(row[1].ToString())); patnumList.Add(row[0].ToString()); } }
private void listView_select_la_fig(string fignum) { DataSet ds = DBFactory.ExcuteQuery( String.Format(Query.selectFig, fignum) ); //FIG_NUM,IMAGE,CATEGORY,DIVISION,SECTION,SYMBOL string fiText = ds.Tables[0].Rows[0][5].ToString(); //Image fiText = utfEncoding.FromUtf8(fiText); //피규어 이름을 표시한다 textBox_la_fig.Text = fiText; laFigNum = ds.Tables[0].Rows[0][0].ToString(); }
private void view_pat_infor() { //throw new System.NotImplementedException(); DataSet ds = DBFactory.ExcuteQuery( @"SELECT * FROM TB_PATIENT WHERE PAT_NUM = " + "'" + patnum + "'" ); //IDX,PAT_NUM,PAT_NAME,PAT_AGE,PAT_SEX,PAT_FEATURE string patName = ds.Tables[0].Rows[0][2].ToString(); //Image patName = utfEncoding.FromUtf8(patName); //text를 표시한다 view_pat_name.Visible = true; view_pat_name.Text = patName; }
private void view_fig_imfor() { //throw new System.NotImplementedException(); DataSet ds = DBFactory.ExcuteQuery( @"SELECT * FROM TB_FIGURE WHERE FIG_NUM = " + "'" + fignum + "'" ); //FIG_NUM,IMAGE,CATEGORY,DIVISION,SECTION,SYMBOL string imgAdd = ds.Tables[0].Rows[0][1].ToString(); //Image imgAdd = utfEncoding.FromUtf8(imgAdd); //이미지의 크기를 PictureBox에 맞춘다 pictureBox_view_fig.SizeMode = PictureBoxSizeMode.StretchImage; //이미지를 표시한다 pictureBox_view_fig.Image = System.Drawing.Image.FromFile(imgAdd); }
private void btn_search_fig_Click(object sender, EventArgs e) { DataSet ds = DBFactory.ExcuteQuery(@"SELECT FIG_NUM,SYMBOL FROM TB_FIGURE"); /* * DataSet ds = DBFactory.ExcuteQuery(@"SELECT FIG_NUM,SYMBOL FROM TB_FIGURE WHERE " + "CATEGORY = '" + utfEncoding.ToUtf8(comboBox_finfig_cate.Text) + "','" + "OR DIVISION = '" + utfEncoding.ToUtf8(comboBox_finfig_div.Text) + "','" + "OR SELECTION = '" + utfEncoding.ToUtf8(comboBox_finfig_sec.Text) + "')" + ); * * **/ //쿼리문 중복 바꿀 것 fignumList = new List <string>(); foreach (DataRow row in ds.Tables[0].Rows) { listView1.Items.Add(utfEncoding.FromUtf8(row[1].ToString())); fignumList.Add(row[0].ToString()); } }
private bool Login(string id, string pw) { DataSet ds = DBFactory.ExcuteQuery( @"SELECT * " + @" FROM TB_CURER " + @" WHERE 1=1 " + @" AND CURER_ID = '" + id + "'" + @" AND CURER_PW = '" + pw + "'" ); if (ds != null && ds.Tables[0].Rows.Count > 0) { Console.WriteLine(" Login... - id : " + ds.Tables[0].Rows[0][0]); Session.curSession = new Session(); Session.curSession.id = id; return(true); } return(false); }