예제 #1
0
파일: PayrollType.cs 프로젝트: liamning/PF
    public bool IsExisted(PayrollTypeInfo info)
    {
        db.Open();
        String query = "select count(*)  from PayrollType "
                       + " where PayrollType = @PayrollType ";
        var obj = (List <int>)db.Query <int>(query, info);

        db.Close();
        return(obj[0] > 0);
    }
예제 #2
0
파일: PayrollType.cs 프로젝트: liamning/PF
 public void Save(PayrollTypeInfo info)
 {
     if (this.IsExisted(info))
     {
         this.Update(info);
     }
     else
     {
         this.Insert(info);
     }
 }
예제 #3
0
파일: PayrollType.cs 프로젝트: liamning/PF
    public void Update(PayrollTypeInfo info)
    {
        db.Open();

        string query = " UPDATE [dbo].[PayrollType] SET  "
                       + " [PayrollTypeDesc] = @PayrollTypeDesc "
                       + ", [CreateUser] = @CreateUser "
                       + ", [CreateDate] = @CreateDate "
                       + ", [LastModifyUser] = @LastModifyUser "
                       + ", [LastModifyDate] = @LastModifyDate "
                       + " where PayrollType = @PayrollType ";


        db.Execute(query, info);
        db.Close();
    }
예제 #4
0
파일: PayrollType.cs 프로젝트: liamning/PF
    public void Insert(PayrollTypeInfo info)
    {
        db.Open();

        string query = "INSERT INTO [dbo].[PayrollType] ( [PayrollType] "
                       + ",[PayrollTypeDesc] "
                       + ",[CreateUser] "
                       + ",[CreateDate] "
                       + ",[LastModifyUser] "
                       + ",[LastModifyDate] "
                       + ") "
                       + "VALUES ( @PayrollType "
                       + ",@PayrollTypeDesc "
                       + ",@CreateUser "
                       + ",@CreateDate "
                       + ",@LastModifyUser "
                       + ",@LastModifyDate "
                       + ") ";


        db.Execute(query, info);
        db.Close();
    }