示例#1
0
    /// <summary>
    /// ¤W¶Ç¹Ï¤ù
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string UploadFilePath = ConfigurationManager.AppSettings["UploadFilePath"];
            string UploadFileUrl  = ConfigurationManager.AppSettings["UploadFileUrl"];
            string Path           = Server.MapPath(UploadFilePath);
            if (!Directory.Exists(Path))
            {
                Directory.CreateDirectory(Path);
            }

            // Get the data
            HttpPostedFile uploadFile = Request.Files["Filedata"];
            string         fileName   = uploadFile.FileName;

            if (fileName.LastIndexOf(".") > -1)
            {
                string ext    = fileName.Substring(fileName.LastIndexOf("."));
                string fileId = fileName;
                uploadFile.SaveAs(Path + fileId);

                string[] A = fileId.Split(new Char[] { '_', '.' });
                Dialysis_Chart_Show.tools.DBMysql db = new Dialysis_Chart_Show.tools.DBMysql();
                string sql = "DELETE FROM zinfo_g_02 WHERE filename='" + fileId + "' ";
                db.Excute(sql);
                sql = "INSERT INTO zinfo_g_02 (pat_ic,no,filename) VALUES('" + A[0] + "','" + A[1] + "','" + fileId + "')";
                db.Excute(sql);

                Response.StatusCode = 200;
                Response.Write(fileId);
            }
            else
            {
                Response.StatusCode = 500;
                Response.Write("An error occured");
                Response.End();
            }
        }
        catch
        {
            // If any kind of error occurs return a 500 Internal Server error
            Response.StatusCode = 500;
            Response.Write("An error occured");
            Response.End();
        }
        finally
        {
            // Clean up

            Response.End();
        }
    }
示例#2
0
            /// <summary>
            /// cln1_patic: Tex_Patient_ID.Text
            /// </summary>
            static public void register_to_clinical1_nurse(string cln1_patic, string vascular_access, string tube_model, string before_weight)
            {
                DateTime t       = DateTime.Now;
                string   timenow = string.Format("{0:00}", t.Hour) + ":" + string.Format("{0:00}", t.Minute) + ":" + string.Format("{0:00}", t.Second);
                string   today   = DateTime.Now.ToString("yyyy-MM-dd");

                DBMysql db  = new DBMysql();
                string  sql = "";

                sql  = "SELECT cln1_diadate FROM clinical1_nurse ";
                sql += "WHERE cln1_patic='" + cln1_patic + "' AND cln1_diadate='" + today + "'";
                DataTable dt = db.Query(sql);

                if (dt.Rows.Count > 0)
                {
                    sql  = "UPDATE clinical1_nurse SET ";
                    sql += "cln1_col10='" + timenow + "' ";
                    //sql += "cln1_dateadded='" + today + "',";
                    //sql += "cln1_col34='" + vascular_access + "',"; //血管通路類型
                    //sql += "cln1_col27='" + tube_model + "',"; //管路型號
                    //sql += "cln1_col5='" + before_weight + "' "; //透析前體重
                    sql += "WHERE cln1_patic='" + cln1_patic + "' AND cln1_diadate='" + today + "'";
                }
                else
                {
                    #region 套用治療參數模板
                    Boolean dflag = true;
                    string  cln1_col4 = "", cln1_col34 = "", cln1_col3 = "", cln1_col6 = "";
                    string  cln1_col7 = "", cln1_col13 = "", cln1_col14 = "", cln1_col15 = "", cln1_col17 = "";
                    string  cln1_col28 = "", cln1_col29 = "", cln1_col30 = "", cln1_col31 = "";

                    sql  = "SELECT * FROM clinical1_doc_henan ";
                    sql += "WHERE cln1_patic='" + cln1_patic + "' AND cln1_diadate='" + today + "' ";
                    DataTable dt_doc = db.Query(sql);
                    if (dt.Rows.Count == 0)
                    {
                        sql    = "SELECT * FROM clinical1_doc_henan ";
                        sql   += "WHERE cln1_patic='" + cln1_patic + "' AND cln1_diadate='base' ";
                        dt_doc = db.Query(sql);
                        if (dt_doc.Rows.Count == 0)
                        {
                            dt_doc.Dispose();
                            db.myConnection.Close();
                            dflag = false;
                        }
                        else
                        {
                            dflag = true;
                        }
                    }
                    if (dflag)
                    {
                        cln1_col4  = dt_doc.Rows[0]["cln1_col1"].ToString();  //血管通路類型
                        cln1_col34 = dt_doc.Rows[0]["cln1_col2"].ToString();  //透析器型号
                        cln1_col3  = dt_doc.Rows[0]["cln1_col3"].ToString();  //透析方式
                        cln1_col6  = dt_doc.Rows[0]["cln1_col4"].ToString();  //干体重
                        cln1_col7  = dt_doc.Rows[0]["cln1_col6"].ToString();  //目标定容量
                        cln1_col13 = dt_doc.Rows[0]["cln1_col7"].ToString();  //首次剂量
                        cln1_col14 = dt_doc.Rows[0]["cln1_col8"].ToString();  //追加量
                        cln1_col15 = dt_doc.Rows[0]["cln1_col5"].ToString();  //抗凝药物
                        cln1_col17 = dt_doc.Rows[0]["cln1_col9"].ToString();  //总量
                        cln1_col28 = dt_doc.Rows[0]["cln1_col10"].ToString(); //透析液: 钾
                        cln1_col29 = dt_doc.Rows[0]["cln1_col11"].ToString(); //钙
                        cln1_col30 = dt_doc.Rows[0]["cln1_col12"].ToString(); //碳酸氢根
                        cln1_col31 = dt_doc.Rows[0]["cln1_col13"].ToString(); //钠

                        sql  = "INSERT INTO clinical1_nurse(cln1_patic, cln1_diadate, cln1_col10, cln1_dateadded, cln1_col5, ";
                        sql += "cln1_col4, cln1_col34, cln1_col3, cln1_col6, cln1_col15, ";
                        sql += "cln1_col13, cln1_col14, cln1_col17,";
                        sql += "cln1_col7, cln1_col28, cln1_col29, cln1_col30, cln1_col31) ";
                        sql += "VALUES('" + cln1_patic + "', '" + today + "','" + timenow + "','" + today + "','" + before_weight + "',";
                        sql += "'" + cln1_col4 + "','" + cln1_col34 + "','" + cln1_col3 + "','" + cln1_col6 + "','" + cln1_col15 + "',";
                        sql += "'" + cln1_col13 + "','" + cln1_col14 + "','" + cln1_col17 + "',";
                        sql += "'" + cln1_col7 + "','" + cln1_col28 + "','" + cln1_col29 + "','" + cln1_col30 + "','" + cln1_col31 + "')";
                    }
                    #endregion
                    else
                    {
                        sql  = "INSERT INTO clinical1_nurse(cln1_patic, cln1_diadate, cln1_col10, cln1_dateadded, cln1_col5) ";
                        sql += "VALUES('" + cln1_patic + "', '" + today + "','" + timenow + "','" + today + "','" + before_weight + "')";
                    }
                    Common.SaveERR("register_to_clinical1_nurse", sql);
                }
                db.Excute(sql);
                dt.Dispose();
            }