예제 #1
0
        public void Create(YdhlBrxz obj)
        {
            using (var conn = DbHelper.GetDbConnection())
            {
                conn.Execute(@"
IF NOT EXISTS ( SELECT  0
                FROM    dbo.YDHL_BRXZ
                WHERE   BRXZ = @BRXZ ) 
   BEGIN
         INSERT INTO dbo.YDHL_BRXZ ( ID, BRXZ, XZMC, PYDM, SJXZ, GSXZ )
         VALUES ( @ID, -- ID - uniqueidentifier
                  @BRXZ, -- BRXZ - int
                  @XZMC, -- XZMC - nvarchar(50)
                  @PYDM, -- PYDM - nvarchar(20)
                  @SJXZ, -- SJXZ - int
                  @GSXZ  -- GSXZ - int
                  )
   END",
                             new
                {
                    ID   = obj.Id,
                    BRXZ = obj.Brxz,
                    XZMC = obj.Xzmc,
                    PYDM = obj.Pydm,
                    SJXZ = obj.Sjxz,
                    GSXZ = obj.Gsxz
                });
            }
        }
예제 #2
0
 public BrxzCreatedMessage(YdhlBrxz brxz)
 {
     Brxz = brxz;
 }
예제 #3
0
 public void Create(YdhlBrxz brxz)
 {
     BrxzMessageForwarder.Forward(new BrxzCreatedMessage(brxz));
 }
예제 #4
0
 public void Create(YdhlBrxz brxz)
 {
     MessagePublisher.Publish(new BrxzCreatedMessage(brxz));
 }