Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        //
        /*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);
        }
Esempio n. 3
0
        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]) + "')");
            }
        }
Esempio n. 4
0
 private bool Add_patient()
 {
     // throw new System.NotImplementedException();
     if (textBox_name.ToString() == null)
     {
         Console.WriteLine("No name");
         return(false);
     }
     else
     {
         DBFactory.ExcuteNonQuery(
             @"INSERT INTO "
             + @" TB_PATIENT (IDX,PAT_NUM,PAT_NAME,PAT_AGE,PAT_SEX,PAT_FEATURE)"
             + @"VALUES"
             + @"('" + Session.curSession.id + "','"
             + (new Random()).Next(1000000000) + "','"
             + utfEncoding.ToUtf8(textBox_name.Text) + "','"
             + int.Parse(textBox_age.Text) + "','"
             + utfEncoding.ToUtf8(this.selectedSex) + "','"
             + utfEncoding.ToUtf8(textbox_feat.Text) + "')"
             );
         return(true);
     }
 }
Esempio n. 5
0
 private void button2_Click(object sender, EventArgs e)
 {
     DBFactory.ExcuteNonQuery("INSERT INTO TB_CURER VALUES (1, 'test', 'test')");
 }