public int Add(HealthHouseBCHAOModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"INSERT INTO HEALTHHOUSE_ULTRASONICB_RESULT
                                    ( 
                                        ID
                                        ,PID
                                        ,IDCardNo
                                        ,BCHAO
                                        ,BCHAOEx
                                        ,BCHAOther
                                        ,BCHAOtherEx
                                        ,ImgPath
                                    ) 
                                    VALUES 
                                     ( 
                                         @ID
                                        ,@PID
                                        ,@IDCardNo
                                        ,@BCHAO
                                        ,@BCHAOEx
                                        ,@BCHAOther
                                        ,@BCHAOtherEx
                                        ,@ImgPath
                                     ) ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@ID", MySqlDbType.String, 32),
                new MySqlParameter("@PID", MySqlDbType.String, 32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 50),
                new MySqlParameter("@BCHAO", MySqlDbType.String, 255),
                new MySqlParameter("@BCHAOEx", MySqlDbType.String, 100),
                new MySqlParameter("@BCHAOther", MySqlDbType.Int32),
                new MySqlParameter("@BCHAOtherEx", MySqlDbType.String, 32),
                new MySqlParameter("@ImgPath", MySqlDbType.DateTime),
            };

            cmdParms[0].Value = model.ID;
            cmdParms[1].Value = model.PID;
            cmdParms[2].Value = model.IDCardNo;
            cmdParms[3].Value = model.BCHAO;
            cmdParms[4].Value = model.BCHAOEx;
            cmdParms[5].Value = model.BCHAOther;
            cmdParms[6].Value = model.BCHAOtherEx;
            cmdParms[7].Value = model.ImgPath;

            object single = MySQLHelper.GetSingle(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }

            return(Convert.ToInt32(single));
        }
Beispiel #2
0
        public void InitEveryThing()
        {
            this.BchaoModel = this.BchaoBLL.GetModel(HealthHouseFactory.ID);
            if (this.BchaoModel == null)
            {
                this.BchaoModel          = new HealthHouseBCHAOModel();
                this.BchaoModel.IDCardNo = this.Model.IDCardNo;
            }
            CSingleItem item1 = new CSingleItem
            {
                Name    = "B超",
                Usual   = this.radbczc,
                Unusual = this.radbcyc,
                Info    = this.txtbcyc
            };

            this.BCHAO = item1;
            this.BCHAO.TransInfo(this.BchaoModel.BCHAO, this.BchaoModel.BCHAOEx);
            CSingleItem item2 = new CSingleItem
            {
                Name    = "B超其他",
                Usual   = this.radbcqtzc,
                Unusual = this.radbcqtyc,
                Info    = this.txtbcqtyc
            };

            this.BCHAOther = item2;
            this.BCHAOther.TransInfo(this.BchaoModel.BCHAOther, this.BchaoModel.BCHAOtherEx);
            if (!string.IsNullOrEmpty(this.BchaoModel.ImgPath) && File.Exists(this.BchaoModel.ImgPath))
            {
                //读取文件流
                System.IO.FileStream fs = new System.IO.FileStream(this.BchaoModel.ImgPath, FileMode.Open, FileAccess.Read);

                int    byteLength = (int)fs.Length;
                byte[] fileBytes  = new byte[byteLength];
                fs.Read(fileBytes, 0, byteLength);

                //文件流关閉,文件解除锁定
                fs.Close();
                Image image = Image.FromStream(new MemoryStream(fileBytes));

                pboxBShow.Image = image;
            }
            else
            {
                btnPrint.Visible = false;
            }
            this.EveryThingIsOk = true;
        }
        public bool Update(HealthHouseBCHAOModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(@"UPDATE HEALTHHOUSE_ULTRASONICB_RESULT 
                                     SET 
                                         PID = @PID 
                                        ,IDCardNo = @IDCardNo 
                                        ,BCHAO = @BCHAO 
                                        ,BCHAOEx = @BCHAOEx 
                                        ,BCHAOther = @BCHAOther 
                                        ,BCHAOtherEx = @BCHAOtherEx 
                                        ,ImgPath = @ImgPath 
                                      WHERE ID = @ID ");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@ID", MySqlDbType.Int32),
                new MySqlParameter("@PID", MySqlDbType.String, 32),
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 50),
                new MySqlParameter("@BCHAO", MySqlDbType.String, 255),
                new MySqlParameter("@BCHAOEx", MySqlDbType.String, 100),
                new MySqlParameter("@BCHAOther", MySqlDbType.Int32),
                new MySqlParameter("@BCHAOtherEx", MySqlDbType.String, 32),
                new MySqlParameter("@ImgPath", MySqlDbType.String),
            };

            cmdParms[0].Value = model.ID;
            cmdParms[1].Value = model.PID;
            cmdParms[2].Value = model.IDCardNo;
            cmdParms[3].Value = model.BCHAO;
            cmdParms[4].Value = model.BCHAOEx;
            cmdParms[5].Value = model.BCHAOther;
            cmdParms[6].Value = model.BCHAOtherEx;
            cmdParms[7].Value = model.ImgPath;

            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Beispiel #4
0
 public bool Update(HealthHouseBCHAOModel model)
 {
     return(this.dal.Update(model));
 }
Beispiel #5
0
 public int Add(HealthHouseBCHAOModel model)
 {
     return(this.dal.Add(model));
 }