Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
 public void Save(PayrollTypeInfo info)
 {
     if (this.IsExisted(info))
     {
         this.Update(info);
     }
     else
     {
         this.Insert(info);
     }
 }
Ejemplo n.º 3
0
    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();
    }
Ejemplo n.º 4
0
    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();
    }